Class: HttpEndpoint

HttpEndpoint(httpClientnon-null, responseHandlernon-null, routing)

Spine HTTP endpoint which is used to send Commands and Queries using the provided HTTP client.

Constructor

new HttpEndpoint(httpClientnon-null, responseHandlernon-null, routing)

Parameters:
Name Type Description
httpClient HttpClient a client sending requests to server
responseHandler HttpResponseHandler a handle for the HTTP responses from server
routing Routing endpoint routing parameters
Source:

Classes

HttpEndpoint

Methods

(protected) _cancel(subscriptionnon-null) → {Promise.<(Object|SpineError)>}

Sends a request to cancel the given subscription.
Parameters:
Name Type Description
subscription TypedMessage.<spine.client.Subscription> a subscription to be canceled
Source:
Returns:
a promise of a successful server response JSON data, rejected if the client response is not `2xx`, or a connection error occurs
Type
Promise.<(Object|SpineError)>

(protected) _cancelAll(subscriptionsnon-null) → {Promise.<(Object|SpineError)>}

Sends a request to cancel the given subscriptions.
Parameters:
Name Type Description
subscriptions Array.<spine.client.Subscription> subscriptions to be canceled
Source:
Returns:
a promise of a successful server response JSON data, rejected if the client response is not `2xx`, or a connection error occurs
Type
Promise.<(Object|SpineError)>

(protected) _executeCommand(commandnon-null) → {Promise.<(Object|SpineError)>}

Sends a command to the endpoint.
Parameters:
Name Type Description
command TypedMessage.<Command> a Command to send to the Spine server
Source:
Returns:
a promise of a successful server response JSON data, rejected if the client response is not `2xx`, or a connection error occurs
Type
Promise.<(Object|SpineError)>

(protected) _keepUp(subscriptionnon-null) → {Promise.<(Object|SpineError)>}

Sends a request to keep alive the given subscription.
Parameters:
Name Type Description
subscription TypedMessage.<spine.client.Subscription> a subscription that is prevented from being closed by server
Source:
Returns:
a promise of a successful server response JSON data, rejected if the client response is not `2xx`, or a connection error occurs
Type
Promise.<(Object|SpineError)>

(protected) _keepUpAll(subscriptionsnon-null) → {Promise.<(Object|SpineError)>}

Sends a request to keep alive the given subscriptions.
Parameters:
Name Type Description
subscriptions Array.<spine.client.Subscription> subscriptions that are prevented from being closed by the server
Source:
Returns:
a promise of a successful server response JSON data, rejected if the client response is not `2xx`, or a connection error occurs
Type
Promise.<(Object|SpineError)>

(protected) _performQuery(querynon-null) → {Promise.<(Object|SpineError)>}

Sends a query to the endpoint.
Parameters:
Name Type Description
query TypedMessage.<Query> a Query to Spine server to retrieve some domain entities
Source:
Returns:
a promise of a successful server response JSON data, rejected if the client response is not `2xx`, or a connection error occurs
Type
Promise.<(Object|SpineError)>

(protected) _subscribeTo(topicnon-null) → {Promise.<(Object|SpineError)>}

Sends a request to create a subscription for a topic.
Parameters:
Name Type Description
topic TypedMessage.<spine.client.Topic> a topic to subscribe to
Source:
Returns:
a promise of a successful server response JSON data, rejected if the client response is not `2xx`, or a connection error occurs
Type
Promise.<(Object|SpineError)>