UMDS Java API  6.14
com.latencybusters.umds.UMDSSource Class Reference

Inherits com.latencybusters.umds.UMDSSourceBase.

Inherited by com.latencybusters.umds.UMDSTestApp.AppSource.

Public Member Functions

 UMDSSource (UMDSServerConnection sconn, String topic, String[] options) throws UMDSException
 
void send (byte[] data) throws UMDSException
 
void onEvent (UMDSMessage msg)
 
void onResponse (UMDSMessage msg)
 
final void close () throws UMDSException
 
boolean canSend ()
 
void log (int level, String comment)
 
void request (int request_id, byte[] request_data) throws UMDSException
 

Protected Attributes

UMDSServerConnection server
 
String topic
 

Detailed Description

class UMDSSource is the class for UMDS sources.

Constructor & Destructor Documentation

com.latencybusters.umds.UMDSSource.UMDSSource ( UMDSServerConnection  sconn,
String  topic,
String[]  options 
) throws UMDSException

Instantiates a new UMDS source.

Parameters
sconnThe server connection object this source is tied to. This explicitly ties the source to a server.
topicThe topic this source is sending on
optionsList of source client options - a string array containing the name, value pairs

Member Function Documentation

final void com.latencybusters.umds.UMDSSource.close ( ) throws UMDSException

Close this source.

Exceptions
UMDSExceptionWhen the source could not be cleanly deleted
void com.latencybusters.umds.UMDSSourceBase.log ( int  level,
String  comment 
)
inherited

Log a receiver related message. This API currently does nothing unique, but is provided as an aid to users deriving from the class but may in the future be updated to identify the receiver automatically.

Exceptions
UMDSExceptionthe UMDS exception
void com.latencybusters.umds.UMDSSource.onEvent ( UMDSMessage  msg)

Event Notification function. This function is called when non-data events occur, E.G. server denied reported by the server.

This should be overridden by applications.

Expected message Types: DISCONNECT, SERVER_DENIED, CONFIGURATION_ERROR, REQUEST_CANCELED, SOURCE_CREATE and SOURCE_DELETE.

Parameters
msgIn addition to other event types delivered to this callback, when a client sends requests, the server-configured request-timeout will trigger timeout notification events sent from the server to the client. The type for timeout notification events is REQUEST_CANCELED. The only other valid data in a timeout notification event is the RequestID, which corresponds to the request_id specified when the request was sent.

References com.latencybusters.umds.UMDSMessage.MSG_STATUS.CLOSE_PENDING, com.latencybusters.umds.UMDSMessage.MSG_TYPE.CONFIGURATION_ERROR, com.latencybusters.umds.UMDSMessage.MSG_TYPE.DISCONNECT, com.latencybusters.umds.UMDS.LOG_LEVEL.INFO, com.latencybusters.umds.UMDSMessage.MSG_TYPE.LOGIN_COMPLETE, com.latencybusters.umds.UMDSMessage.MSG_TYPE.REQUEST_CANCELED, com.latencybusters.umds.UMDSMessage.requestID, com.latencybusters.umds.UMDSMessage.MSG_TYPE.SERVER_DENIED, 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.

void com.latencybusters.umds.UMDSSource.onResponse ( UMDSMessage  msg)

Callback for response messages received. Implement this method to receive responses. Zero or more responses may be received for each request.

Expected message types: RESPONSE.

Parameters
msgThe type of a response message is RESPONSE. The RequestID corresponds to the request_id specified when the request was sent. The appdata, length() and toString() methods are valid for response messages. All other UMDSMessage interfaces are undefined for response messages.

References com.latencybusters.umds.UMDS.LOG_LEVEL.WARN.

void com.latencybusters.umds.UMDSSourceBase.request ( int  request_id,
byte[]  request_data 
) throws UMDSException
inherited

Send a request on a source topic. Requests and responses are not reliable (they may be lost), so it is expected that an application will periodically send new requests until satisfied with the responses received.

Parameters
request_idUser defined id for this request. Responses and timeout notifications will reference this id. Any 32-bit signed integer value is valid. The same value can be used for multiple requests but this is not recommended as its purpose is to assist in correlating responses to each request.
request_dataUser specified request data.
Exceptions
UMDSExceptionThe same exceptions as the send() method, with no additional exception cases.
void com.latencybusters.umds.UMDSSource.send ( byte[]  data) throws UMDSException

Send an array of data

Parameters
dataThe data to be sent

References com.latencybusters.umds.UMDS.LOG_LEVEL.WARN.

Member Data Documentation

UMDSServerConnection com.latencybusters.umds.UMDSSourceBase.server
protectedinherited

The UMDS Server Connection associated with this Source

String com.latencybusters.umds.UMDSSourceBase.topic
protectedinherited

This source's topic


The documentation for this class was generated from the following file: