18 using erminas.SmartAPI.Utils;
20 namespace erminas.SmartAPI.CMS.ServerManagement
22 internal class ApplicationServer : PartialRedDotObject, IApplicationServer
25 private string _ipAddress;
26 private bool _isServerCheckDataLoaded;
27 private string _tempPath;
29 public ApplicationServer(Session session, Guid guid) : base(session, guid)
33 internal ApplicationServer(Session session, XmlElement element) : base(session, element)
40 get {
return LazyLoad(ref _from); }
41 internal set { _from = value; }
44 public string IpAddress
46 get {
return LazyLoad(ref _ipAddress); }
47 internal set { _ipAddress = value; }
50 public override void Refresh()
52 _isServerCheckDataLoaded =
false;
57 public string TempDirectoryPath
66 protected override void LoadWholeObject()
71 protected override XmlElement RetrieveWholeObject()
73 const string LOAD_APPLICATION_SERVER =
74 @"<ADMINISTRATION><EDITORIALSERVER action=""load"" guid=""{0}""/></ADMINISTRATION>";
76 XmlDocument xmlDoc = Session.ExecuteRQL(LOAD_APPLICATION_SERVER.RQLFormat(
this));
77 return xmlDoc.GetSingleElement(
"EDITORIALSERVER");
80 private void EnsureServerCheck()
82 if (_isServerCheckDataLoaded)
87 const string CHECK_SERVER =
88 @"<ADMINISTRATION><EDITORIALSERVER action=""check"" guid=""{0}""/></ADMINISTRATION>";
90 var xmlDoc = Session.ExecuteRQL(CHECK_SERVER.RQLFormat(
this));
91 var element = xmlDoc.GetSingleElement(
"EDITORIALSERVER");
93 _tempPath = element.GetAttributeValue(
"temppath");
95 _isServerCheckDataLoaded =
true;
98 private void LoadXml()
100 _from = _xmlElement.GetAttributeValue(
"adress");
101 _ipAddress = _xmlElement.GetAttributeValue(
"ip");
108 string IpAddress {
get; }
109 string TempDirectoryPath {
get; }