public abstract class LazyConnectionWrapper extends Object implements Connection, StatisticsProvider
| Constructor and Description |
|---|
LazyConnectionWrapper(Connection connection,
Integer lingeringTimeout) |
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionStateListener(ConnectionStateListener connectionStateListener) |
void |
addPrivilegeListener(PrivilegeListener listener)
Add a listener to the privileges of the session
|
void |
browse(Location location,
BrowseOperationCallback callback)
Browse a server folder for items.
|
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() |
ScheduledExecutorService |
getExecutor()
Retrieve the executor that is currently set
|
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
|
Collection<StatisticEntry> |
getStatistics() |
protected abstract void |
performConnect() |
protected abstract void |
performDisconnect() |
void |
removeConnectionStateListener(ConnectionStateListener connectionStateListener) |
void |
removePrivilegeListener(PrivilegeListener listener) |
void |
setCallbackFactory(CallbackFactory callbackFactory) |
FolderListener |
setFolderListener(Location location,
FolderListener listener)
Set the listener for this location.
|
ItemUpdateListener |
setItemUpdateListener(String itemId,
ItemUpdateListener listener)
Set the listener for this item.
|
NotifyFuture<WriteResult> |
startWrite(String itemId,
Variant value,
OperationParameters operationParameters,
CallbackHandler callbackHandler) |
NotifyFuture<WriteAttributeResults> |
startWriteAttributes(String itemId,
Map<String,Variant> attributes,
OperationParameters operationParameters,
CallbackHandler callbackHandler) |
void |
subscribeFolder(Location location) |
void |
subscribeItem(String itemId) |
void |
unsubscribeFolder(Location location) |
void |
unsubscribeItem(String itemId) |
void |
write(String itemId,
Variant value,
OperationParameters operationParameters,
WriteOperationCallback callback) |
void |
writeAttributes(String itemId,
Map<String,Variant> attributes,
OperationParameters operationParameters,
WriteAttributeOperationCallback callback) |
public LazyConnectionWrapper(Connection connection, Integer lingeringTimeout)
public void setCallbackFactory(CallbackFactory callbackFactory)
setCallbackFactory in interface Connectionpublic void connect()
Connectionconnect in interface Connectionpublic void connect(CallbackHandler callbackHandler)
Connectionconnect in interface Connectionpublic void disconnect()
Connectiondisconnect in interface Connectionpublic void dispose()
ConnectionA dispose will also act as a disconnect.
Connections must be disposed in order to clean up all resources. In the
past the Connection.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
Connection.dispose() call.
dispose in interface Connectionpublic void addConnectionStateListener(ConnectionStateListener connectionStateListener)
addConnectionStateListener in interface Connectionpublic void removeConnectionStateListener(ConnectionStateListener connectionStateListener)
removeConnectionStateListener in interface Connectionpublic ConnectionState getState()
ConnectiongetState in interface Connectionpublic ConnectionInformation getConnectionInformation()
getConnectionInformation in interface Connectionpublic Map<String,String> getSessionProperties()
ConnectionConnectionState.BOUNDgetSessionProperties in interface Connectionpublic void addPrivilegeListener(PrivilegeListener listener)
ConnectionWhen adding a new listener it will receive an initial call with the current privileges.
addPrivilegeListener in interface Connectionpublic void removePrivilegeListener(PrivilegeListener listener)
removePrivilegeListener in interface Connectionpublic Set<String> getPrivileges()
ConnectiongetPrivileges in interface Connectionnull.public void browse(Location location, BrowseOperationCallback callback)
Connectionlocation - The path to browsecallback - The callback that shall receive notifications of the operationpublic void write(String itemId, Variant value, OperationParameters operationParameters, WriteOperationCallback callback)
public void writeAttributes(String itemId, Map<String,Variant> attributes, OperationParameters operationParameters, WriteAttributeOperationCallback callback)
public NotifyFuture<WriteResult> startWrite(String itemId, Variant value, OperationParameters operationParameters, CallbackHandler callbackHandler)
public NotifyFuture<WriteAttributeResults> startWriteAttributes(String itemId, Map<String,Variant> attributes, OperationParameters operationParameters, CallbackHandler callbackHandler)
public void subscribeFolder(Location location) throws NoConnectionException, OperationException
public void unsubscribeFolder(Location location) throws NoConnectionException, OperationException
public FolderListener setFolderListener(Location location, FolderListener listener)
Connectionlocation - The location for which to set the listenerlistener - The listener to setnull if there was no
previous listenerpublic void subscribeItem(String itemId) throws NoConnectionException, OperationException
public void unsubscribeItem(String itemId) throws NoConnectionException, OperationException
protected abstract void performConnect()
protected abstract void performDisconnect()
public ItemUpdateListener setItemUpdateListener(String itemId, ItemUpdateListener listener)
ConnectionitemId - The item for which to set the listenerlistener - The listener to setnull if there was no
previous listenerpublic ScheduledExecutorService getExecutor()
Connectionnullpublic Collection<StatisticEntry> getStatistics()
getStatistics in interface StatisticsProviderCopyright © 2016 Eclipse NeoSCADA Project. All rights reserved.