UMDS .NET API  6.14
com.latencybusters.umds.UMDSServerConnection Class Reference

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) More...

Inheritance diagram for com.latencybusters.umds.UMDSServerConnection:
com.latencybusters.umds.UMDSTestApp

Classes

class  SESSION_STATE
 The definitions for each state the server connection can be.
 
class  UMDSConfig
 The Class UMDSConfig.
 
class  UMDSConfigIsSet
 
class  UMDSObjectManager
 The Class UMDSObjectManager.
 
class  UMDSPermissions
 
class  UMDSReceiverManager
 The Class UMDSReceiverManager.
 
class  UMDSSourceManager
 The Class UMDSSourceManager.
 

Public Types

enum  COMPR_TYPE { NONE, LZ4 }
 

Public Member Functions

bool isAuthenticated ()
 Determine if the connection is authenticated. More...
 
bool isConnected ()
 Determine if the connection is connected. More...
 
 UMDSServerConnection (System.String ApplicationName)
 Create a UMDSServerConnection object. After creating the connection object, Configuration parameters can be set before starting the connection. More...
 
 UMDSServerConnection (UMDS b, System.String ApplicationName)
 Create a UMDSServerConnection object based on a UMDS object. After creating the connection object, Configuration parameters can be set before starting the connection. More...
 
virtual void start ()
 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. More...
 
void setProperty (System.String name, System.String strvalue)
 Set an individual configuration setting. More...
 
System.String getProperty (System.String name)
 Get an individual configuration setting. More...
 
void setProperty (System.String[] s)
 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. More...
 
void setCapabilities (int capabilities)
 
void addCapability (int capability)
 
virtual void send (System.String TopicName, byte[] appdata)
 Send an application data buffer on a given topic. More...
 
byte[] compressBuffer (byte[] input)
 
byte[] decompressMsg (UMDSMessage input)
 
virtual void 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 LOGOUT_COMPLETE. More...
 
void onRequest (UMDSMessage msg)
 Connection Level Request function. This function is called when a connection level (MIM) Request is sent. This functionality is currently unsupported. More...
 
virtual void onResponse (UMDSMessage msg)
 Connection Level Response function. This function is called when a connection level (MIM) response is received, Applications must copy the content if they require processing the data on other threads. / This functionality is currently unsupported. This should be overridden by applications. More...
 
void close ()
 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. More...
 
UMDS getUMDS ()
 Get the registered UMDS base object.
 

Public Attributes

const int CAPABILITIES_REQUEST_RESPONSE = 0x1
 
COMPR_TYPE compressionType = COMPR_TYPE.NONE
 

Properties

virtual long Error [get]
 Get the current error status of this connection. More...
 
virtual System.String ErrorStr [get]
 Get the current error status string of this connection. More...
 
virtual bool Authenticated [get]
 Determine if the connection is authenticated. More...
 
virtual UMDS UMDS [get]
 Get the registered UMDS base object. More...
 

Detailed Description

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)

Constructor & Destructor Documentation

com.latencybusters.umds.UMDSServerConnection.UMDSServerConnection ( System.String  ApplicationName)

Create a UMDSServerConnection object. After creating the connection object, Configuration parameters can be set before starting the connection.

See also
setProperty
Parameters
ApplicationNameThe name of the application creating this connection
com.latencybusters.umds.UMDSServerConnection.UMDSServerConnection ( UMDS  b,
System.String  ApplicationName 
)

Create a UMDSServerConnection object based on a UMDS object. After creating the connection object, Configuration parameters can be set before starting the connection.

See also
setProperty
Parameters
bThe base UMDS object
ApplicationNameThe name of the application creating this connection

Member Function Documentation

void com.latencybusters.umds.UMDSServerConnection.close ( )

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.

the UMDS exception

Exceptions
UMDSException

References com.latencybusters.umds.UMDSMessage.MSG_TYPE.DISCONNECT.

System.String com.latencybusters.umds.UMDSServerConnection.getProperty ( System.String  name)

Get an individual configuration setting.

the UMDS exception

Exceptions
UMDSException
Parameters
nameThe name of the configuration parameter to be set
bool com.latencybusters.umds.UMDSServerConnection.isAuthenticated ( )

Determine if the connection is authenticated.

Returns
true if authenticated
bool com.latencybusters.umds.UMDSServerConnection.isConnected ( )

Determine if the connection is connected.

Returns
return true if connected
virtual void com.latencybusters.umds.UMDSServerConnection.onEvent ( UMDSMessage  msg)
virtual
void com.latencybusters.umds.UMDSServerConnection.onRequest ( UMDSMessage  msg)

Connection Level Request function. This function is called when a connection level (MIM) Request is sent. This functionality is currently unsupported.

Parameters
msgThe message containing the event

Referenced by com.latencybusters.umds.UMDSServerThread.UMDSServerThread().

virtual void com.latencybusters.umds.UMDSServerConnection.onResponse ( UMDSMessage  msg)
virtual

Connection Level Response function. This function is called when a connection level (MIM) response is received, Applications must copy the content if they require processing the data on other threads. / This functionality is currently unsupported. This should be overridden by applications.

Parameters
msgThe message containing the event

Referenced by com.latencybusters.umds.UMDSServerThread.UMDSServerThread().

void com.latencybusters.umds.UMDSServerConnection.setProperty ( System.String  name,
System.String  strvalue 
)

Set an individual configuration setting.

See Client Configuration Properties.

Exceptions
UMDSExceptionthe UMDS exception
Parameters
nameThe name of the configuration parameter to be set
strvalueThe value of the configuration parameter as a string

Referenced by com.latencybusters.umds.UMDSServerThread.UMDSServerThread().

void com.latencybusters.umds.UMDSServerConnection.setProperty ( System.String[]  s)

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.

When the server is not initialised

Exceptions
UMDSException
Parameters
sThe string array containing the name, value pairs

References com.latencybusters.umds.UMDSMessageOptions.app_meta_data.

virtual void com.latencybusters.umds.UMDSServerConnection.start ( )
virtual

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.

Exceptions
UMDSException
See also
ERRCODE
Returns
An ERRCODE value indicating if the connection started.

Property Documentation

virtual bool com.latencybusters.umds.UMDSServerConnection.Authenticated
get

Determine if the connection is authenticated.

Returns
true if authenticated

Referenced by com.latencybusters.umds.UMDSServerThread.UMDSServerThread().

virtual long com.latencybusters.umds.UMDSServerConnection.Error
get

Get the current error status of this connection.

See also
ERRCODE
Returns
The current error status
virtual System.String com.latencybusters.umds.UMDSServerConnection.ErrorStr
get

Get the current error status string of this connection.

See also
ERRCODE
Returns
The current error status string

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