public override bool InitParse() { FileIniDataParser parser = new FileIniDataParser(); if (File.Exists(this.ConfigFileUrl)) { try { LoggerObj.Trace("Parsing data present in " + FILENAME); IniData configuration = parser.ReadFile(ConfigFileUrl); // Agent Platform Description this._platformName = configuration["AgentPlatformDescription"]["PlataformName"]; this._dynamic = bool.Parse(configuration["AgentPlatformDescription"]["AllowDynamic"]); this._mobility = bool.Parse(configuration["AgentPlatformDescription"]["AllowMobility"]); // Server this._serverPort = Int32.Parse(configuration["Server"]["Port"]); } catch (Exception ex) { LoggerObj.Error("On parsing data present in " + FILENAME); return(false); } } else { LoggerObj.Fatal("Config file " + FILENAME + " not found."); } return(true); }
public override bool InitParse() { FileIniDataParser parser = new FileIniDataParser(); if (File.Exists(this.ConfigFileUrl)) { try { LoggerObj.Trace("Parsing data present in " + FILENAME); IniData configuration = parser.ReadFile(ConfigFileUrl); // Agent Platform related _platformIp = configuration["AgentPlatform"]["IP"]; _platformPort = Int32.Parse(configuration["AgentPlatform"]["Port"]); // Compression Algorithms Available _supportedAlgorithms = configuration["CompressionAlgorithms"]["Compression"] .Split(',').ToList(); // User preferences related _preferedAlgorithm = configuration["Preferences"]["CompressionAlgorithm"]; _machineName = configuration["Preferences"]["MachineName"]; } catch (Exception ex) { LoggerObj.Error("On parsing data present in " + FILENAME); return(false); } } else { LoggerObj.Fatal("Config file " + FILENAME + " not found."); } return(true); }
public override void Timeout() { LoggerObj.LogTimeOut(GenerateKey() + " Time out!"); }
public override void Log() { LoggerObj.Log(GenerateKey() + " Stopped after " + Duration + " ms."); }