예제 #1
0
        public void Handle(ProjectionManagementMessage.UpdateQuery message)
        {
            _lastAccessed = _timeProvider.Now;
            if (!ProjectionManagementMessage.RunAs.ValidateRunAs(Mode, ReadWrite.Write, _runAs, message))
            {
                return;
            }

            Stop(() => DoUpdateQuery(message));
        }
예제 #2
0
 private void DoUpdateQuery(ProjectionManagementMessage.UpdateQuery message)
 {
     UpdateQuery(message.HandlerType ?? HandlerType, message.Query);
     BeginWrite(
         () =>
     {
         StartIfEnabled();
         message.Envelope.ReplyWith(new ProjectionManagementMessage.Updated(message.Name));
     });
 }
예제 #3
0
        private void DoUpdateQuery(ProjectionManagementMessage.UpdateQuery message)
        {
            UpdateQuery(message.HandlerType ?? HandlerType, message.Query, message.EmitEnabled);
            Action completed = () =>
            {
                StartOrLoadStopped(() => { });
                message.Envelope.ReplyWith(new ProjectionManagementMessage.Updated(message.Name));
            };

            UpdateProjectionVersion();
            Prepare(() => BeginWrite(completed));
        }
예제 #4
0
 private void DoUpdateQuery(ProjectionManagementMessage.UpdateQuery message)
 {
     UpdateQuery(message.HandlerType ?? HandlerType, message.Query);
     PrepareAndBeginWrite(
         forcePrepare: true, completed: () =>
     {
         if (Enabled)
         {
             Start(() => { });
         }
         message.Envelope.ReplyWith(new ProjectionManagementMessage.Updated(message.Name));
     });
 }
예제 #5
0
        public void Handle(ProjectionManagementMessage.UpdateQuery message)
        {
            _logger.Info(
                "Updating '{0}' projection source to '{1}' (Requested type is: '{2}')", message.Name, message.Query,
                message.HandlerType);
            var projection = GetProjection(message.Name);

            if (projection == null)
            {
                message.Envelope.ReplyWith(new ProjectionManagementMessage.NotFound());
            }
            else
            {
                projection.Handle(message); // update query text
            }
        }
예제 #6
0
        private void DoUpdateQuery(ProjectionManagementMessage.UpdateQuery message)
        {
            _persistedState.HandlerType = message.HandlerType ?? HandlerType;
            _persistedState.Query       = message.Query;
            _persistedState.EmitEnabled = message.EmitEnabled ?? _persistedState.EmitEnabled;
            if (_state == ManagedProjectionState.Completed)
            {
                ResetProjection();
            }
            Action completed = () =>
            {
                StartOrLoadStopped(() => { });
                message.Envelope.ReplyWith(new ProjectionManagementMessage.Updated(message.Name));
            };

            UpdateProjectionVersion();
            Prepare(() => BeginWrite(completed));
        }
예제 #7
0
 public void Handle(ProjectionManagementMessage.UpdateQuery message)
 {
     Stop(() => DoUpdateQuery(message));
 }