Exemplo n.º 1
0
 public override void Register(IWampCallee callee, long requestId, RegisterOptions options, string procedure)
 {
     InnerAction(callee,
                 authorizer => authorizer.CanRegister(options, procedure),
                 () => base.Register(callee, requestId, options, procedure),
                 exception => callee.RegisterError(requestId, exception));
 }
 public WampCalleeRpcOperation(string procedure,
                               IWampCallee callee,
                               RegisterOptions options,
                               IWampCalleeInvocationHandler <TMessage> handler,
                               WampCalleeOperationCatalog <TMessage> catalog) :
     base(callee, procedure, options)
 {
     mHandler = handler;
     mCatalog = catalog;
 }
        public void Unregister(IWampCallee callee, long registrationId)
        {
            RemoteWampCalleeDetails operation =
                new RemoteWampCalleeDetails(callee, registrationId);


            if (!mOperationToDisposable.TryRemove(operation, out IDisposable disposable))
            {
                throw new WampException(WampErrors.NoSuchRegistration, "registrationId: " + registrationId);
            }

            disposable.Dispose();

            mInvocationHandler.Unregistered(operation);
        }
Exemplo n.º 4
0
        private void ResultArrived(IWampCallee callee, long requestId, YieldOptions options, Action <WampRpcInvocation> action)
        {
            WampRpcInvocation invocation = GetInvocation(requestId, options);

            if (invocation != null)
            {
                if (invocation.Operation.Callee == callee)
                {
                    action(invocation);
                }
                else
                {
                    callee.InvocationError(requestId, mEmptyDetails, WampErrors.NotAuthorized);
                }
            }
        }
Exemplo n.º 5
0
        public void Cancel(IWampCaller caller, long requestId, CancelOptions options)
        {
            WampRpcOperationCallback callback = new WampRpcOperationCallback(caller, requestId);

            lock (mLock)
            {
                if (mCallbackToInvocation.TryGetValue(callback, out WampRpcInvocation invocation))
                {
                    IWampCallee callee = invocation.Operation.Callee;

                    callee.Interrupt(invocation.InvocationId, new InterruptDetails()
                    {
                        Mode = options.Mode
                    });
                }
            }
        }
Exemplo n.º 6
0
        public void Unregister(IWampCallee callee, long requestId, long registrationId)
        {
            try
            {
                mCalleeCatalog.Unregister(callee, registrationId);
                callee.Unregistered(requestId);
            }
            catch (WampException exception)
            {
                mLogger.ErrorFormat(exception,
                                    "Failed unregistering procedure with registration id {RegistrationId}. Unregistration request id: {RequestId} ",
                                    registrationId,
                                    requestId);

                callee.UnregisterError(requestId, exception);
            }
        }
Exemplo n.º 7
0
        public void Register(IWampCallee callee, long requestId, RegisterOptions options, string procedure)
        {
            try
            {
                options = options.WithDefaults();
                ValidateRegisterUri(procedure, options.Match);

                RegisterRequest registerRequest = new RegisterRequest(callee, requestId);
                mCalleeCatalog.Register(registerRequest, options, procedure);
            }
            catch (WampException exception)
            {
                mLogger.ErrorFormat(exception,
                                    "Failed registering procedure '{ProcedureUri}'. Registration request id: {RequestId} ",
                                    procedure, requestId);

                callee.RegisterError(requestId, exception);
            }
        }
Exemplo n.º 8
0
        public void Register(IWampCallee callee, long requestId, RegisterOptions options, string procedure)
        {
            try
            {
                options.Invoke = options.Invoke ?? WampInvokePolicy.Default;
                options.Match  = options.Match ?? WampMatchPattern.Default;

                ValidateRegisterUri(procedure, options.Match);

                RegisterRequest registerRequest = new RegisterRequest(callee, requestId);
                mCalleeCatalog.Register(registerRequest, options, procedure);
            }
            catch (WampException exception)
            {
                mLogger.ErrorFormat(exception,
                                    "Failed registering procedure '{0}'. Registration request id: {1} ",
                                    procedure, requestId);

                callee.RegisterError(requestId, exception);
            }
        }
Exemplo n.º 9
0
 public void Yield(IWampCallee callee, long requestId, YieldOptions options, TMessage[] arguments, IDictionary <string, TMessage> argumentsKeywords)
 {
     mHandler.Yield(callee, requestId, options, arguments, argumentsKeywords);
 }
Exemplo n.º 10
0
 public void Yield(IWampCallee callee, long requestId, YieldOptions options)
 {
     mHandler.Yield(callee, requestId, options);
 }
Exemplo n.º 11
0
 public void Yield(IWampCallee callee, long requestId, YieldOptions options, TMessage[] arguments)
 {
     throw new System.NotImplementedException();
 }
Exemplo n.º 12
0
 public void Register(IWampCallee callee, long requestId, RegisterOptions options, string procedure)
 {
     throw new System.NotImplementedException();
 }
Exemplo n.º 13
0
 public void Yield(IWampCallee callee, long requestId, YieldOptions options, TMessage[] arguments)
 {
     ActualYield = new object[] { requestId, options, arguments };
 }
Exemplo n.º 14
0
 public void Yield(IWampCallee callee, long requestId, YieldOptions options)
 {
     ActualYield = new object[] { requestId, options };
 }
Exemplo n.º 15
0
 protected RemoteWampCalleeDetails(IWampCallee callee, string procedure, RegisterOptions options)
 {
     Callee    = callee;
     Procedure = procedure;
     mOptions  = options;
 }
Exemplo n.º 16
0
 public RemoteWampCalleeDetails(IWampCallee callee, long registrationId)
 {
     Callee         = callee;
     RegistrationId = registrationId;
 }
Exemplo n.º 17
0
 public virtual void Yield(IWampCallee callee, long requestId, YieldOptions options)
 {
     mDealer.Yield(callee, requestId, options);
 }
Exemplo n.º 18
0
 public void Yield(IWampCallee callee, long requestId, YieldOptions options)
 {
     ResultArrived(callee, requestId, options,
                   invocation =>
                   invocation.Callback.Result(mFormatter, options));
 }
Exemplo n.º 19
0
 public void Yield(IWampCallee callee, long requestId, YieldOptions options, TMessage[] arguments, IDictionary <string, TMessage> argumentsKeywords)
 {
     ResultArrived(callee, requestId, options,
                   invocation =>
                   invocation.Callback.Result(mFormatter, options, arguments, argumentsKeywords));
 }
Exemplo n.º 20
0
 public void Yield(IWampCallee callee, long requestId, YieldOptions options, TMessage[] arguments, IDictionary <string, TMessage> argumentsKeywords)
 {
     ActualYield = new object[] { requestId, options, arguments, argumentsKeywords };
 }
Exemplo n.º 21
0
 public void Error(IWampCallee wampCallee, long requestId, TMessage details, string error)
 {
     ErrorArrived(requestId,
                  invocation => invocation.Callback.Error(mFormatter, details, error));
 }
Exemplo n.º 22
0
 public void Register(IWampCallee callee, long requestId, RegisterOptions options, string procedure)
 {
     ActualRegistration = new object[] { options, procedure };
     mRegisterCallback(callee, requestId);
 }
Exemplo n.º 23
0
 public void Unregister(IWampCallee callee, long requestId, long registrationId)
 {
     throw new System.NotImplementedException();
 }
Exemplo n.º 24
0
 public void Unregister(IWampCallee callee, long requestId, long registrationId)
 {
     ActualUnregistration = new object[] { registrationId };
     mUnregisterCallback(callee, requestId);
 }
Exemplo n.º 25
0
 public void Yield(IWampCallee callee, long requestId, YieldOptions options, TMessage[] arguments, IDictionary <string, TMessage> argumentsKeywords)
 {
     throw new System.NotImplementedException();
 }
Exemplo n.º 26
0
 public RegisterRequest(IWampCallee callee, long requestId)
 {
     mCallee    = callee;
     mRequestId = requestId;
 }
Exemplo n.º 27
0
 public void Yield(IWampCallee callee, long requestId, YieldOptions options, TMessage[] arguments)
 {
     mHandler.Yield(callee, requestId, options, arguments);
 }
Exemplo n.º 28
0
 public virtual void Unregister(IWampCallee callee, long requestId, long registrationId)
 {
     mDealer.Unregister(callee, requestId, registrationId);
 }
 public void Yield(IWampCallee callee, long requestId, YieldOptions options)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 30
0
 public WampCalleeRpcInvocation(IWampCallee callee, long requestId)
 {
     Callee    = callee;
     RequestId = requestId;
 }