public void RefreshConnection() { ESBackupServerServiceClient client = new ESBackupServerServiceClient(); this._LoginResponse = client.Login(this._User.Username, this._User.Password); client.ClientReportUpdated(this._LoginResponse.SessionID); //if (client.HasConfigUpdate(this._LoginResponse.SessionID,this._Config.Generated)) if (true) { this._Scheduler.ClearJobs(); this._Config = client.GetConfiguration(this._LoginResponse.SessionID); //this._Scheduler.ScheduleClient((int)this._Config.ReportInterval); if (this._Config.Templates.Length != 0) { foreach (BackupTemplate template in this._Config.Templates) { if (template.Enabled) { this._Scheduler.ScheduleTemplate(template, this._LoginResponse.SessionID); } } } } client.Close(); }
private void StoreInfo(List <BackupInfo> data) { ESBackupServerServiceClient client = new ESBackupServerServiceClient(); foreach (BackupInfo info in data) { client.CreateBackup(info, this._SessionID); } client.Close(); }
public void Stop() { if (this._LoginResponse != null) { if (this._LoginResponse.UTCExpiration > DateTime.UtcNow) { ESBackupServerServiceClient client = new ESBackupServerServiceClient(); client.Logout(this._LoginResponse.SessionID); client.Close(); } } this._Scheduler.Stop(); }
public bool EstabilishConnection() { bool estabilished; ESBackupServerServiceClient client = new ESBackupServerServiceClient(); RegistrationResponse response = client.RequestRegistration("PC-Testik", "hwid"); if (response.Status == ClientStatus.Verified) { this._User = new User() { Username = response.Username, Password = response.Password }; estabilished = true; } else { estabilished = false; } client.Close(); return(estabilished); }