Esempio n. 1
0
 /// <summary>
 ///     Sends broad cast the specified message bus.
 /// </summary>
 /// <param name="messageControl">The message control.</param>
 public void Send(IControlMessage messageControl)
 {
     foreach (Subscriptor subscriptor in _subscriptorsRepository.GetAll())
     {
         subscriptor.ServiceInputControlGateway.Send(messageControl);
     }
 }
Esempio n. 2
0
 public static void SignControlMessage(this ECDsa key, IControlMessage message)
 {
     message.Signature = new()
     {
         Key  = ByteString.CopyFrom(key.PublicKey()),
         Sign = ByteString.CopyFrom(key.SignData(message.SignData.ToByteArray())),
     };
 }
Esempio n. 3
0
        /// <summary>
        ///     Sends the specified identification.
        /// </summary>
        /// <param name="identification">The identification.</param>
        /// <param name="messageControl">The message control.</param>
        public void Send(Identification identification, IControlMessage messageControl)
        {
            Subscriptor subscriptor = _subscriptorsRepository.Get(identification);

            if (subscriptor != null)
            {
                subscriptor.ServiceInputControlGateway.Send(messageControl);
            }
        }
Esempio n. 4
0
 public void SendControlCommand(IControlMessage msg)
 {
     if (controlClient == null)
     {
         log.Warning("SendControlCommand() called, but controlClient is null.");
     }
     else
     {
         controlChannel.Writer.TryWrite(msg);
     }
 }
Esempio n. 5
0
 /// <summary>
 ///     Publishes the specified identification.
 /// </summary>
 /// <param name="identification">The identification.</param>
 /// <param name="message">The message.</param>
 public void Publish(Identification identification, IControlMessage message)
 {
     _subscriptonsHelper.Send(identification, message);
 }
Esempio n. 6
0
 /// <summary>
 ///     Sends broad cast the specified message bus.
 /// </summary>
 /// <param name="messageControl">The message control.</param>
 public void Send(IControlMessage messageControl)
 {
     foreach (Subscriptor subscriptor in _subscriptorsRepository.GetAll())
     {
         subscriptor.ServiceInputControlGateway.Send(messageControl);
     }
 }
Esempio n. 7
0
 /// <summary>
 ///     Sends the specified identification.
 /// </summary>
 /// <param name="identification">The identification.</param>
 /// <param name="messageControl">The message control.</param>
 public void Send(Identification identification, IControlMessage messageControl)
 {
     Subscriptor subscriptor = _subscriptorsRepository.Get(identification);
     if (subscriptor != null)
     {
         subscriptor.ServiceInputControlGateway.Send(messageControl);
     }
 }
Esempio n. 8
0
 /// <summary>
 ///     Publishes the specified identification.
 /// </summary>
 /// <param name="identification">The identification.</param>
 /// <param name="message">The message.</param>
 public void Publish(Identification identification, IControlMessage message)
 {
     _subscriptonsHelper.Send(identification, message);
 }
Esempio n. 9
0
 public static bool VerifyControlMessage(this IControlMessage message)
 {
     using var key = message.Signature.Key.ToByteArray().LoadPublicKey();
     return(key.VerifyData(message.SignData.ToByteArray(), message.Signature.Sign.ToByteArray()));
 }