A LiveSwitch client. More...
Public Member Functions | |
| void | addOnApplicationMessage (fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, String > value) |
| Adds a handler that is raised when an application-scope message is received from the server. More... | |
| void | addOnDeviceMessage (fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, String > value) |
| Adds a handler that is raised when a device-scope message is received from the server. More... | |
| void | addOnHttpRequestCreated (fm.liveswitch.IAction1< fm.liveswitch.HttpRequestCreatedArgs > value) |
| Adds a handler that is raised whenever an underlying HTTP request has been created and is about to be transferred to the server. More... | |
| void | addOnHttpResponseReceived (fm.liveswitch.IAction1< fm.liveswitch.HttpResponseReceivedArgs > value) |
| Adds a handler that is raised whenever an underlying HTTP response has been received and is about to be processed by the client. More... | |
| void | addOnMessage (fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, String > value) |
| Adds a handler that is raised when a client-scope message is received from the server. More... | |
| void | addOnRemoteUpdate (fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, fm.liveswitch.ClientInfo > value) |
| Adds a handler that is raised when the the client's config on the server has changed. More... | |
| void | addOnStateChange (fm.liveswitch.IAction1< fm.liveswitch.Client > value) |
| Adds a handler that is raised when the state changes. More... | |
| void | addOnStreamChange (fm.liveswitch.IAction1< fm.liveswitch.NetworkConnectionState > value) |
| Adds a handler that is raised whenever a client disconnects or reconnects to the internet. More... | |
| void | addOnStreamChanged (fm.liveswitch.IAction1< fm.liveswitch.NetworkConnectionState > value) |
| Adds a handler that is raised after a client disconnects or reconnects to the internet. More... | |
| void | addOnUserMessage (fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, String > value) |
| Adds a handler that is raised when a user-scope message is received from the server. More... | |
| Client (String gatewayUrl, String applicationId) | |
| Initializes a new instance of the fm.liveswitch.Client class. More... | |
| Client (String gatewayUrl, String applicationId, String userId) | |
| Initializes a new instance of the fm.liveswitch.Client class. More... | |
| Client (String gatewayUrl, String applicationId, String userId, String deviceId) | |
| Initializes a new instance of the fm.liveswitch.Client class. More... | |
| Client (String gatewayUrl, String applicationId, String userId, String deviceId, String clientId) | |
| Initializes a new instance of the fm.liveswitch.Client class. More... | |
| Client (String gatewayUrl, String applicationId, String userId, String deviceId, String clientId, String[] roles) | |
| Initializes a new instance of the fm.liveswitch.Client class. More... | |
| Client (String gatewayUrl, String applicationId, String userId, String deviceId, String clientId, String[] roles, String region) | |
| Initializes a new instance of the fm.liveswitch.Client class. More... | |
| fm.liveswitch.Future< Object > | closeAll () |
| Closes all active connections in all channels. More... | |
| String | getApplicationId () |
| Gets the application identifier. More... | |
| fm.liveswitch.Channel[] | getChannels () |
| Gets an array of joined channels. More... | |
| fm.liveswitch.ClientConfig | getConfig () |
| Gets the current configuration. More... | |
| String | getDeviceAlias () |
| Gets the device alias. More... | |
| String | getDeviceId () |
| Gets the device identifier. More... | |
| boolean | getDisableWebSockets () |
| Gets whether to disable WebSocket protocol support and use long-polling, even if the server is capable of accepting WebSocket requests. More... | |
| String | getExternalId () |
| Gets the external client identifier. More... | |
| String | getGatewayUrl () |
| Gets the gateway URL. More... | |
| String | getGatewayVersion () |
| Gets the version of the Gateway Server. More... | |
| String | getId () |
| Gets the client identifier. More... | |
| fm.liveswitch.ClientInfo | getInfo () |
| Gets the client info. More... | |
| long | getMessageBytesReceived () |
| Gets the number of message bytes received. More... | |
| long | getMessageBytesSent () |
| Gets the number of message bytes sent. More... | |
| long | getMessagesReceived () |
| Gets the number of messages received. More... | |
| long | getMessagesSent () |
| Gets the number of messages sent. More... | |
| String | getRegion () |
| Gets the region. More... | |
| int | getRequestMaxRetries () |
| Gets the maximum number of retries allowed for a standard request. More... | |
| int | getRequestTimeout () |
| Gets the number of milliseconds to wait for a standard request to return a response before it is aborted and another request is attempted. More... | |
| String[] | getRoles () |
| Gets the roles. More... | |
| fm.liveswitch.ClientState | getState () |
| Gets the state. More... | |
| String | getTag () |
| Gets the tag. More... | |
| java.lang.Exception | getUnregisterException () |
| Gets the unregister exception, which is set if registration is reset abnormally. More... | |
| String | getUserAlias () |
| Gets the user alias. More... | |
| String | getUserId () |
| Gets the user identifier. More... | |
| fm.liveswitch.Future< fm.liveswitch.Channel > | join (String channelId, String token) |
| Joins a channel. More... | |
| fm.liveswitch.Future< fm.liveswitch.Channel > | join (String token) |
| Joins a channel. More... | |
| fm.liveswitch.Future< fm.liveswitch.Channel > | leave (String channelId) |
| Leaves a channel. More... | |
| fm.liveswitch.Future< fm.liveswitch.Channel[]> | register (String token) |
| Registers with the signalling server. More... | |
| void | removeOnApplicationMessage (fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, String > value) |
| Removes a handler that is raised when an application-scope message is received from the server. More... | |
| void | removeOnDeviceMessage (fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, String > value) |
| Removes a handler that is raised when a device-scope message is received from the server. More... | |
| void | removeOnHttpRequestCreated (fm.liveswitch.IAction1< fm.liveswitch.HttpRequestCreatedArgs > value) |
| Removes a handler that is raised whenever an underlying HTTP request has been created and is about to be transferred to the server. More... | |
| void | removeOnHttpResponseReceived (fm.liveswitch.IAction1< fm.liveswitch.HttpResponseReceivedArgs > value) |
| Removes a handler that is raised whenever an underlying HTTP response has been received and is about to be processed by the client. More... | |
| void | removeOnMessage (fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, String > value) |
| Removes a handler that is raised when a client-scope message is received from the server. More... | |
| void | removeOnRemoteUpdate (fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, fm.liveswitch.ClientInfo > value) |
| Removes a handler that is raised when the the client's config on the server has changed. More... | |
| void | removeOnStateChange (fm.liveswitch.IAction1< fm.liveswitch.Client > value) |
| Removes a handler that is raised when the state changes. More... | |
| void | removeOnStreamChange (fm.liveswitch.IAction1< fm.liveswitch.NetworkConnectionState > value) |
| Removes a handler that is raised whenever a client disconnects or reconnects to the internet. More... | |
| void | removeOnStreamChanged (fm.liveswitch.IAction1< fm.liveswitch.NetworkConnectionState > value) |
| Removes a handler that is raised after a client disconnects or reconnects to the internet. More... | |
| void | removeOnUserMessage (fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, String > value) |
| Removes a handler that is raised when a user-scope message is received from the server. More... | |
| fm.liveswitch.Future< Object > | sendMessage (String message) |
| Sends a message to the server with no delivery. More... | |
| void | setDeviceAlias (String value) |
| Sets the device alias. More... | |
| void | setDisableWebSockets (boolean value) |
| Sets whether to disable WebSocket protocol support and use long-polling, even if the server is capable of accepting WebSocket requests. More... | |
| void | setExternalId (String value) |
| Sets the external client identifier. More... | |
| void | setRequestMaxRetries (int value) |
| Sets the maximum number of retries allowed for a standard request. More... | |
| void | setRequestTimeout (int value) |
| Sets the number of milliseconds to wait for a standard request to return a response before it is aborted and another request is attempted. More... | |
| void | setTag (String value) |
| Sets the tag. More... | |
| void | setUserAlias (String value) |
| Sets the user alias. More... | |
| fm.liveswitch.Future< Object > | unregister () |
| Unregisters with the signalling server. More... | |
| fm.liveswitch.Future< Object > | update (fm.liveswitch.ClientConfig clientConfig) |
| Updates this client. More... | |
Public Member Functions inherited from fm.liveswitch.Dynamic | |
| java.util.HashMap< String, Object > | getDynamicProperties () |
| Gets all dynamic properties on this instance. More... | |
| Object | getDynamicValue (String key) |
| Gets a property value from the local cache. More... | |
| void | setDynamicValue (String key, Object value) |
| Sets a property value in the local cache. More... | |
| boolean | unsetDynamicValue (String key) |
| Removes a property value from the local cache. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from fm.liveswitch.Dynamic | |
| Dynamic () | |
Protected Member Functions inherited from fm.liveswitch.Serializable | |
| boolean | getIsDirty () |
| Gets a value indicating whether this instance is dirty. More... | |
| Serializable () | |
| Initializes a new instance of the fm.liveswitch.Serializable class. More... | |
| void | setIsDirty (boolean value) |
| Sets a value indicating whether this instance is dirty. More... | |
A LiveSwitch client.
| fm.liveswitch.Client.Client | ( | String | gatewayUrl, |
| String | applicationId | ||
| ) |
Initializes a new instance of the fm.liveswitch.Client class.
| gatewayUrl | The gateway URL. |
| applicationId | The application identifier. |
| fm.liveswitch.Client.Client | ( | String | gatewayUrl, |
| String | applicationId, | ||
| String | userId | ||
| ) |
Initializes a new instance of the fm.liveswitch.Client class.
| gatewayUrl | The gateway URL. |
| applicationId | The application identifier. |
| userId | The user identifier, or null
|
| fm.liveswitch.Client.Client | ( | String | gatewayUrl, |
| String | applicationId, | ||
| String | userId, | ||
| String | deviceId | ||
| ) |
Initializes a new instance of the fm.liveswitch.Client class.
| gatewayUrl | The gateway URL. |
| applicationId | The application identifier. |
| userId | The user identifier, or null
|
| deviceId | The device identifier, or null
|
| fm.liveswitch.Client.Client | ( | String | gatewayUrl, |
| String | applicationId, | ||
| String | userId, | ||
| String | deviceId, | ||
| String | clientId | ||
| ) |
Initializes a new instance of the fm.liveswitch.Client class.
| gatewayUrl | The gateway URL. |
| applicationId | The application identifier. |
| userId | The user identifier, or null
|
| deviceId | The device identifier, or null
|
| clientId | The client identifier, or null
|
| fm.liveswitch.Client.Client | ( | String | gatewayUrl, |
| String | applicationId, | ||
| String | userId, | ||
| String | deviceId, | ||
| String | clientId, | ||
| String[] | roles | ||
| ) |
Initializes a new instance of the fm.liveswitch.Client class.
| gatewayUrl | The gateway URL. |
| applicationId | The application identifier. |
| userId | The user identifier, or null
|
| deviceId | The device identifier, or null
|
| clientId | The client identifier, or null
|
| roles | The roles, if any. |
| fm.liveswitch.Client.Client | ( | String | gatewayUrl, |
| String | applicationId, | ||
| String | userId, | ||
| String | deviceId, | ||
| String | clientId, | ||
| String[] | roles, | ||
| String | region | ||
| ) |
Initializes a new instance of the fm.liveswitch.Client class.
| gatewayUrl | The gateway URL. |
| applicationId | The application identifier. |
| userId | The user identifier, or null
|
| deviceId | The device identifier, or null
|
| clientId | The client identifier, or null
|
| roles | The roles, if any. |
| region | The region, if any. |
| void fm.liveswitch.Client.addOnApplicationMessage | ( | fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, String > | value | ) |
Adds a handler that is raised when an application-scope message is received from the server.
Parameters:
| void fm.liveswitch.Client.addOnDeviceMessage | ( | fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, String > | value | ) |
Adds a handler that is raised when a device-scope message is received from the server.
Parameters:
| void fm.liveswitch.Client.addOnHttpRequestCreated | ( | fm.liveswitch.IAction1< fm.liveswitch.HttpRequestCreatedArgs > | value | ) |
Adds a handler that is raised whenever an underlying HTTP request has been created and is about to be transferred to the server.
This is a good place to add headers/cookies. For WebSocket streams, this will fire only once for the initial HTTP-based handshake.
| void fm.liveswitch.Client.addOnHttpResponseReceived | ( | fm.liveswitch.IAction1< fm.liveswitch.HttpResponseReceivedArgs > | value | ) |
Adds a handler that is raised whenever an underlying HTTP response has been received and is about to be processed by the client.
This is a good place to read headers/cookies. For WebSocket streams, this will fire only once for the initial HTTP-based handshake.
| void fm.liveswitch.Client.addOnMessage | ( | fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, String > | value | ) |
Adds a handler that is raised when a client-scope message is received from the server.
Parameters:
| void fm.liveswitch.Client.addOnRemoteUpdate | ( | fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, fm.liveswitch.ClientInfo > | value | ) |
Adds a handler that is raised when the the client's config on the server has changed.
| void fm.liveswitch.Client.addOnStateChange | ( | fm.liveswitch.IAction1< fm.liveswitch.Client > | value | ) |
Adds a handler that is raised when the state changes.
| void fm.liveswitch.Client.addOnStreamChange | ( | fm.liveswitch.IAction1< fm.liveswitch.NetworkConnectionState > | value | ) |
Adds a handler that is raised whenever a client disconnects or reconnects to the internet.
| void fm.liveswitch.Client.addOnStreamChanged | ( | fm.liveswitch.IAction1< fm.liveswitch.NetworkConnectionState > | value | ) |
Adds a handler that is raised after a client disconnects or reconnects to the internet.
| void fm.liveswitch.Client.addOnUserMessage | ( | fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, String > | value | ) |
Adds a handler that is raised when a user-scope message is received from the server.
Parameters:
| fm.liveswitch.Future<Object> fm.liveswitch.Client.closeAll | ( | ) |
Closes all active connections in all channels.
| String fm.liveswitch.Client.getApplicationId | ( | ) |
Gets the application identifier.
| fm.liveswitch.Channel [] fm.liveswitch.Client.getChannels | ( | ) |
Gets an array of joined channels.
| fm.liveswitch.ClientConfig fm.liveswitch.Client.getConfig | ( | ) |
Gets the current configuration.
| String fm.liveswitch.Client.getDeviceAlias | ( | ) |
Gets the device alias.
Cannot be set after registration, use the 'Update' method instead.
| String fm.liveswitch.Client.getDeviceId | ( | ) |
Gets the device identifier.
| boolean fm.liveswitch.Client.getDisableWebSockets | ( | ) |
| String fm.liveswitch.Client.getExternalId | ( | ) |
Gets the external client identifier.
| String fm.liveswitch.Client.getGatewayUrl | ( | ) |
Gets the gateway URL.
| String fm.liveswitch.Client.getGatewayVersion | ( | ) |
Gets the version of the Gateway Server.
This value will not be available until after registration with the Gateway.
| String fm.liveswitch.Client.getId | ( | ) |
Gets the client identifier.
| fm.liveswitch.ClientInfo fm.liveswitch.Client.getInfo | ( | ) |
Gets the client info.
| long fm.liveswitch.Client.getMessageBytesReceived | ( | ) |
Gets the number of message bytes received.
| long fm.liveswitch.Client.getMessageBytesSent | ( | ) |
Gets the number of message bytes sent.
| long fm.liveswitch.Client.getMessagesReceived | ( | ) |
Gets the number of messages received.
| long fm.liveswitch.Client.getMessagesSent | ( | ) |
Gets the number of messages sent.
| String fm.liveswitch.Client.getRegion | ( | ) |
Gets the region.
| int fm.liveswitch.Client.getRequestMaxRetries | ( | ) |
Gets the maximum number of retries allowed for a standard request.
| int fm.liveswitch.Client.getRequestTimeout | ( | ) |
Gets the number of milliseconds to wait for a standard request to return a response before it is aborted and another request is attempted.
Defaults to 15000 (15 seconds).
| String [] fm.liveswitch.Client.getRoles | ( | ) |
Gets the roles.
| fm.liveswitch.ClientState fm.liveswitch.Client.getState | ( | ) |
Gets the state.
| String fm.liveswitch.Client.getTag | ( | ) |
Gets the tag.
Cannot be set after registration, use the 'Update' method instead.
| java.lang.Exception fm.liveswitch.Client.getUnregisterException | ( | ) |
Gets the unregister exception, which is set if registration is reset abnormally.
| String fm.liveswitch.Client.getUserAlias | ( | ) |
Gets the user alias.
Cannot be set after registration, use the 'Update' method instead.
| String fm.liveswitch.Client.getUserId | ( | ) |
Gets the user identifier.
| fm.liveswitch.Future<fm.liveswitch.Channel> fm.liveswitch.Client.join | ( | String | channelId, |
| String | token | ||
| ) |
Joins a channel.
| channelId | The channel identifier. |
| token | The auth token. |
| fm.liveswitch.Future<fm.liveswitch.Channel> fm.liveswitch.Client.join | ( | String | token | ) |
Joins a channel.
| token | The auth token. |
| fm.liveswitch.Future<fm.liveswitch.Channel> fm.liveswitch.Client.leave | ( | String | channelId | ) |
Leaves a channel.
| channelId | The channel identifier. |
| fm.liveswitch.Future<fm.liveswitch.Channel[]> fm.liveswitch.Client.register | ( | String | token | ) |
Registers with the signalling server.
| token | The auth token. |
| void fm.liveswitch.Client.removeOnApplicationMessage | ( | fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, String > | value | ) |
Removes a handler that is raised when an application-scope message is received from the server.
Parameters:
| void fm.liveswitch.Client.removeOnDeviceMessage | ( | fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, String > | value | ) |
Removes a handler that is raised when a device-scope message is received from the server.
Parameters:
| void fm.liveswitch.Client.removeOnHttpRequestCreated | ( | fm.liveswitch.IAction1< fm.liveswitch.HttpRequestCreatedArgs > | value | ) |
Removes a handler that is raised whenever an underlying HTTP request has been created and is about to be transferred to the server.
This is a good place to add headers/cookies. For WebSocket streams, this will fire only once for the initial HTTP-based handshake.
| void fm.liveswitch.Client.removeOnHttpResponseReceived | ( | fm.liveswitch.IAction1< fm.liveswitch.HttpResponseReceivedArgs > | value | ) |
Removes a handler that is raised whenever an underlying HTTP response has been received and is about to be processed by the client.
This is a good place to read headers/cookies. For WebSocket streams, this will fire only once for the initial HTTP-based handshake.
| void fm.liveswitch.Client.removeOnMessage | ( | fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, String > | value | ) |
Removes a handler that is raised when a client-scope message is received from the server.
Parameters:
| void fm.liveswitch.Client.removeOnRemoteUpdate | ( | fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, fm.liveswitch.ClientInfo > | value | ) |
Removes a handler that is raised when the the client's config on the server has changed.
| void fm.liveswitch.Client.removeOnStateChange | ( | fm.liveswitch.IAction1< fm.liveswitch.Client > | value | ) |
Removes a handler that is raised when the state changes.
| void fm.liveswitch.Client.removeOnStreamChange | ( | fm.liveswitch.IAction1< fm.liveswitch.NetworkConnectionState > | value | ) |
Removes a handler that is raised whenever a client disconnects or reconnects to the internet.
| void fm.liveswitch.Client.removeOnStreamChanged | ( | fm.liveswitch.IAction1< fm.liveswitch.NetworkConnectionState > | value | ) |
Removes a handler that is raised after a client disconnects or reconnects to the internet.
| void fm.liveswitch.Client.removeOnUserMessage | ( | fm.liveswitch.IAction2< fm.liveswitch.ClientInfo, String > | value | ) |
Removes a handler that is raised when a user-scope message is received from the server.
Parameters:
| fm.liveswitch.Future<Object> fm.liveswitch.Client.sendMessage | ( | String | message | ) |
Sends a message to the server with no delivery.
| message | The message to be sent. |
| void fm.liveswitch.Client.setDeviceAlias | ( | String | value | ) |
Sets the device alias.
Cannot be set after registration, use the 'Update' method instead.
| void fm.liveswitch.Client.setDisableWebSockets | ( | boolean | value | ) |
| void fm.liveswitch.Client.setExternalId | ( | String | value | ) |
Sets the external client identifier.
| void fm.liveswitch.Client.setRequestMaxRetries | ( | int | value | ) |
Sets the maximum number of retries allowed for a standard request.
| void fm.liveswitch.Client.setRequestTimeout | ( | int | value | ) |
Sets the number of milliseconds to wait for a standard request to return a response before it is aborted and another request is attempted.
Defaults to 15000 (15 seconds).
| void fm.liveswitch.Client.setTag | ( | String | value | ) |
Sets the tag.
Cannot be set after registration, use the 'Update' method instead.
| void fm.liveswitch.Client.setUserAlias | ( | String | value | ) |
Sets the user alias.
Cannot be set after registration, use the 'Update' method instead.
| fm.liveswitch.Future<Object> fm.liveswitch.Client.unregister | ( | ) |
Unregisters with the signalling server.
| fm.liveswitch.Future<Object> fm.liveswitch.Client.update | ( | fm.liveswitch.ClientConfig | clientConfig | ) |
Updates this client.
| clientConfig | The client configuration. |