org.opcfoundation.ua.transport.https
Class HttpsClient

java.lang.Object
  extended by org.opcfoundation.ua.transport.https.HttpsClient
All Implemented Interfaces:
ITransportChannel

public class HttpsClient
extends Object
implements ITransportChannel

Https Opc-Ua Client connection to an endpoint.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.opcfoundation.ua.transport.tcp.io.ITransportChannel
ITransportChannel.TransportChannelFeature
 
Field Summary
static org.apache.http.conn.ssl.X509HostnameVerifier ALLOW_ALL_HOSTNAME_VERIFIER
          Constant ALLOW_ALL_HOSTNAME_VERIFIER
 
Constructor Summary
HttpsClient(String protocol)
          Constructor for HttpsClient.
 
Method Summary
 void close()
          close.
 void dispose()
          dispose.
 EndpointConfiguration getEndpointConfiguration()
          getEndpointConfiguration.
 EndpointDescription getEndpointDescription()
          getEndpointDescription.
 EncoderContext getMessageContext()
          getMessageContext.
 int getOperationTimeout()
          Get operation timeout
 EnumSet<ITransportChannel.TransportChannelFeature> getSupportedFeatures()
          Get a list of features supported by the channel.
 void initialize(String connectUrl, TransportChannelSettings tcs, EncoderContext ctx)
          Initialize a secure channel with endpoint identified by the URL.
 ServiceResponse serviceRequest(ServiceRequest request)
          Send a service request over the secure channel.
 ServiceResponse serviceRequest(ServiceRequest request, long operationTimeout)
          Send a service request over the secure channel.
 AsyncResult<ServiceResponse> serviceRequestAsync(ServiceRequest serviceRequest)
          Asynchronous operation to send a request over the secure channel.
 AsyncResult<ServiceResponse> serviceRequestAsync(ServiceRequest serviceRequest, long operationTimeout)
          Asynchronous operation to send a request over the secure channel.
 AsyncResult<ServiceResponse> serviceRequestAsync(ServiceRequest serviceRequest, long operationTimeout, int secureChannelId)
          serviceRequestAsync.
 void setClientConnectionManager(org.apache.http.conn.ClientConnectionManager ccm)
          Set client connection manager.
 void setMaxConnections(int maxConnections)
          Set the number of concurrent maximum connections.
 void setOperationTimeout(int timeout)
          Set operation timeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALLOW_ALL_HOSTNAME_VERIFIER

public static final org.apache.http.conn.ssl.X509HostnameVerifier ALLOW_ALL_HOSTNAME_VERIFIER
Constant ALLOW_ALL_HOSTNAME_VERIFIER

Constructor Detail

HttpsClient

public HttpsClient(String protocol)

Constructor for HttpsClient.

Parameters:
protocol - a String object.
Method Detail

setClientConnectionManager

public void setClientConnectionManager(org.apache.http.conn.ClientConnectionManager ccm)
Set client connection manager. Call before #initialize. If ClientConnectionManager is not set, a default implementation is used

Parameters:
ccm - a ClientConnectionManager object.

setMaxConnections

public void setMaxConnections(int maxConnections)
Set the number of concurrent maximum connections. Call this before calling #initialize. This value applies only if ClientConnectionManager has not been overridden.

Parameters:
maxConnections - a int.

initialize

public void initialize(String connectUrl,
                       TransportChannelSettings tcs,
                       EncoderContext ctx)
                throws ServiceResultException
Initialize a secure channel with endpoint identified by the URL. Initialize HttpsClient.

Specified by:
initialize in interface ITransportChannel
Parameters:
connectUrl - a String object.
tcs - a TransportChannelSettings object.
ctx - a EncoderContext object.
Throws:
ServiceResultException - if any.

serviceRequest

public ServiceResponse serviceRequest(ServiceRequest request)
                               throws ServiceResultException
Send a service request over the secure channel.

If the operation timeouts or the thread is interrupted a ServiceResultException is thrown with StatusCodes.Bad_Timeout.

Specified by:
serviceRequest in interface ITransportChannel
Parameters:
request - a ServiceRequest object.
Returns:
a ServiceResponse object.
Throws:
ServiceResultException - if any.

serviceRequest

public ServiceResponse serviceRequest(ServiceRequest request,
                                      long operationTimeout)
                               throws ServiceResultException
Send a service request over the secure channel.

If the operation timeouts or the operation is interrupted and a ServiceResultException is thrown with StatusCodes.Bad_Timeout.

Specified by:
serviceRequest in interface ITransportChannel
Parameters:
request - a ServiceRequest object.
operationTimeout - timeout time in milliseconds
Returns:
a ServiceResponse object.
Throws:
ServiceResultException - if any.

serviceRequestAsync

public AsyncResult<ServiceResponse> serviceRequestAsync(ServiceRequest serviceRequest)
Asynchronous operation to send a request over the secure channel.

Specified by:
serviceRequestAsync in interface ITransportChannel
Parameters:
serviceRequest - the request
Returns:
the result

serviceRequestAsync

public AsyncResult<ServiceResponse> serviceRequestAsync(ServiceRequest serviceRequest,
                                                        long operationTimeout)
Asynchronous operation to send a request over the secure channel.

Specified by:
serviceRequestAsync in interface ITransportChannel
Parameters:
serviceRequest - the request
operationTimeout - timeout time
Returns:
the result

serviceRequestAsync

public AsyncResult<ServiceResponse> serviceRequestAsync(ServiceRequest serviceRequest,
                                                        long operationTimeout,
                                                        int secureChannelId)

serviceRequestAsync.

Parameters:
serviceRequest - a ServiceRequest object.
operationTimeout - a long.
secureChannelId - a int.
Returns:
a AsyncResult object.

close

public void close()

close.


dispose

public void dispose()

dispose.

Specified by:
dispose in interface ITransportChannel

getSupportedFeatures

public EnumSet<ITransportChannel.TransportChannelFeature> getSupportedFeatures()
Get a list of features supported by the channel.

Specified by:
getSupportedFeatures in interface ITransportChannel
Returns:
a EnumSet object.

getEndpointDescription

public EndpointDescription getEndpointDescription()

getEndpointDescription.

Specified by:
getEndpointDescription in interface ITransportChannel
Returns:
a EndpointDescription object.

getEndpointConfiguration

public EndpointConfiguration getEndpointConfiguration()

getEndpointConfiguration.

Specified by:
getEndpointConfiguration in interface ITransportChannel
Returns:
a EndpointConfiguration object.

getMessageContext

public EncoderContext getMessageContext()

getMessageContext.

Specified by:
getMessageContext in interface ITransportChannel
Returns:
a EncoderContext object.

setOperationTimeout

public void setOperationTimeout(int timeout)
Set operation timeout

Specified by:
setOperationTimeout in interface ITransportChannel
Parameters:
timeout - in milliseconds

getOperationTimeout

public int getOperationTimeout()
Get operation timeout

Specified by:
getOperationTimeout in interface ITransportChannel
Returns:
timeout in milliseconds


Copyright © 2018. All rights reserved.