Table of Contents

Class MyServerInvoker

Namespace
Geotab.Checkmate.Web
Assembly
Geotab.Checkmate.ObjectModel.dll

A web DataStore used for JavaScript clients communicating through to a DataStore.

public class MyServerInvoker : WebServerInvoker, IWebServerInvoker
Inheritance
MyServerInvoker
Implements
Derived
Inherited Members

Remarks

The maximum number of concurrent connections per server is 64, provided by the default HttpMessageHandler. It can be increased/decreased by providing a custom instance of HttpMessageHandler.

Constructors

MyServerInvoker(string, int?, string?, HttpMessageHandler?, ApiClientConfiguration?)

Initializes a new instance of the MyServerInvoker class.

public MyServerInvoker(string url, int? timeout = null, string? servicePath = null, HttpMessageHandler? handler = null, ApiClientConfiguration? apiClientConfiguration = null)

Parameters

url string

The URL.

timeout int?

The request timeout in milliseconds. (Default 300000 and this is the maximum).

servicePath string

Path to web service. [Default "apiv1"].

handler HttpMessageHandler

The HttpMessageHandler for overriding of the default shared httpClient (max connection pool size 64).

apiClientConfiguration ApiClientConfiguration

The ApiClientConfiguration provided by the API client for custom configurations.

Methods

CheckForError(string, Exception?, JsonRpcErrorCode?, JsonRpcErrorData?)

Check JSON error.

protected override Exception? CheckForError(string message, Exception? innerException, JsonRpcErrorCode? errorCode, JsonRpcErrorData? errorData)

Parameters

message string

The error message.

innerException Exception

The inner exception.

errorCode JsonRpcErrorCode?

The JsonRpcErrorCode for JSON-RPC error type that occurred.

errorData JsonRpcErrorData

Primitive or Structured value that contains additional information about the error.

Returns

Exception

The Exception object.

OnDerivableErrorCode(string, Exception?, JsonRpcErrorCode?, JsonRpcErrorData)

Let other derived invokers handle their own exception types.

protected virtual Exception? OnDerivableErrorCode(string message, Exception? innerException, JsonRpcErrorCode? errorCode, JsonRpcErrorData errorData)

Parameters

message string

The exception message.

innerException Exception

The inner exception.

errorCode JsonRpcErrorCode?

The error code.

errorData JsonRpcErrorData

The error data.

Returns

Exception

The delineated exception, or base implementation.

Remarks

This could further be broken down into the derived invoker classes. Kept the core logic here.

ToJson(object)

Convert object to JSON string.

protected override string ToJson(object obj)

Parameters

obj object

The object to be converted.

Returns

string

The JSON string result.

ToJsonContent(object)

Gets JsonContent wrapped serialization target.

protected override JsonContent ToJsonContent(object serializationTarget)

Parameters

serializationTarget object

The object for seralization.

Returns

JsonContent

A JsonContent.