Helper class for adapting Kanzi connect functionality into Android UI Application. More...
Public Member Functions | |
KanziConnectContext () | |
Constructor that constructs object with default arguments. | |
KanziConnectContext (ClientConnector connector) | |
Constructs a kanzi connect context with existing client connector. | |
KanziConnectContext (ClientConnector connector, int loglevel) | |
Constructs a kanzi connect context with existing client connector. | |
KanziConnectContext (int loglevel) | |
Constructs a kanzi connect context with client connector. | |
ClientConnector | getClientConnector () |
Retrieve client connector. | |
ClientConnector.State | getConnectionState () |
Returns the current connection state. | |
boolean | getLogging () |
Retrieve state of logging. | |
UIThreadIntegrator | getUIThreadIntegrator () |
Retrieve Android UI Thread integration functionality. | |
boolean | initialize (StringMap connectionAttributes) |
Initialize the Connect context. | |
boolean | initialize (StringMap connectionAttributes, AbstractService service) |
Initialize the Connect context to run a remote service. | |
boolean | isConnected () |
Returns the current connection status whether connection has been established. | |
void | setClientConnector (ClientConnector connector) |
Changes the client connector. | |
void | setLogging (boolean enable) |
Enable/Disable logging. | |
void | setUIThreadIntegrator (UIThreadIntegrator integrator) |
Changes the UI thread integrator at runtime for example when new one is created. | |
boolean | start () |
Starts connector operation. | |
void | stop () |
Stops the connector operation, will cause possible connection to get disconnected. | |
void | uninitialize () |
Cleanup the connector, will disconnect possible existing connections. | |
Helper class for adapting Kanzi connect functionality into Android UI Application.
Enables running one remote service and any number of Kanzi Connect clients in Android UI thread.
KanziConnectContext | ( | ClientConnector | connector | ) |
Constructs a kanzi connect context with existing client connector.
connector | connector instance |
KanziConnectContext | ( | int | loglevel | ) |
Constructs a kanzi connect context with client connector.
loglevel | the logging level. 4 = trace 3 = info 2 = warning 1 = error |
KanziConnectContext | ( | ClientConnector | connector, |
int | loglevel ) |
Constructs a kanzi connect context with existing client connector.
connector | connector instance |
loglevel | Logging level for kanzi connect core library. 4 = trace 3 = info 2 = warning 1 = error |
ClientConnector getClientConnector | ( | ) |
Retrieve client connector.
ClientConnector.State getConnectionState | ( | ) |
Returns the current connection state.
boolean getLogging | ( | ) |
Retrieve state of logging.
UIThreadIntegrator getUIThreadIntegrator | ( | ) |
Retrieve Android UI Thread integration functionality.
boolean initialize | ( | StringMap | connectionAttributes | ) |
Initialize the Connect context.
After successfull call it is possible to start the connector.
connectionAttributes | connection information, specifies the server to connect |
boolean initialize | ( | StringMap | connectionAttributes, |
AbstractService | service ) |
Initialize the Connect context to run a remote service.
connectionAttributes | connection information, specifies the server to connect |
service | the service to run. can be null. |
boolean isConnected | ( | ) |
Returns the current connection status whether connection has been established.
For more detailed state information and receiving state change callbacks see ClientConnector class returned by getClientConnector() method.
void setClientConnector | ( | ClientConnector | connector | ) |
Changes the client connector.
connector | connector |
void setLogging | ( | boolean | enable | ) |
Enable/Disable logging.
By default logging is enabled.
enable | new state for logging. |
void setUIThreadIntegrator | ( | UIThreadIntegrator | integrator | ) |
Changes the UI thread integrator at runtime for example when new one is created.
integrator | new integrator. |
boolean start | ( | ) |
Starts connector operation.
Connector tries to maintain connection towards the configured server.
Should be called only from android applications UI thread.
void stop | ( | ) |
Stops the connector operation, will cause possible connection to get disconnected.
Should be called only from android applications UI thread.
void uninitialize | ( | ) |
Cleanup the connector, will disconnect possible existing connections.
After calling this new initialization is required before it is possible to start again.