fm.liveswitch.WebSocketTransfer Class Referenceabstract

Base class that defines methods for transferring content over the WebSocket protocol. More...

Public Member Functions

int getHandshakeTimeout ()
 Gets the timeout for the initial handshake (in ms). More...
 
fm.liveswitch.IAction1< fm.liveswitch.WebSocketOpenFailureArgsgetOnOpenFailure ()
 Gets the callback to invoke if the handshake fails. More...
 
fm.liveswitch.IAction1< fm.liveswitch.WebSocketOpenSuccessArgsgetOnOpenSuccess ()
 Gets the callback to invoke if the handshake succeeds. More...
 
fm.liveswitch.IAction1< fm.liveswitch.HttpRequestCreatedArgsgetOnRequestCreated ()
 Gets the callback to invoke when the handshake request is created. More...
 
fm.liveswitch.IAction1< fm.liveswitch.HttpResponseReceivedArgsgetOnResponseReceived ()
 Gets the callback to invoke when the handshake response is received. More...
 
fm.liveswitch.IAction1< fm.liveswitch.WebSocketStreamFailureArgsgetOnStreamFailure ()
 Gets the callback to invoke if the stream errors out. More...
 
Object getSender ()
 Gets the sender of the messages. More...
 
int getStreamTimeout ()
 Gets the timeout for the stream (in ms). More...
 
String getUrl ()
 Gets the URL. More...
 
abstract void open (java.util.HashMap< String, String > headers)
 Opens the socket. More...
 
abstract fm.liveswitch.HttpResponseArgs send (fm.liveswitch.HttpRequestArgs requestArgs)
 Sends a request synchronously. More...
 
abstract void sendAsync (fm.liveswitch.HttpRequestArgs requestArgs, fm.liveswitch.IAction1< fm.liveswitch.HttpResponseArgs > callback)
 Sends a request asynchronously. More...
 
void setHandshakeTimeout (int value)
 Sets the timeout for the initial handshake (in ms). More...
 
void setOnOpenFailure (fm.liveswitch.IAction1< fm.liveswitch.WebSocketOpenFailureArgs > value)
 Sets the callback to invoke if the handshake fails. More...
 
void setOnOpenSuccess (fm.liveswitch.IAction1< fm.liveswitch.WebSocketOpenSuccessArgs > value)
 Sets the callback to invoke if the handshake succeeds. More...
 
void setOnRequestCreated (fm.liveswitch.IAction1< fm.liveswitch.HttpRequestCreatedArgs > value)
 Sets the callback to invoke when the handshake request is created. More...
 
void setOnResponseReceived (fm.liveswitch.IAction1< fm.liveswitch.HttpResponseReceivedArgs > value)
 Sets the callback to invoke when the handshake response is received. More...
 
void setOnStreamFailure (fm.liveswitch.IAction1< fm.liveswitch.WebSocketStreamFailureArgs > value)
 Sets the callback to invoke if the stream errors out. More...
 
void setSender (Object value)
 Sets the sender of the messages. More...
 
void setStreamTimeout (int value)
 Sets the timeout for the stream (in ms). More...
 
void setUrl (String value)
 Sets the URL. More...
 
abstract void shutdown ()
 Releases any resources and shuts down. More...
 
 WebSocketTransfer (String url)
 Initializes a new instance of the fm.liveswitch.WebSocketTransfer class. More...
 

Detailed Description

Base class that defines methods for transferring content over the WebSocket protocol.

Constructor & Destructor Documentation

◆ WebSocketTransfer()

fm.liveswitch.WebSocketTransfer.WebSocketTransfer ( String  url)

Initializes a new instance of the fm.liveswitch.WebSocketTransfer class.

Parameters
urlThe URL.

Member Function Documentation

◆ getHandshakeTimeout()

int fm.liveswitch.WebSocketTransfer.getHandshakeTimeout ( )

Gets the timeout for the initial handshake (in ms).

◆ getOnOpenFailure()

fm.liveswitch.IAction1<fm.liveswitch.WebSocketOpenFailureArgs> fm.liveswitch.WebSocketTransfer.getOnOpenFailure ( )

Gets the callback to invoke if the handshake fails.

◆ getOnOpenSuccess()

fm.liveswitch.IAction1<fm.liveswitch.WebSocketOpenSuccessArgs> fm.liveswitch.WebSocketTransfer.getOnOpenSuccess ( )

Gets the callback to invoke if the handshake succeeds.

◆ getOnRequestCreated()

fm.liveswitch.IAction1<fm.liveswitch.HttpRequestCreatedArgs> fm.liveswitch.WebSocketTransfer.getOnRequestCreated ( )

Gets the callback to invoke when the handshake request is created.

◆ getOnResponseReceived()

fm.liveswitch.IAction1<fm.liveswitch.HttpResponseReceivedArgs> fm.liveswitch.WebSocketTransfer.getOnResponseReceived ( )

Gets the callback to invoke when the handshake response is received.

◆ getOnStreamFailure()

fm.liveswitch.IAction1<fm.liveswitch.WebSocketStreamFailureArgs> fm.liveswitch.WebSocketTransfer.getOnStreamFailure ( )

Gets the callback to invoke if the stream errors out.

◆ getSender()

Object fm.liveswitch.WebSocketTransfer.getSender ( )

Gets the sender of the messages.

◆ getStreamTimeout()

int fm.liveswitch.WebSocketTransfer.getStreamTimeout ( )

Gets the timeout for the stream (in ms).

◆ getUrl()

String fm.liveswitch.WebSocketTransfer.getUrl ( )

Gets the URL.

◆ open()

abstract void fm.liveswitch.WebSocketTransfer.open ( java.util.HashMap< String, String >  headers)
abstract

Opens the socket.

Parameters
headersThe headers to pass in with the initial handshake.

Reimplemented in fm.liveswitch.WebSocketWebRequestTransfer.

◆ send()

abstract fm.liveswitch.HttpResponseArgs fm.liveswitch.WebSocketTransfer.send ( fm.liveswitch.HttpRequestArgs  requestArgs)
abstract

Sends a request synchronously.

Parameters
requestArgsThe request parameters.
Returns
The response parameters.

Reimplemented in fm.liveswitch.WebSocketWebRequestTransfer.

◆ sendAsync()

abstract void fm.liveswitch.WebSocketTransfer.sendAsync ( fm.liveswitch.HttpRequestArgs  requestArgs,
fm.liveswitch.IAction1< fm.liveswitch.HttpResponseArgs callback 
)
abstract

Sends a request asynchronously.

Parameters
requestArgsThe request parameters.
callbackThe callback to execute with the resulting response.

Reimplemented in fm.liveswitch.WebSocketWebRequestTransfer.

◆ setHandshakeTimeout()

void fm.liveswitch.WebSocketTransfer.setHandshakeTimeout ( int  value)

Sets the timeout for the initial handshake (in ms).

◆ setOnOpenFailure()

void fm.liveswitch.WebSocketTransfer.setOnOpenFailure ( fm.liveswitch.IAction1< fm.liveswitch.WebSocketOpenFailureArgs value)

Sets the callback to invoke if the handshake fails.

◆ setOnOpenSuccess()

void fm.liveswitch.WebSocketTransfer.setOnOpenSuccess ( fm.liveswitch.IAction1< fm.liveswitch.WebSocketOpenSuccessArgs value)

Sets the callback to invoke if the handshake succeeds.

◆ setOnRequestCreated()

void fm.liveswitch.WebSocketTransfer.setOnRequestCreated ( fm.liveswitch.IAction1< fm.liveswitch.HttpRequestCreatedArgs value)

Sets the callback to invoke when the handshake request is created.

◆ setOnResponseReceived()

void fm.liveswitch.WebSocketTransfer.setOnResponseReceived ( fm.liveswitch.IAction1< fm.liveswitch.HttpResponseReceivedArgs value)

Sets the callback to invoke when the handshake response is received.

◆ setOnStreamFailure()

void fm.liveswitch.WebSocketTransfer.setOnStreamFailure ( fm.liveswitch.IAction1< fm.liveswitch.WebSocketStreamFailureArgs value)

Sets the callback to invoke if the stream errors out.

◆ setSender()

void fm.liveswitch.WebSocketTransfer.setSender ( Object  value)

Sets the sender of the messages.

◆ setStreamTimeout()

void fm.liveswitch.WebSocketTransfer.setStreamTimeout ( int  value)

Sets the timeout for the stream (in ms).

◆ setUrl()

void fm.liveswitch.WebSocketTransfer.setUrl ( String  value)

Sets the URL.

◆ shutdown()

abstract void fm.liveswitch.WebSocketTransfer.shutdown ( )
abstract

Releases any resources and shuts down.

Reimplemented in fm.liveswitch.WebSocketWebRequestTransfer.