private void Handle(SystemMessage.BecomeMaster msg)
 {
     lock (_lock){
         _roleAssignments.Add("master");
     }
     _expectedNumberOfEvents?.Signal();
 }
 public void Handle(SystemMessage.BecomeMaster message)
 {
     _numberOfStandardUsersToBeCreated = 2;
     if (!_skipInitializeStandardUsersCheck)
     {
         BeginReadUserDetails(
             "admin", completed =>
         {
             if (completed.Result == ReadStreamResult.NoStream)
             {
                 CreateAdminUser();
             }
             else
             {
                 NotifyInitialized();
             }
         });
         BeginReadUserDetails(
             "ops", completed =>
         {
             if (completed.Result == ReadStreamResult.NoStream)
             {
                 CreateOperationsUser();
             }
             else
             {
                 NotifyInitialized();
             }
         });
     }
     else
     {
         _publisher.Publish(new UserManagementMessage.UserManagementServiceInitialized());
     }
 }
示例#3
0
 public void Handle(SystemMessage.BecomeMaster message)
 {
     if (!_skipInitializeStandardUsersCheck)
     {
         BeginReadUserDetails(
             "admin", completed =>
         {
             if (completed.Result == ReadStreamResult.NoStream)
             {
                 CreateAdminUser();
             }
             else
             {
                 NotifyInitialized();
             }
         });
         BeginReadUserDetails(
             "ops", completed =>
         {
             if (completed.Result == ReadStreamResult.NoStream)
             {
                 CreateOperationsUser();
             }
             else
             {
                 NotifyInitialized();
             }
         });
     }
     else
     {
         NotifyInitialized();
     }
 }
 public void Handle(SystemMessage.BecomeMaster message)
 {
     Log.Debug("Persistent subscriptions Became Master so now handling subscriptions");
     InitToEmpty();
     _handleTick = true;
     _bus.Publish(_tickRequestMessage);
     LoadConfiguration(Start);
 }
        private void Handle(SystemMessage.BecomeMaster message)
        {
            if (_state == VNodeState.Master)
            {
                throw new Exception("We should not BecomeMaster twice in a row.");
            }
            if (_master == null)
            {
                throw new Exception("_master == null");
            }
            if (_stateCorrelationId != message.CorrelationId)
            {
                return;
            }

            Log.Info("========== [{0}] IS MASTER... SPARTA!", _nodeInfo.InternalHttp);
            _state = VNodeState.Master;
            _outputBus.Publish(message);
        }
示例#6
0
 private void Handle(SystemMessage.BecomeMaster message)
 {
     Log.Info("========== [{0}] IS WORKING!!! SPARTA!!!", _httpEndPoint);
     _state = VNodeState.Master;
     _outputBus.Publish(message);
 }