Ejemplo n.º 1
0
        public void Handle(ProjectionManagementMessage.Command.UpdateQuery message)
        {
            if (!_started)
            {
                return;
            }
            _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
            {
                if (!ProjectionManagementMessage.RunAs.ValidateRunAs(projection.GetMode(), ReadWrite.Write, projection.RunAs, message))
                {
                    return;
                }
                projection.Handle(message); // update query text
            }
        }
        public void Handle(ProjectionManagementMessage.Command.UpdateQuery message)
        {
            _lastAccessed = _timeProvider.Now;

            Prepared = false;
            UpdateQuery(message);
            UpdateProjectionVersion();
            SetLastReplyEnvelope(message.Envelope);
            StopUnlessPreparedOrLoaded();
        }
Ejemplo n.º 3
0
 private void DoUpdateQuery1(ProjectionManagementMessage.Command.UpdateQuery message)
 {
     _persistedState.HandlerType = message.HandlerType ?? HandlerType;
     _persistedState.Query       = message.Query;
     _persistedState.EmitEnabled = message.EmitEnabled ?? _persistedState.EmitEnabled;
     _pendingPersistedState      = true;
     if (_state == ManagedProjectionState.Completed)
     {
         ResetProjection();
     }
 }
 private void UpdateQuery(ProjectionManagementMessage.Command.UpdateQuery message)
 {
     PersistedProjectionState.HandlerType = message.HandlerType ?? HandlerType;
     PersistedProjectionState.Query       = message.Query;
     PersistedProjectionState.EmitEnabled = message.EmitEnabled ?? PersistedProjectionState.EmitEnabled;
     _pendingWritePersistedState          = true;
     if (_state == ManagedProjectionState.Completed)
     {
         Reset();
     }
 }
        public void Handle(ProjectionManagementMessage.Command.UpdateQuery message)
        {
            var command = new UpdateQueryCommand {
                Name        = message.Name,
                RunAs       = message.RunAs,
                EmitEnabled = message.EmitEnabled,
                HandlerType = message.HandlerType,
                Query       = message.Query,
            };

            _writer.PublishCommand("$update-query", command);
        }
Ejemplo n.º 6
0
        public void Handle(ProjectionManagementMessage.Command.UpdateQuery message)
        {
            _lastAccessed = _timeProvider.Now;
            if (!ProjectionManagementMessage.RunAs.ValidateRunAs(Mode, ReadWrite.Write, _runAs, message))
            {
                return;
            }

            _prepared = false;
            DoUpdateQuery1(message);
            UpdateProjectionVersion();
            SetLastReplyEnvelope(message.Envelope);
            StopUnlessPreparedOrLoaded();
        }