public StoreRecord(string key, object[] items, long storeVersion, long streamVersion,MessageAttribute[] attributes) { Items = items; StoreVersion = storeVersion; StreamVersion = streamVersion; Key = key; Attributes = attributes; }
string GenerateSha1HashFromContent(object message, MessageAttribute[] attributes) { // we need to set ID and date to fixed var envelope = new ImmutableEnvelope("", default(DateTime), message, attributes); var data = _streamer.SaveEnvelopeData(envelope); using (var sha1 = new SHA1Managed()) { var hash = sha1.ComputeHash(data); return BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant(); } }
public ImmutableEnvelope(string envelopeId, DateTime createdUtc, object message, MessageAttribute[] attributes) { EnvelopeId = envelopeId; Message = message; CreatedUtc = createdUtc; if (null == attributes) { Attributes = MessageAttribute.Empty; } else { // just ensuring that we have an immutable copy var copy = new MessageAttribute[attributes.Length]; Array.Copy(attributes, copy, attributes.Length); Attributes = copy; } }
public void PublishFromClientHashed(IFuncEvent e, MessageAttribute[] attributes) { _functionalRecorder.SendHashed(e, attributes); }
public void SendFromClient(ICommand e, string id, MessageAttribute[] attributes) { _commandRouter.Send(e, id, attributes); }