org.opcfoundation.ua.transport.tcp.nio
Class OpcTcpServerSecureChannel

java.lang.Object
  extended by org.opcfoundation.ua.utils.AbstractState<CloseableObjectState,ServiceResultException>
      extended by org.opcfoundation.ua.transport.endpoint.AbstractServerSecureChannel
          extended by org.opcfoundation.ua.transport.tcp.nio.OpcTcpServerSecureChannel
All Implemented Interfaces:
ServerSecureChannel, IStatefulObject<CloseableObjectState,ServiceResultException>

public class OpcTcpServerSecureChannel
extends AbstractServerSecureChannel

OpcTcpServerSecureChannel class.


Field Summary
 AtomicInteger recvSequenceNumber
          Sequence number counter of inbound messages
 SecurityConfiguration securityConfiguration
          Security profile for this security channel
 AtomicInteger sendSequenceNumber
          Sequence number counter of outbound messages
 
Fields inherited from class org.opcfoundation.ua.transport.endpoint.AbstractServerSecureChannel
activeToken, tokens
 
Constructor Summary
OpcTcpServerSecureChannel(OpcTcpServerConnection connection, int secureChannelId)
          Constructor for OpcTcpServerSecureChannel.
 
Method Summary
 void dispose()
          Close and dispose.
 ServerConnection getConnection()
          Get current socket connection if applicable for the binding type.
 String getConnectURL()
          Return the URL of the connection.
 Endpoint getEndpoint()
          Get endpoint
 KeyPair getLocalCertificate()
          getLocalCertificate.
protected  Collection<PendingRequest> getPendingRequests2()
          getPendingRequests2.
 void getPendingServiceRequests(Collection<EndpointServiceRequest<?,?>> result)
          Get all unanswered service requests.
 Cert getRemoteCertificate()
          getRemoteCertificate.
 Server getServer()
          getServer.
protected  void handleCloseSecureChannelRequest(InputMessage mb, CloseSecureChannelRequest req)
          handleCloseSecureChannelRequest.
protected  void handleOpenChannel(InputMessage mb, OpenSecureChannelRequest req)
          handleOpenChannel.
protected  void handleRenewSecureChannelRequest(InputMessage mb, OpenSecureChannelRequest req)
          handleRenewSecureChannelRequest.
protected  void handleSecureMessage(InputMessage mb, IEncodeable msg)
          handleSecureMessage.
 boolean needsCertificate()
          
protected  void onStateTransition(CloseableObjectState oldState, CloseableObjectState newState)
          Override this.
 
Methods inherited from class org.opcfoundation.ua.transport.endpoint.AbstractServerSecureChannel
close, closeAsync, getActiveSecurityToken, getLatestNonExpiredToken, getMessageSecurityMode, getRemoteAddress, getSecureChannelId, getSecurityPolicy, getSecurityToken, isOpen, onListenerException, setActiveSecurityToken, setError, toString
 
Methods inherited from class org.opcfoundation.ua.utils.AbstractState
addStateListener, addStateNotifiable, assertNoError, attemptSetState, clearError, getError, getState, hasError, isStateTransitionAllowed, removeStateListener, removeStateNotifiable, setState, setState, waitForState, waitForState, waitForStateUninterruptibly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

securityConfiguration

public SecurityConfiguration securityConfiguration
Security profile for this security channel


sendSequenceNumber

public final AtomicInteger sendSequenceNumber
Sequence number counter of outbound messages


recvSequenceNumber

public final AtomicInteger recvSequenceNumber
Sequence number counter of inbound messages

Constructor Detail

OpcTcpServerSecureChannel

public OpcTcpServerSecureChannel(OpcTcpServerConnection connection,
                                 int secureChannelId)

Constructor for OpcTcpServerSecureChannel.

Parameters:
connection - a OpcTcpServerConnection object.
secureChannelId - a int.
Method Detail

getLocalCertificate

public KeyPair getLocalCertificate()

getLocalCertificate.

Returns:
a KeyPair object.

getRemoteCertificate

public Cert getRemoteCertificate()

getRemoteCertificate.

Returns:
a Cert object.

getConnectURL

public String getConnectURL()
Return the URL of the connection. This value is only available when the channel is in Open or Closing state, if not the return value is null.

Returns:
connect URL or null

getConnection

public ServerConnection getConnection()
Get current socket connection if applicable for the binding type.

Returns:
connection or null

getEndpoint

public Endpoint getEndpoint()
Get endpoint

Returns:
Endpoint

getServer

public Server getServer()

getServer.

Returns:
a Server object.

getPendingServiceRequests

public void getPendingServiceRequests(Collection<EndpointServiceRequest<?,?>> result)
Get all unanswered service requests.

Parameters:
result - container to fill with unanswered service requests

handleSecureMessage

protected void handleSecureMessage(InputMessage mb,
                                   IEncodeable msg)
                            throws ServiceResultException

handleSecureMessage.

Parameters:
mb - a InputMessage object.
msg - a IEncodeable object.
Throws:
ServiceResultException - if any.

handleOpenChannel

protected void handleOpenChannel(InputMessage mb,
                                 OpenSecureChannelRequest req)
                          throws ServiceResultException

handleOpenChannel.

Parameters:
mb - a InputMessage object.
req - a OpenSecureChannelRequest object.
Throws:
ServiceResultException - if any.

handleRenewSecureChannelRequest

protected void handleRenewSecureChannelRequest(InputMessage mb,
                                               OpenSecureChannelRequest req)
                                        throws ServiceResultException

handleRenewSecureChannelRequest.

Parameters:
mb - a InputMessage object.
req - a OpenSecureChannelRequest object.
Throws:
ServiceResultException - if any.

handleCloseSecureChannelRequest

protected void handleCloseSecureChannelRequest(InputMessage mb,
                                               CloseSecureChannelRequest req)

handleCloseSecureChannelRequest.

Parameters:
mb - a InputMessage object.
req - a CloseSecureChannelRequest object.

onStateTransition

protected void onStateTransition(CloseableObjectState oldState,
                                 CloseableObjectState newState)
Override this.

Overrides:
onStateTransition in class AbstractState<CloseableObjectState,ServiceResultException>
Parameters:
oldState - a StateType object.
newState - a StateType object.

getPendingRequests2

protected Collection<PendingRequest> getPendingRequests2()

getPendingRequests2.

Returns:
a Collection object.

dispose

public void dispose()
Close and dispose. The object becomes unusuable.


needsCertificate

public boolean needsCertificate()



Copyright © 2018. All rights reserved.