public interface Connection
Modifier and Type | Method and Description |
---|---|
void |
addConnectionStateListener(ConnectionStateListener connectionStateListener) |
void |
addPrivilegeListener(PrivilegeListener listener)
Add a listener to the privileges of the session
|
void |
connect()
Start the connection
|
void |
connect(CallbackHandler callbackHandler)
Start the connection with a callback handler
|
void |
disconnect()
Stop the connection
|
void |
dispose()
Dispose the connection
|
ConnectionInformation |
getConnectionInformation() |
Set<String> |
getPrivileges()
Return the list of currently granted privileges.
|
Map<String,String> |
getSessionProperties()
Return the session properties as provided by the server.
|
ConnectionState |
getState()
Get the current connection state
|
void |
removeConnectionStateListener(ConnectionStateListener connectionStateListener) |
void |
removePrivilegeListener(PrivilegeListener listener) |
void |
setCallbackFactory(CallbackFactory callbackFactory) |
void setCallbackFactory(CallbackFactory callbackFactory)
void connect()
void connect(CallbackHandler callbackHandler)
void disconnect()
void addConnectionStateListener(ConnectionStateListener connectionStateListener)
void removeConnectionStateListener(ConnectionStateListener connectionStateListener)
ConnectionState getState()
ConnectionInformation getConnectionInformation()
Map<String,String> getSessionProperties()
ConnectionState.BOUND
void addPrivilegeListener(PrivilegeListener listener)
When adding a new listener it will receive an initial call with the current privileges.
listener
- void removePrivilegeListener(PrivilegeListener listener)
Set<String> getPrivileges()
null
.void dispose()
A dispose will also act as a disconnect.
Connections must be disposed in order to clean up all resources. In the
past the disconnect()
call was enough and, if possible, most
resources (sockets) should be closed when disconnecting. Still some
resources can be re-used and these need to be cleaned up in the
dispose()
call.
Copyright © 2016 Eclipse NeoSCADA Project. All rights reserved.