public static SerializePrincipal ( ProjectionManagementMessage runAs ) : |
||
runAs | ProjectionManagementMessage | |
return |
public void CreateAndInitializeNewProjection( ProjectionManager projectionManager, Guid projectionCorrelationId, Guid workerId, bool isSlave = false, Guid slaveMasterWorkerId = default(Guid), Guid slaveMasterCorrelationId = default(Guid), int?version = -1) { var projection = projectionManager.CreateManagedProjectionInstance( _name, _projectionId, projectionCorrelationId, workerId, isSlave, slaveMasterWorkerId, slaveMasterCorrelationId); projection.InitializeNew( new ManagedProjection.PersistedState { Enabled = _enabled, HandlerType = _handlerType, Query = _query, Mode = _projectionMode, EmitEnabled = _emitEnabled, CheckpointsDisabled = !_checkpointsEnabled, Epoch = -1, Version = version, RunAs = _enableRunAs ? SerializedRunAs.SerializePrincipal(_runAs) : null }, _replyEnvelope); }
private void FixUpOldProjectionRunAs(PersistedState persistedState) { if (persistedState.RunAs == null || string.IsNullOrEmpty(persistedState.RunAs.Name)) { _runAs = SystemAccount.Principal; persistedState.RunAs = SerializedRunAs.SerializePrincipal(ProjectionManagementMessage.RunAs.System); } }
private void DoSetRunAs1(ProjectionManagementMessage.Command.SetRunAs message) { _persistedState.RunAs = message.Action == ProjectionManagementMessage.Command.SetRunAs.SetRemove.Set ? SerializedRunAs.SerializePrincipal(message.RunAs) : null; _runAs = SerializedRunAs.DeserializePrincipal(_persistedState.RunAs); _pendingPersistedState = true; }