public class OpcTcpServerConnection extends AbstractServerConnection
OpcTcpServerConnection class.
ServerConnection.SecureChannelListener| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionListener(IConnectionListener listener)
Add response listener
|
protected void |
cancelTimeoutTimer()
cancelTimeoutTimer.
|
CloseableObject |
close()
close.
|
protected BufferMonitorState |
flush(long position)
flush.
|
static long |
getHandshakeTimeout()
Getter for the field
handshakeTimeout. |
SocketAddress |
getLocalAddress()
Get local socket address
|
SocketAddress |
getRemoteAddress()
Get remote socket address
|
protected CertificateValidator |
getRemoteCertificateValidator()
Remote Certificate Validator, invoked upon connect
|
protected void |
handleAcknowledgeMessage(Acknowledge a)
handleAcknowledgeMessage.
|
protected void |
handleAsymmChunk(ByteBuffer chunk)
handleAsymmChunk.
|
protected void |
handleChunk(ByteBuffer chunk)
handleChunk.
|
protected void |
handleCloseChunk(ByteBuffer chunk)
handleCloseChunk.
|
protected void |
handleCloseSecureChannelRequest(InputMessage mb)
handleCloseSecureChannelRequest.
|
protected void |
handleErrorMessage(ErrorMessage e)
handleErrorMessage.
|
protected void |
handleHelloMessage(Hello h)
handleHelloMessage.
|
protected void |
handleOpenSecureChannelRequest(InputMessage mb)
handleOpenSecureChannelRequest.
|
protected void |
handleRawChunk(ByteBuffer chunk)
handleRawChunk.
|
protected void |
handleSecureMessage(InputMessage mb)
handleSecureMessage.
|
protected void |
handleSymmChunk(ByteBuffer chunk)
handleSymmChunk.
|
boolean |
hasActiveSession()
Returns true if this connection has Session that is Activated and not timed out (nor closed).
|
void |
init()
Start listening for data from the connection, note that data might be processed already before
this method returns.
|
boolean |
isPurgeEligible()
Returns true if this connection is eligble to be purged if we approach max number of
connections, false if this connection is valid and should not be purged.
|
boolean |
isReverse()
Return true if this connection is a reverse connection i.e.
|
protected void |
onStateTransition(CloseableObjectState oldState,
CloseableObjectState newState)
Override this.
|
void |
removeConnectionListener(IConnectionListener listener)
Add response listener
|
protected void |
sendAcknowledge(Acknowledge a)
sendAcknowledge.
|
protected int |
sendAsymmSecureMessage(AsyncWrite msg,
SecurityConfiguration securityConfiguration,
int secureChannelId,
int requestNumber,
AtomicInteger sendSequenceNumber)
sendAsymmSecureMessage.
|
protected void |
sendChunks(ByteBuffer... chunks)
Send chunks.
|
protected void |
sendError(ErrorMessage e)
sendError.
|
protected void |
sendHello(Hello h)
sendHello.
|
protected void |
sendReverseHello(ReverseHello rh) |
protected void |
sendSecureMessage(AsyncWrite msg,
SecurityToken token,
int requestId,
int messageType,
AtomicInteger sendSequenceNumber)
sendSecureMessage.
|
void |
setActiveSession(boolean hasActiveSession)
Set does this connection has active session.
|
protected void |
setError(ServiceResultException e)
setError.
|
static void |
setHandshakeTimeout(long handshakeTimeout)
Define the handshake timeout for new connections.
|
protected OpcTcpServerSecureChannel |
validateSecureChannelId(int reqSecureChannelId)
Throws Bad_SecureChannelIdInvalid if the securechannel is null or doesn't have the given id.
|
addChannelListener, addSecureChannelListener, fireSecureChannelAttached, fireSecureChannelDetached, getConnectURL, getRemoteCertificate, getSecureChannels, onListenerException, removeChannelListener, removeSecureChannelListener, setError, setError, toStringaddStateListener, addStateNotifiable, attemptSetState, clearError, getError, getState, hasError, isStateTransitionAllowed, removeStateListener, removeStateNotifiable, setState, setState, throwIfError, waitForState, waitForState, waitForStateUninterruptiblyclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddStateListener, addStateNotifiable, getError, getState, removeStateListener, removeStateNotifiable, waitForState, waitForState, waitForStateUninterruptiblypublic static long getHandshakeTimeout()
Getter for the field handshakeTimeout.
public static void setHandshakeTimeout(long handshakeTimeout)
handshakeTimeout - the handshakeTimeout to set. Default 600000 = 10 minutes.public void addConnectionListener(IConnectionListener listener)
addConnectionListener in interface ServerConnectionaddConnectionListener in class AbstractServerConnectionlistener - a IConnectionListener object.public CloseableObject close()
close.
close in interface CloseableObjectclose in class AbstractServerConnectionCloseableObject object.public SocketAddress getLocalAddress()
public SocketAddress getRemoteAddress()
ServerConnectionpublic boolean hasActiveSession()
public void init()
public boolean isPurgeEligible()
public boolean isReverse()
public void removeConnectionListener(IConnectionListener listener)
AbstractServerConnectionremoveConnectionListener in interface ServerConnectionremoveConnectionListener in class AbstractServerConnectionlistener - a IConnectionListener object.public void setActiveSession(boolean hasActiveSession)
protected void cancelTimeoutTimer()
cancelTimeoutTimer.
protected BufferMonitorState flush(long position) throws InterruptedException, IOException
flush.
position - a long.BufferMonitorState object.InterruptedException - if any.IOException - if any.protected CertificateValidator getRemoteCertificateValidator()
AbstractServerConnectiongetRemoteCertificateValidator in class AbstractServerConnectionCertificateValidator object.protected void handleAcknowledgeMessage(Acknowledge a) throws ServiceResultException
handleAcknowledgeMessage.
a - a Acknowledge object.ServiceResultException - if any.protected void handleAsymmChunk(ByteBuffer chunk) throws ServiceResultException
handleAsymmChunk.
chunk - a ByteBuffer object.ServiceResultException - if any.protected void handleChunk(ByteBuffer chunk) throws ServiceResultException
handleChunk.
chunk - a ByteBuffer object.ServiceResultException - if any.protected void handleCloseChunk(ByteBuffer chunk) throws ServiceResultException
handleCloseChunk.
chunk - a ByteBuffer object.ServiceResultException - if any.protected void handleCloseSecureChannelRequest(InputMessage mb) throws ServiceResultException
handleCloseSecureChannelRequest.
mb - a InputMessage object.ServiceResultException - if any.protected void handleErrorMessage(ErrorMessage e)
handleErrorMessage.
e - a ErrorMessage object.protected void handleHelloMessage(Hello h) throws ServiceResultException
handleHelloMessage.
h - a Hello object.ServiceResultException - if any.protected void handleOpenSecureChannelRequest(InputMessage mb) throws ServiceResultException
handleOpenSecureChannelRequest.
mb - a InputMessage object.ServiceResultException - if any.protected void handleRawChunk(ByteBuffer chunk)
handleRawChunk.
chunk - a ByteBuffer object.protected void handleSecureMessage(InputMessage mb) throws ServiceResultException
handleSecureMessage.
mb - a InputMessage object.ServiceResultException - if any.protected void handleSymmChunk(ByteBuffer chunk) throws ServiceResultException
handleSymmChunk.
chunk - a ByteBuffer object.ServiceResultException - if any.protected void onStateTransition(CloseableObjectState oldState, CloseableObjectState newState)
onStateTransition in class AbstractServerConnectionoldState - a StateType object.newState - a StateType object.protected void sendAcknowledge(Acknowledge a) throws ServiceResultException
sendAcknowledge.
a - a Acknowledge object.ServiceResultException - if any.protected int sendAsymmSecureMessage(AsyncWrite msg, SecurityConfiguration securityConfiguration, int secureChannelId, int requestNumber, AtomicInteger sendSequenceNumber) throws ServiceResultException
sendAsymmSecureMessage.
Send asymmetric secure message.sendAsymmSecureMessage in class AbstractServerConnectionmsg - a AsyncWrite object.securityConfiguration - a
SecurityConfiguration object.secureChannelId - a int.requestNumber - a int.sendSequenceNumber - a AtomicInteger object.ServiceResultException - if any.protected void sendChunks(ByteBuffer... chunks)
chunks - a ByteBuffer object.protected void sendError(ErrorMessage e) throws ServiceResultException
sendError.
e - a ErrorMessage object.ServiceResultException - if any.protected void sendReverseHello(ReverseHello rh)
protected void sendSecureMessage(AsyncWrite msg, SecurityToken token, int requestId, int messageType, AtomicInteger sendSequenceNumber)
sendSecureMessage.
Send symmetric secure messagesendSecureMessage in class AbstractServerConnectionmsg - a AsyncWrite object.token - a SecurityToken object.requestId - a int.messageType - a int.sendSequenceNumber - a AtomicInteger object.protected void setError(ServiceResultException e)
AbstractServerConnectionsetError.
setError in class AbstractServerConnectione - a ServiceResultException object.protected OpcTcpServerSecureChannel validateSecureChannelId(int reqSecureChannelId) throws ServiceResultException
ServiceResultExceptionCopyright © 2026. All rights reserved.