UMDS Java API
6.14
|
Inherited by com.latencybusters.umds.UMDSTestApp.
Public Member Functions | |
long | getError () |
String | getErrorStr () |
boolean | isAuthenticated () |
boolean | isConnected () |
UMDSServerConnection (String ApplicationName) | |
UMDSServerConnection (UMDS b, String ApplicationName) throws UMDSException | |
void | start () throws UMDSException |
final void | setProperty (String name, String strvalue) throws UMDSException |
Set an individual configuration setting. More... | |
final String | getProperty (String name) throws UMDSException |
final void | setProperty (String[] s) throws UMDSException |
void | send (String TopicName, byte[] appdata) throws UMDSException |
byte[] | compressBuffer (byte[] input) |
byte[] | decompressMsg (UMDSMessage input) |
void | onEvent (UMDSMessage msg) |
final void | onRequest (UMDSMessage msg) |
void | onResponse (UMDSMessage msg) |
final void | close () throws UMDSException |
UMDS | getUMDS () |
Public Attributes | |
COMPR_TYPE | compressionType = COMPR_TYPE.NONE |
Static Public Attributes | |
static final int | CAPABILITIES_REQUEST_RESPONSE = 0x1 |
class UMDSServerConnection is the main class for UMDS clients. Applications are expected to derive from this class. It has several inner classes to simplify the applications need to derive many classes.
An application may want to derive from this class in the following scenarios: 1) To implement their own notification handler 2) To implement their own logging functions 3) To implement their own exception handlers 4) Any combination of the above (probably all)
com.latencybusters.umds.UMDSServerConnection.UMDSServerConnection | ( | String | ApplicationName | ) |
Create a UMDSServerConnection object. After creating the connection object, Configuration parameters can be set before starting the connection.
ApplicationName | The name of the application creating this connection |
com.latencybusters.umds.UMDSServerConnection.UMDSServerConnection | ( | UMDS | b, |
String | ApplicationName | ||
) | throws UMDSException |
Create a UMDSServerConnection object based on a UMDS object. After creating the connection object, Configuration parameters can be set before starting the connection.
b | The base UMDS object |
ApplicationName | The name of the application creating this connection |
UMDSException |
References com.latencybusters.umds.UMDSServerConnection.setProperty(), and com.latencybusters.umds.UMDS.LOG_LEVEL.WARN.
final void com.latencybusters.umds.UMDSServerConnection.close | ( | ) | throws UMDSException |
Close the server connection. This is a graceful close operation. Sent messages will be flushed. If client-linger is set, flushing will timeout at client-linger ms.
UMDSException | the UMDS exception |
References com.latencybusters.umds.UMDSMessage.MSG_TYPE.DISCONNECT, and com.latencybusters.umds.UMDS.LOG_LEVEL.WARN.
Referenced by com.latencybusters.umds.UMDSServerConnection.send().
long com.latencybusters.umds.UMDSServerConnection.getError | ( | ) |
Get the current error status of this connection
String com.latencybusters.umds.UMDSServerConnection.getErrorStr | ( | ) |
Get the current error status string of this connection
final String com.latencybusters.umds.UMDSServerConnection.getProperty | ( | String | name | ) | throws UMDSException |
Get an individual configuration setting.
name | The name of the configuration parameter to be set |
UMDSException | the UMDS exception |
UMDS com.latencybusters.umds.UMDSServerConnection.getUMDS | ( | ) |
Get the registered UMDS base object.
References com.latencybusters.umds.UMDS.LOG_LEVEL.APPLICATION_ERROR, com.latencybusters.umds.UMDS.log(), and com.latencybusters.umds.UMDS.LOG_LEVEL.WARN.
boolean com.latencybusters.umds.UMDSServerConnection.isAuthenticated | ( | ) |
Determine if the connection is authenticated.
Referenced by com.latencybusters.umds.UMDSServerConnection.send().
boolean com.latencybusters.umds.UMDSServerConnection.isConnected | ( | ) |
Determine if the connection is connected.
void com.latencybusters.umds.UMDSServerConnection.onEvent | ( | UMDSMessage | msg | ) |
Event Notification function. This function is called when non-data events occur, E.G. Disconnection reported by the server. Messages passed to this callback may used cached objects.
Applications must copy the content if they require processing the data on other threads.
This should be overridden by applications.
Expected message Types: LOSS, DISCONNECT, LOGIN_DENIED, SERVER_STOPPED, SOURCE_CREATE, RECEIVER_CREATE, SOURCE_DELETE, RECEIVER_DELETE, CONNECT, LOGIN_COMPLETE and LOGOUT_COMPLETE.
msg | The message containing the event |
References com.latencybusters.umds.UMDSMessage.MSG_TYPE.CONNECT, com.latencybusters.umds.UMDSMessage.MSG_TYPE.DISCONNECT, com.latencybusters.umds.UMDSMessage.MSG_TYPE.LOGIN_COMPLETE, com.latencybusters.umds.UMDSMessage.MSG_TYPE.LOGIN_DENIED, com.latencybusters.umds.UMDSMessage.MSG_TYPE.LOGOUT_COMPLETE, com.latencybusters.umds.UMDSMessage.MSG_TYPE.LOSS, com.latencybusters.umds.UMDSMessage.MSG_TYPE.RECEIVER_CREATE, com.latencybusters.umds.UMDSMessage.MSG_TYPE.RECEIVER_DELETE, com.latencybusters.umds.UMDSMessage.seqnum, com.latencybusters.umds.UMDSMessage.MSG_TYPE.SERVER_STOPPED, com.latencybusters.umds.UMDSMessage.MSG_TYPE.SOURCE_CREATE, com.latencybusters.umds.UMDSMessage.MSG_TYPE.SOURCE_DELETE, com.latencybusters.umds.UMDSMessage.srcidx, com.latencybusters.umds.UMDSMessage.status, com.latencybusters.umds.UMDSMessage.status_str, com.latencybusters.umds.UMDSMessage.type, and com.latencybusters.umds.UMDS.LOG_LEVEL.WARN.
Referenced by com.latencybusters.umds.UMDSServerConnection.send().
final void com.latencybusters.umds.UMDSServerConnection.onRequest | ( | UMDSMessage | msg | ) |
Connection Level Request function. This function is called when a connection level (MIM) Request is sent.
msg | The message containing the event |
void com.latencybusters.umds.UMDSServerConnection.onResponse | ( | UMDSMessage | msg | ) |
Connection Level Response function. This function is called when a connection level (MIM) response is received,
msg | The message containing the event |
void com.latencybusters.umds.UMDSServerConnection.send | ( | String | TopicName, |
byte[] | appdata | ||
) | throws UMDSException |
Send an application data buffer on a given topic.
TopicName | The topic name to be send on |
appdata | The application data payload |
UMDSException | the UMDS exception |
References com.latencybusters.umds.UMDSMessage.appdata, com.latencybusters.umds.UMDSMessage.appmeta_data, com.latencybusters.umds.UMDSServerConnection.close(), com.latencybusters.umds.UMDSMessage.MSG_TYPE.DISCONNECT, com.latencybusters.umds.UMDSReceiverRecoveryInfo.getHighSequenceNumber(), com.latencybusters.umds.UMDSReceiverRecoveryInfo.getLowSequenceNumber(), com.latencybusters.umds.UMDSReceiverRecoveryInfo.getSrcSessionId(), com.latencybusters.umds.UMDSReceiverRecoveryInfo.getTopic(), com.latencybusters.umds.UMDSServerConnection.isAuthenticated(), com.latencybusters.umds.UMDSMessage.low_seqnum, com.latencybusters.umds.UMDSServerConnection.onEvent(), com.latencybusters.umds.UMDSMessage.seqnum, com.latencybusters.umds.UMDSMessage.status, com.latencybusters.umds.UMDSMessage.status_str, and com.latencybusters.umds.UMDS.LOG_LEVEL.WARN.
final void com.latencybusters.umds.UMDSServerConnection.setProperty | ( | String | name, |
String | strvalue | ||
) | throws UMDSException |
Set an individual configuration setting.
See Client Configuration Properties.
name | The name of the configuration parameter to be set |
strvalue | The value of the configuration parameter as a string |
UMDSException | the UMDS exception |
Referenced by com.latencybusters.umds.UMDSServerConnection.setProperty(), and com.latencybusters.umds.UMDSServerConnection.UMDSServerConnection().
final void com.latencybusters.umds.UMDSServerConnection.setProperty | ( | String[] | s | ) | throws UMDSException |
Set configuration setting from array of strings. The array should contain alternating name value pairs: { "name1", "value", "name2", "value2", ... Where a name has no value, a null should be provided.
s | The string array containing the name, value pairs |
UMDSException | When the server is not initialised |
References com.latencybusters.umds.UMDSMessageOptions.app_meta_data, and com.latencybusters.umds.UMDSServerConnection.setProperty().
void com.latencybusters.umds.UMDSServerConnection.start | ( | ) | throws UMDSException |
Start the server connection. This will create the thread used to manage the connection and therefore all connection related configuration must occur before start() is called.
A random server will be chosen from the configured list
UMDSException |
References com.latencybusters.umds.UMDS.LOG_LEVEL.WARN.