private ManagedInstance GetDefaultInstance(ManagedInstanceDirective directive = null) { return new ManagedInstance(directive ?? GetDefaultDirective()) { ApiKey = GetDefaultApiKey(), UseHttps = Settings.Default.ServerUseHttps, PossibleEndpoints = GetDefaultRestEndpointCollection() }; }
private ManagedInstanceDirective GetClearDirective() { var directive = new ManagedInstanceDirective(); var time = TimeSpan.FromHours(1); directive.HeartbeatDirective = new WorkerDirective(false, time, time); directive.ReportStatusDirective = new WorkerDirective(false, time, time); directive.SystemStatusDirective = new WorkerDirective(false, time, time); directive.VersionUpgradeDirective = new WorkerDirective(false, time, time); return directive; }
private ManagedInstanceDirective GetDefaultDirective() { var directive = new ManagedInstanceDirective(); var wait = TimeSpan.FromMilliseconds(600); var timeout = TimeSpan.FromSeconds(1); directive.HeartbeatDirective = new WorkerDirective(true, wait, timeout); directive.ReportStatusDirective = new WorkerDirective(true, wait, timeout); directive.SystemStatusDirective = new WorkerDirective(true, wait, timeout); directive.VersionUpgradeDirective = new WorkerDirective(true, wait, timeout); return directive; }
private void Initialize(ManagedInstanceDirective directive = null) { Directives = directive ?? new ManagedInstanceDirective(); Log.Logger.Debug("Instance initialized with {@directive}", Directives); Information = new Information(this); Statistics = new Statistic(this); Synchronization = new Synchronization(this); Announcers = new AnnouncerCollection(); Folders = new FoldersCollection(); Errors = new ErrorCollection(); PossibleEndpoints = new RestEndpointCollection(); Id = Guid.NewGuid(); ConfigureThreads(); ConfigureStateMachine(); }
private void Initialize(ManagedInstanceDirective directive = null) { Directives = directive ?? new ManagedInstanceDirective(); Log.Logger.Debug("Instance initialized with {@directive}", Directives); Information = new Information(this); Statistics = new Statistic(this); Synchronization = new Synchronization(this); Announcers = new AnnouncerCollection(); Folders = new FoldersCollection(); Errors = new ErrorCollection(); PossibleEndpoints = new RestEndpointCollection(); Id = Guid.NewGuid(); ConfigureThreads(); ConfigureStateMachine(); }
public ManagedInstance(ManagedInstanceDirective directive) { Initialize(directive); }
public ManagedInstance(ManagedInstanceDirective directive) { Initialize(directive); }
public void TestInstantiationWithConfig() { var config = new ManagedInstanceDirective {DoAutomaticUpdates = false}; new ManagedInstance(config); }