public class ConnectionImpl extends ConnectionBaseImpl implements Connection
connectCallbackHandlerconnectionInformation, executor, statistics| Constructor and Description |
|---|
ConnectionImpl(ConnectionInformation connectionInformation) |
ConnectionImpl(ConnectionInformation connectionInformation,
org.apache.mina.core.service.IoProcessor<org.apache.mina.transport.socket.nio.NioSession> processor)
Create a new connection
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListListener(ItemListListener listener)
Add a new listener to the connection in order to receive item list
updates.
|
protected void |
closeQuery(Long queryId) |
Query |
createQuery(String itemId,
QueryParameters parameters,
QueryListener listener,
boolean updateData)
Create a new query on the server
|
void |
dispose()
Dispose the connection
|
protected void |
handleMessage(Object message)
Handle a message that came in by the current session.
|
protected void |
onConnectionBound()
Called when the connection got bound
|
protected void |
onConnectionClosed()
Called when the connection got closed
|
void |
removeListListener(ItemListListener listener)
Remove a listener from the connection
|
protected void |
sendBrowseRequestState(boolean state) |
protected void |
sendCloseQuery(long queryId) |
protected void |
sendQueryUpdateParameters(long id,
QueryParameters parameters) |
protected void |
updateQueryParameters(QueryImpl query,
QueryParameters parameters) |
makeProperties, nextRequest, onConnectionConnected, processCallbackFuture, registerCallbackHandler, sendRequestMessage, setCallbackFactoryaddConnectionStateListener, addPrivilegeListener, connect, connect, disconnect, firePrivilegeChange, getPrivileges, getSession, getSslSession, getState, handleConnectComplete, isDisposed, messageReceived, performClosed, performDisconnected, performOpened, removeConnectionStateListener, removePrivilegeListener, sendMessage, sendMessageChecked, setState, switchStategetConnectionInformation, getSessionProperties, getStatistics, setSessionPropertiesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddConnectionStateListener, addPrivilegeListener, connect, connect, disconnect, getConnectionInformation, getPrivileges, getSessionProperties, getState, removeConnectionStateListener, removePrivilegeListener, setCallbackFactorypublic ConnectionImpl(ConnectionInformation connectionInformation) throws Exception
Exceptionpublic ConnectionImpl(ConnectionInformation connectionInformation, org.apache.mina.core.service.IoProcessor<org.apache.mina.transport.socket.nio.NioSession> processor) throws Exception
connectionInformation - the information where to connect toprocessor - the socket processor, may be null to use the
defaultException - if anything goes wrongpublic 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 Connectiondispose in class ClientBaseConnectionprotected void onConnectionBound()
ClientBaseConnectionThis method is called while the connection lock is held.
The default implementation does nothing.
onConnectionBound in class ClientBaseConnectionprotected void onConnectionClosed()
ClientBaseConnectionThis method is called while the connection lock is held.
The default implementation does nothing.
onConnectionClosed in class ConnectionBaseImplpublic Query createQuery(String itemId, QueryParameters parameters, QueryListener listener, boolean updateData)
ConnectionitemId - the historical item to queryparameters - the initial query parameterslistener - the listener that will receive dataupdateData - true if the query should provide continuous
updates, false if the query should only be
executed once an not data
updates should be delivered after the query state changed to
QueryState.COMPLETE.null is never returnedpublic void addListListener(ItemListListener listener)
ConnectionA new listener will also receive any already known items.
listener - the listener to addpublic void removeListListener(ItemListListener listener)
Connectionlistener - the listener to removeprotected void closeQuery(Long queryId)
protected void updateQueryParameters(QueryImpl query, QueryParameters parameters)
protected void handleMessage(Object message)
ClientBaseConnectionNote that the method is called while holding the lock the connection itself.
handleMessage in class ConnectionBaseImplmessage - the received messageprotected void sendCloseQuery(long queryId)
protected void sendQueryUpdateParameters(long id,
QueryParameters parameters)
protected void sendBrowseRequestState(boolean state)
Copyright © 2016 Eclipse NeoSCADA Project. All rights reserved.