16 using System.Collections.Generic;
19 using erminas.SmartAPI.Utils.CachedCollections;
21 namespace erminas.SmartAPI.CMS.ServerManagement
23 internal class DatabaseServers : NameIndexedRDList<IDatabaseServer>, IDatabaseServers
25 private readonly ISession _session;
27 internal DatabaseServers(ISession session,
Caching caching) : base(caching)
30 RetrieveFunc = GetDatabaseServers;
33 private List<IDatabaseServer> GetDatabaseServers()
36 using (
new ServerManagementContext((Session) _session))
38 const string LIST_DATABASE_SERVERS =
39 @"<ADMINISTRATION><DATABASESERVERS action=""list"" /></ADMINISTRATION>";
40 XmlDocument xmlDoc = _session.ExecuteRQL(LIST_DATABASE_SERVERS, RQL.IODataFormat.SessionKeyAndLogonGuid);
42 XmlNodeList xmlNodes = xmlDoc.GetElementsByTagName(
"DATABASESERVER");
44 (from XmlElement curNode in xmlNodes select (IDatabaseServer)
new DatabaseServer(_session, curNode))