org.opcfoundation.ua.transport.https
Class HttpsServerConnection

java.lang.Object
  extended by org.opcfoundation.ua.utils.AbstractState<CloseableObjectState,ServiceResultException>
      extended by org.opcfoundation.ua.transport.https.HttpsServerConnection
All Implemented Interfaces:
ServerConnection, IStatefulObject<CloseableObjectState,ServiceResultException>

public class HttpsServerConnection
extends AbstractState<CloseableObjectState,ServiceResultException>
implements ServerConnection

This class implements HTTP TSL/SSL conversation. The messages are serialized using binary scheme, the same as with tcp conversation. Because HTTPS channel is already secure, a OPC secure channel is not opened. All HTTPS communications via a URL shall be treated as a single SecureChannel that is shared by multiple Clients. Stack shall provide a unique identifier for the SecureChannel which allows Applications correlate a request with a SecureChannel.This means that Sessions can only be considered secure if the AuthenticationToken (see Part 4) is long (>20 bytes) and HTTPS encryption is enabled.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.opcfoundation.ua.transport.ServerConnection
ServerConnection.SecureChannelListener
 
Constructor Summary
HttpsServerConnection(HttpsServer server, org.apache.http.nio.NHttpServerConnection conn)
          Constructor for HttpsServerConnection.
 
Method Summary
 void addConnectionListener(IConnectionListener listener)
          Add response listener
 void addSecureChannelListener(ServerConnection.SecureChannelListener l)
          addSecureChannelListener.
 SocketAddress getLocalAddress()
          Get local socket address
 org.apache.http.nio.NHttpServerConnection getNHttpServerConnection()
          getNHttpServerConnection.
 SocketAddress getRemoteAddress()
          Get remote socket address
 void getSecureChannels(Collection<ServerSecureChannel> list)
          Get all open and opening secure channels of this connection.
protected  void onStateTransition(CloseableObjectState oldState, CloseableObjectState newState)
          Override this.
 void removeConnectionListener(IConnectionListener listener)
          Add response listener
 void removeSecureChannelListener(ServerConnection.SecureChannelListener l)
          removeSecureChannelListener.
 
Methods inherited from class org.opcfoundation.ua.utils.AbstractState
addStateListener, addStateNotifiable, assertNoError, attemptSetState, clearError, getError, getState, hasError, isStateTransitionAllowed, onListenerException, removeStateListener, removeStateNotifiable, setError, setState, setState, waitForState, waitForState, waitForStateUninterruptibly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpsServerConnection

public HttpsServerConnection(HttpsServer server,
                             org.apache.http.nio.NHttpServerConnection conn)

Constructor for HttpsServerConnection.

Parameters:
server - a HttpsServer object.
conn - a NHttpServerConnection object.
Method Detail

getLocalAddress

public SocketAddress getLocalAddress()
Get local socket address

Specified by:
getLocalAddress in interface ServerConnection
Returns:
socket address

getRemoteAddress

public SocketAddress getRemoteAddress()
Get remote socket address

Specified by:
getRemoteAddress in interface ServerConnection
Returns:
remote socket address

getNHttpServerConnection

public org.apache.http.nio.NHttpServerConnection getNHttpServerConnection()

getNHttpServerConnection.

Returns:
a NHttpServerConnection object.

getSecureChannels

public void getSecureChannels(Collection<ServerSecureChannel> list)
Get all open and opening secure channels of this connection.

Specified by:
getSecureChannels in interface ServerConnection
Parameters:
list - list to be filled

addSecureChannelListener

public void addSecureChannelListener(ServerConnection.SecureChannelListener l)

addSecureChannelListener.

Specified by:
addSecureChannelListener in interface ServerConnection
Parameters:
l - a ServerConnection.SecureChannelListener object.

removeSecureChannelListener

public void removeSecureChannelListener(ServerConnection.SecureChannelListener l)

removeSecureChannelListener.

Specified by:
removeSecureChannelListener in interface ServerConnection
Parameters:
l - a ServerConnection.SecureChannelListener object.

addConnectionListener

public void addConnectionListener(IConnectionListener listener)
Add response listener

Specified by:
addConnectionListener in interface ServerConnection
Parameters:
listener - a IConnectionListener object.

removeConnectionListener

public void removeConnectionListener(IConnectionListener listener)
Add response listener

Specified by:
removeConnectionListener in interface ServerConnection
Parameters:
listener - a IConnectionListener 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.


Copyright © 2018. All rights reserved.