Example #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); });
 }
Example #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);
            }
        }
Example #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); });
 }