Clients - http : FailoverClient

An HTTP client endpoint which provides failover support over multiple HTTP clients.

Constructor

__init

(FailoverClientConfiguration failoverClientConfig)

Remote Methods

post

The POST remote function implementation of the Failover Connector.

head

The HEAD remote function implementation of the Failover Connector.

patch

The PATCH remote function implementation of the Failover Connector.

put

The PUT remote function implementation of the Failover Connector.

options

The OPTIONS remote function implementation of the Failover Connector.

forward

Invokes an HTTP call using the incoming request's HTTP method.

execute

Invokes an HTTP call with the specified HTTP method.

delete

The DELETE remote function implementation of the Failover Connector.

get

The GET remote function implementation of the Failover Connector.

submit

Submits an HTTP request to a service with the specified HTTP verb. The submit() function does not return a Response as the result, rather it returns an HttpFuture which can be used for subsequent interactions with the HTTP endpoint.

getResponse

Retrieves the Response for a previously submitted request.

hasPromise

Checks whether a PushPromise exists for a previously submitted request.

getNextPromise

Retrieves the next available PushPromise for a previously submitted request.

getPromisedResponse

Retrieves the promised server push Response message.

rejectPromise

Rejects a PushPromise. When a PushPromise is rejected, there is no chance of fetching a promised response using the rejected promise.

Fields

  • succeededEndpointIndex int
  • Index of the CallerActions[] array which given a successful response

post

(string path, RequestMessage message)

returns Response | ClientError

The POST remote function implementation of the Failover Connector.

Parameters

  • path string
  • Resource path

  • message RequestMessage
  • HTTP request or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The response or an http:ClientError if failed to fulfill the request

The HEAD remote function implementation of the Failover Connector.

Parameters

  • path string
  • Resource path

  • message RequestMessage (default ())
  • An optional HTTP request or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The response or an http:ClientError if failed to fulfill the request

patch

(string path, RequestMessage message)

returns Response | ClientError

The PATCH remote function implementation of the Failover Connector.

Parameters

  • path string
  • Resource path

  • message RequestMessage
  • An HTTP request or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The response or an http:ClientError if failed to fulfill the request

put

(string path, RequestMessage message)

returns Response | ClientError

The PUT remote function implementation of the Failover Connector.

Parameters

  • path string
  • Resource path

  • message RequestMessage
  • An HTTP request or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The response or an http:ClientError if failed to fulfill the request

options

(string path, RequestMessage message)

returns Response | ClientError

The OPTIONS remote function implementation of the Failover Connector.

Parameters

  • path string
  • Resource path

  • message RequestMessage (default ())
  • An optional HTTP request or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The response or an http:ClientError if failed to fulfill the request

forward

(string path, Request request)

returns Response | ClientError

Invokes an HTTP call using the incoming request's HTTP method.

Parameters

  • path string
  • Resource path

  • Return Type

    (Response | ClientError)
  • The response or an http:ClientError if failed to fulfill the request

execute

(string httpVerb, string path, RequestMessage message)

returns Response | ClientError

Invokes an HTTP call with the specified HTTP method.

Parameters

  • httpVerb string
  • HTTP method to be used for the request

  • path string
  • Resource path

  • message RequestMessage
  • An HTTP request or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The response or an http:ClientError if failed to fulfill the request

delete

(string path, RequestMessage message)

returns Response | ClientError

The DELETE remote function implementation of the Failover Connector.

Parameters

  • path string
  • Resource path

  • message RequestMessage (default ())
  • An optional HTTP request or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The response or an http:ClientError if failed to fulfill the request

get

(string path, RequestMessage message)

returns Response | ClientError

The GET remote function implementation of the Failover Connector.

Parameters

  • path string
  • Resource path

  • message RequestMessage (default ())
  • An optional HTTP request or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (Response | ClientError)
  • The response or an http:ClientError if failed to fulfill the request

submit

(string httpVerb, string path, RequestMessage message)

returns HttpFuture | ClientError

Submits an HTTP request to a service with the specified HTTP verb. The submit() function does not return a Response as the result, rather it returns an HttpFuture which can be used for subsequent interactions with the HTTP endpoint.

Parameters

  • httpVerb string
  • The HTTP verb value

  • path string
  • The resource path

  • message RequestMessage
  • An HTTP outbound request message or any payload of type string, xml, json, byte[], io:ReadableByteChannel or mime:Entity[]

  • Return Type

    (HttpFuture | ClientError)
  • An HttpFuture that represents an asynchronous service invocation, or an http:ClientError if the submission fails

getResponse

(HttpFuture httpFuture)

returns Response | ClientError

Retrieves the Response for a previously submitted request.

Parameters

  • httpFuture HttpFuture
  • The HttpFuture related to a previous asynchronous invocation

  • Return Type

    (Response | ClientError)
  • An HTTP response message, or an ClientError if the invocation fails

hasPromise

(HttpFuture httpFuture)

returns boolean

Checks whether a PushPromise exists for a previously submitted request.

Parameters

  • httpFuture HttpFuture
  • The HttpFuture relates to a previous asynchronous invocation

  • Return Type

    (boolean)
  • A boolean that represents whether a PushPromise exists

getNextPromise

(HttpFuture httpFuture)

returns PushPromise | ClientError

Retrieves the next available PushPromise for a previously submitted request.

Parameters

  • httpFuture HttpFuture
  • The HttpFuture relates to a previous asynchronous invocation

  • Return Type

    (PushPromise | ClientError)
  • An HTTP Push Promise message, or an ClientError if the invocation fails

getPromisedResponse

(PushPromise promise)

returns Response | ClientError

Retrieves the promised server push Response message.

Parameters

  • Return Type

    (Response | ClientError)
  • A promised HTTP Response message, or an ClientError if the invocation fails

rejectPromise

Rejects a PushPromise. When a PushPromise is rejected, there is no chance of fetching a promised response using the rejected promise.

Parameters