Ejemplo n.º 1
0
 private void HandleInvokeCapability(byte[] requester, Guid requesterIdentity, CapabilityInfo info,
                                     string requestContentJson)
 {
     _registry.Get(info.Name)
     .Just(capability => { InvokeCapability(requester, requesterIdentity, capability, requestContentJson); })
     .Nothing(() => { ErrorMessageSender.SendError(requester, _router, ErrorCode.RequestDenied); });
 }
Ejemplo n.º 2
0
        private void InvokeCapability(byte[] destination, Guid requesterIdentity, ICapability capability,
                                      string arguments)
        {
            try
            {
                var encryptor = _negotiator.GetEncryptorFor(requesterIdentity);
                var response  = ResponseCreator.Create(encryptor, destination, MessageType.CapabilityInvocationResult,
                                                       capability.Invoke(arguments));

                _router.SendMultipartMessage(response);
            }
            catch (Exception)
            {
                ErrorMessageSender.SendError(destination, _router, ErrorCode.InvocationError);
            }
        }
Ejemplo n.º 3
0
 private void HandleGetCapability(byte[] requester, Guid requesterIdentity, CapabilityInfo info)
 {
     _registry.Get(info.Name)
     .Just(capability => { GrantCapability(requesterIdentity, requester, info); })
     .Nothing(() => { ErrorMessageSender.SendError(requester, _router, ErrorCode.RequestDenied); });
 }