Ejemplo n.º 1
0
        public void Handle(ProjectionManagementMessage.Command.GetQuery message)
        {
            _lastAccessed = _timeProvider.Now;
            if (!ProjectionManagementMessage.RunAs.ValidateRunAs(Mode, ReadWrite.Read, _runAs, message))
            {
                return;
            }

            var emitEnabled = _persistedState.EmitEnabled ?? false;

            var projectionOutputConfig = new ProjectionOutputConfig
            {
                ResultStreamName =
                    _persistedState.SourceDefinition == null
                        ? ""
                        : new ProjectionNamesBuilder(_name, _persistedState.SourceDefinition).GetResultStreamName()
            };

            message.Envelope.ReplyWith(
                new ProjectionManagementMessage.ProjectionQuery(
                    _name,
                    Query,
                    emitEnabled,
                    _persistedState.SourceDefinition,
                    projectionOutputConfig));
        }
        public void Handle(ProjectionManagementMessage.Command.GetQuery message)
        {
            var command = new GetQueryCommand {
                Name  = message.Name,
                RunAs = message.RunAs,
            };

            _writer.PublishCommand("$get-query", command);
        }
Ejemplo n.º 3
0
        public void Handle(ProjectionManagementMessage.Command.GetQuery message)
        {
            if (!_started)
            {
                return;
            }
            var projection = GetProjection(message.Name);

            if (projection == null)
            {
                message.Envelope.ReplyWith(new ProjectionManagementMessage.NotFound());
            }
            else
            {
                projection.Handle(message);
            }
        }
Ejemplo n.º 4
0
        public void Handle(ProjectionManagementMessage.Command.GetQuery message)
        {
            if (!_started)
            {
                return;
            }
            var projection = GetProjection(message.Name);

            if (projection == null)
            {
                message.Envelope.ReplyWith(new ProjectionManagementMessage.NotFound());
            }
            else
            {
                if (!ProjectionManagementMessage.RunAs.ValidateRunAs(projection.GetMode(), ReadWrite.Read, projection.RunAs, message))
                {
                    return;
                }
                projection.Handle(message);
            }
        }
        public void Handle(ProjectionManagementMessage.Command.GetQuery message)
        {
            _lastAccessed = _timeProvider.Now;

            var emitEnabled = PersistedProjectionState.EmitEnabled ?? false;

            var projectionOutputConfig = new ProjectionOutputConfig
            {
                ResultStreamName =
                    PersistedProjectionState.SourceDefinition == null
                        ? ""
                        : new ProjectionNamesBuilder(_name, PersistedProjectionState.SourceDefinition).GetResultStreamName()
            };

            message.Envelope.ReplyWith(
                new ProjectionManagementMessage.ProjectionQuery(
                    _name,
                    Query,
                    emitEnabled,
                    PersistedProjectionState.SourceDefinition,
                    projectionOutputConfig));
        }