C# Class EdjCase.JsonRpc.Router.Defaults.DefaultRpcInvoker

Default Rpc method invoker that uses asynchronous processing
Inheritance: IRpcInvoker
Show file Open project: edjCase/JsonRpc Class Usage Examples

Private Properties

Property Type Description
GetMatchingMethod RpcMethod
GetRpcMethods List
GetUnknownExceptionReponse RpcResponse
IsAuthorizedAsync Task

Public Methods

Method Description
DefaultRpcInvoker ( IAuthorizationService authorizationService, IAuthorizationPolicyProvider policyProvider, ILogger logger, IOptions serverConfig ) : System
InvokeBatchRequestAsync ( List requests, RpcRoute route, HttpContext httpContext, JsonSerializerSettings jsonSerializerSettings = null ) : Task>

Call the incoming Rpc requests methods and gives the appropriate respones

InvokeRequestAsync ( RpcRequest request, RpcRoute route, HttpContext httpContext, JsonSerializerSettings jsonSerializerSettings = null ) : Task

Call the incoming Rpc request method and gives the appropriate response

Private Methods

Method Description
GetMatchingMethod ( RpcRoute route, RpcRequest request, object &parameterList, IServiceProvider serviceProvider = null, JsonSerializerSettings jsonSerializerSettings = null ) : RpcMethod

Finds the matching Rpc method for the current request

GetRpcMethods ( RpcRoute route, IServiceProvider serviceProvider = null, JsonSerializerSettings jsonSerializerSettings = null ) : List

Gets all the predefined Rpc methods for a Rpc route

GetUnknownExceptionReponse ( RpcRequest request, Exception ex ) : RpcResponse

Converts an unknown caught exception into a Rpc response

IsAuthorizedAsync ( RpcMethod rpcMethod, HttpContext httpContext ) : Task

Method Details

DefaultRpcInvoker() public method

public DefaultRpcInvoker ( IAuthorizationService authorizationService, IAuthorizationPolicyProvider policyProvider, ILogger logger, IOptions serverConfig ) : System
authorizationService IAuthorizationService Service that authorizes each method for use if configured
policyProvider IAuthorizationPolicyProvider Provides authorization policies for the authroziation service
logger ILogger Optional logger for logging Rpc invocation
serverConfig IOptions Configuration data for the server
return System

InvokeBatchRequestAsync() public method

Call the incoming Rpc requests methods and gives the appropriate respones
public InvokeBatchRequestAsync ( List requests, RpcRoute route, HttpContext httpContext, JsonSerializerSettings jsonSerializerSettings = null ) : Task>
requests List List of Rpc requests
route RpcRoute Rpc route that applies to the current request
httpContext HttpContext The context of the current http request
jsonSerializerSettings Newtonsoft.Json.JsonSerializerSettings Json serialization settings that will be used in serialization and deserialization for rpc requests
return Task>

InvokeRequestAsync() public method

Call the incoming Rpc request method and gives the appropriate response
public InvokeRequestAsync ( RpcRequest request, RpcRoute route, HttpContext httpContext, JsonSerializerSettings jsonSerializerSettings = null ) : Task
request EdjCase.JsonRpc.Core.RpcRequest Rpc request
route RpcRoute Rpc route that applies to the current request
httpContext HttpContext The context of the current http request
jsonSerializerSettings Newtonsoft.Json.JsonSerializerSettings Json serialization settings that will be used in serialization and deserialization for rpc requests
return Task