org.opcfoundation.ua.transport.https
Class HttpsServer

java.lang.Object
  extended by org.opcfoundation.ua.utils.AbstractState<CloseableObjectState,ServiceResultException>
      extended by org.opcfoundation.ua.transport.https.HttpsServer
All Implemented Interfaces:
CloseableObject, ConnectionMonitor, EndpointServer, IStatefulObject<CloseableObjectState,ServiceResultException>

public class HttpsServer
extends AbstractState<CloseableObjectState,ServiceResultException>
implements EndpointServer

Host for an https endpoint


Nested Class Summary
 class HttpsServer.HttpsEndpointHandle
           
 class HttpsServer.SocketHandle
           
 
Nested classes/interfaces inherited from interface org.opcfoundation.ua.transport.EndpointServer
EndpointServer.EndpointHandle
 
Nested classes/interfaces inherited from interface org.opcfoundation.ua.transport.ConnectionMonitor
ConnectionMonitor.ConnectListener
 
Field Summary
static org.apache.http.params.HttpParams DEFAULT_HTTPPARAMS
          Constant DEFAULT_HTTPPARAMS
 
Fields inherited from interface org.opcfoundation.ua.transport.EndpointServer
discoveryEndpoint
 
Constructor Summary
HttpsServer(Application application)
          Constructor for HttpsServer.
 
Method Summary
 void addConnectionListener(ConnectionMonitor.ConnectListener l)
          addConnectionListener.
 EndpointServer.EndpointHandle bind(SocketAddress socketAddress, EndpointBinding endpointBinding)
          Bind an endpoint to a handle.
 CloseableObject close()
          close.
 List<SocketAddress> getBoundSocketAddresses()
          getBoundSocketAddresses.
 void getConnections(Collection<ServerConnection> result)
          getConnections.
 EncoderContext getEncoderContext()
          getEncoderContext.
 EndpointBindingCollection getEndpointBindings()
          Get a collection that contains related endpoints bindings.
 HttpsSettings getHttpsSettings()
          getHttpsSettings.
 Collection<HttpsSecurityPolicy> getSupportedSecurityPolicies()
          getSupportedSecurityPolicies.
 int getWorkerThreadCount()
          getWorkerThreadCount.
protected  void initReactor()
          initReactor.
static TrustManager[] makeTrustManager(CertificateValidator... validators)
          makeTrustManager.
 void removeConnectionListener(ConnectionMonitor.ConnectListener l)
          removeConnectionListener.
 void setWorkerThreadCount(int workerThreadCount)
          Set worker thread count.
protected  void shutdownReactor()
          shutdownReactor.
 HttpsServer.SocketHandle[] socketHandleSnapshot()
          socketHandleSnapshot.
 String toString()
          
 
Methods inherited from class org.opcfoundation.ua.utils.AbstractState
addStateListener, addStateNotifiable, assertNoError, attemptSetState, clearError, getError, getState, hasError, isStateTransitionAllowed, onListenerException, onStateTransition, removeStateListener, removeStateNotifiable, setError, setState, setState, waitForState, waitForState, waitForStateUninterruptibly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opcfoundation.ua.utils.IStatefulObject
addStateListener, addStateNotifiable, getError, getState, removeStateListener, removeStateNotifiable, waitForState, waitForState, waitForStateUninterruptibly
 

Field Detail

DEFAULT_HTTPPARAMS

public static final org.apache.http.params.HttpParams DEFAULT_HTTPPARAMS
Constant DEFAULT_HTTPPARAMS

Constructor Detail

HttpsServer

public HttpsServer(Application application)
            throws ServiceResultException

Constructor for HttpsServer.

Parameters:
application - a Application object.
Throws:
ServiceResultException - if any.
Method Detail

makeTrustManager

public static TrustManager[] makeTrustManager(CertificateValidator... validators)

makeTrustManager.

Parameters:
validators - a CertificateValidator object.
Returns:
an array of TrustManager objects.

getSupportedSecurityPolicies

public Collection<HttpsSecurityPolicy> getSupportedSecurityPolicies()

getSupportedSecurityPolicies.

Returns:
a Collection object.

setWorkerThreadCount

public void setWorkerThreadCount(int workerThreadCount)
Set worker thread count. Defines how many worker treads are initialized to handle incoming HTTPS requests. Note that this does not limit the number of UA sessions, since all sessions will share these threads. Set this value before calling binding the first socket address.

Parameters:
workerThreadCount - a int.

getWorkerThreadCount

public int getWorkerThreadCount()

getWorkerThreadCount.

Returns:
the current workerThreadCount
See Also:
setWorkerThreadCount(int)

shutdownReactor

protected void shutdownReactor()

shutdownReactor.


initReactor

protected void initReactor()
                    throws ServiceResultException

initReactor.

Throws:
ServiceResultException - if any.

getHttpsSettings

public HttpsSettings getHttpsSettings()

getHttpsSettings.

Returns:
a HttpsSettings object.

bind

public EndpointServer.EndpointHandle bind(SocketAddress socketAddress,
                                          EndpointBinding endpointBinding)
                                   throws ServiceResultException
Bind an endpoint to a handle.

Specified by:
bind in interface EndpointServer
Parameters:
socketAddress - a SocketAddress object.
endpointBinding - a EndpointBinding object.
Returns:
a EndpointServer.EndpointHandle object.
Throws:
ServiceResultException - if any.

addConnectionListener

public void addConnectionListener(ConnectionMonitor.ConnectListener l)

addConnectionListener.

Specified by:
addConnectionListener in interface ConnectionMonitor
Parameters:
l - a ConnectionMonitor.ConnectListener object.

getConnections

public void getConnections(Collection<ServerConnection> result)

getConnections.

Specified by:
getConnections in interface ConnectionMonitor
Parameters:
result - a Collection object.

removeConnectionListener

public void removeConnectionListener(ConnectionMonitor.ConnectListener l)

removeConnectionListener.

Specified by:
removeConnectionListener in interface ConnectionMonitor
Parameters:
l - a ConnectionMonitor.ConnectListener object.

getBoundSocketAddresses

public List<SocketAddress> getBoundSocketAddresses()

getBoundSocketAddresses.

Specified by:
getBoundSocketAddresses in interface EndpointServer
Returns:
a List object.

getEncoderContext

public EncoderContext getEncoderContext()

getEncoderContext.

Specified by:
getEncoderContext in interface EndpointServer
Returns:
a EncoderContext object.

getEndpointBindings

public EndpointBindingCollection getEndpointBindings()
Get a collection that contains related endpoints bindings.

Specified by:
getEndpointBindings in interface EndpointServer
Returns:
endpoint collection

close

public CloseableObject close()

close.

Specified by:
close in interface CloseableObject
Returns:
a CloseableObject object.

toString

public String toString()

Overrides:
toString in class Object

socketHandleSnapshot

public HttpsServer.SocketHandle[] socketHandleSnapshot()

socketHandleSnapshot.

Returns:
an array of HttpsServer.SocketHandle objects.


Copyright © 2018. All rights reserved.