Exemplo n.º 1
0
 private ManagedInstance GetDefaultInstance(ManagedInstanceDirective directive = null)
 {
     return new ManagedInstance(directive ?? GetDefaultDirective())
     {
         ApiKey = GetDefaultApiKey(),
         UseHttps = Settings.Default.ServerUseHttps,
         PossibleEndpoints = GetDefaultRestEndpointCollection()
     };
 }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
        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();
        }
Exemplo n.º 5
0
        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();
        }
Exemplo n.º 6
0
 public ManagedInstance(ManagedInstanceDirective directive)
 {
     Initialize(directive);
 }
Exemplo n.º 7
0
 public ManagedInstance(ManagedInstanceDirective directive)
 {
     Initialize(directive);
 }
Exemplo n.º 8
0
 public void TestInstantiationWithConfig()
 {
     var config = new ManagedInstanceDirective {DoAutomaticUpdates = false};
     new ManagedInstance(config);
 }