|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.prosysopc.ua.server.ServiceHandler
public abstract class ServiceHandler
A base class for ServiceHandler implementations.
| Field Summary | |
|---|---|
protected static String[] |
stringTable
|
| Constructor Summary | |
|---|---|
protected |
ServiceHandler(SessionManager sessionManager)
|
|
ServiceHandler(SessionManager sessionManager,
NodeManagerTable nodeManagerTable)
Create a new ServiceManager attached to a serviceContext manager |
| Method Summary | |
|---|---|
protected void |
checkRequestLength(Object[] requestObjects,
int maxOperations)
|
protected ServiceContext |
createServiceContext(org.opcfoundation.ua.core.RequestHeader requestHeader)
Create the serviceContext object used to identify the session and other parameters of a service call. |
protected void |
fireRequestResponse(org.opcfoundation.ua.builtintypes.ServiceRequest request,
org.opcfoundation.ua.builtintypes.ServiceResponse response,
ServiceContext serviceContext)
This method should be called every time a response has been handled. |
protected org.opcfoundation.ua.encoding.EncoderContext |
getEncoderContext()
|
protected org.slf4j.Logger |
getLogger()
|
static int |
getMaxOperationsPerRequest()
The maximum number of operations allowed per service request. |
UaNode |
getNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
Find the Node for nodeId. |
NodeManagerTable |
getNodeManagerTable()
|
protected OperationLimitsTypeNode |
getOperationLimits()
|
UaServer |
getServer()
|
SessionManager |
getSessionManager()
|
protected void |
handleServiceResultException(org.opcfoundation.ua.builtintypes.ServiceResponse response,
ServiceException e)
Handle the ServiceException by converting it to the ServiceResult in the response. |
boolean |
hasNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
|
static void |
setMaxOperationsPerRequest(int maxOperationsPerRequest)
Define the maximum number of operations allowed per service request. |
void |
setRequestResponseListener(RequestResponseListener listener)
Sets the Request-Response Listener. |
protected static org.opcfoundation.ua.builtintypes.ExtensionObject |
toExtensionObject(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.Structure data,
org.opcfoundation.ua.builtintypes.QualifiedName dataEncoding,
org.opcfoundation.ua.encoding.EncoderContext encoderContext)
|
protected void |
validateEncoding(org.opcfoundation.ua.core.ReadValueId v)
|
static org.opcfoundation.ua.builtintypes.DiagnosticInfo[] |
validateOperationalDiagnostics(org.opcfoundation.ua.builtintypes.ServiceRequest request,
org.opcfoundation.ua.builtintypes.DiagnosticInfo[] diagnosticInfos)
|
protected ServiceContext |
validateRequest(org.opcfoundation.ua.builtintypes.ServiceRequest request,
org.opcfoundation.ua.transport.ServerSecureChannel serverSecureChannel)
|
protected void |
validateResponse(org.opcfoundation.ua.builtintypes.ServiceRequest request,
org.opcfoundation.ua.builtintypes.ServiceResponse response,
ServiceContext serviceContext)
Validates the service response by setting the timestamp to current. |
protected org.opcfoundation.ua.builtintypes.DiagnosticInfo[] |
validateResponse(org.opcfoundation.ua.builtintypes.ServiceRequest request,
org.opcfoundation.ua.builtintypes.ServiceResponse response,
ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.DiagnosticInfo[] operationalDiagnosticInfos)
|
protected org.opcfoundation.ua.builtintypes.DiagnosticInfo |
validateServiceDiagnostics(org.opcfoundation.ua.builtintypes.ServiceRequest request,
org.opcfoundation.ua.builtintypes.DiagnosticInfo diagnosticInfo)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String[] stringTable
| Constructor Detail |
|---|
public ServiceHandler(SessionManager sessionManager,
NodeManagerTable nodeManagerTable)
sessionManager - nodeManagerTable - protected ServiceHandler(SessionManager sessionManager)
| Method Detail |
|---|
public static int getMaxOperationsPerRequest()
StatusCodes.Bad_TooManyOperations is thrown.
public static void setMaxOperationsPerRequest(int maxOperationsPerRequest)
StatusCodes.Bad_TooManyOperations is thrown.
Default: 10000
maxOperationsPerRequest - the maxOperationsPerRequest to set. If 0 or negative, no limit
is used.
public static org.opcfoundation.ua.builtintypes.DiagnosticInfo[] validateOperationalDiagnostics(org.opcfoundation.ua.builtintypes.ServiceRequest request,
org.opcfoundation.ua.builtintypes.DiagnosticInfo[] diagnosticInfos)
request - diagnosticInfos -
protected static org.opcfoundation.ua.builtintypes.ExtensionObject toExtensionObject(ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.Structure data,
org.opcfoundation.ua.builtintypes.QualifiedName dataEncoding,
org.opcfoundation.ua.encoding.EncoderContext encoderContext)
throws ServiceException
data - dataEncoding -
ServiceException
public final UaNode getNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
throws StatusException
nodeId - The ID of the node to look for.
StatusException - Bad_NodeIdInvalid, if the nodeId is null. Bad_NodeIdUnknown, if the
node is not foundpublic NodeManagerTable getNodeManagerTable()
public UaServer getServer()
public SessionManager getSessionManager()
public boolean hasNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
public void setRequestResponseListener(RequestResponseListener listener)
See RequestResponseListener for more info.
listener - The listener. If parameter is null, the old listener is removed, otherwise the
old listener is replaced with the parameter.
protected void checkRequestLength(Object[] requestObjects,
int maxOperations)
throws ServiceException
ServiceException
protected ServiceContext createServiceContext(org.opcfoundation.ua.core.RequestHeader requestHeader)
throws ServiceException
requestHeader - The session token used to identity the session during communications
ServiceException - If the serviceContext is not found, StatusCode = Bad_SessionIdInvalid
protected void fireRequestResponse(org.opcfoundation.ua.builtintypes.ServiceRequest request,
org.opcfoundation.ua.builtintypes.ServiceResponse response,
ServiceContext serviceContext)
request - The Request from clientresponse - The Response to the request from serverserviceContext - protected org.opcfoundation.ua.encoding.EncoderContext getEncoderContext()
protected org.slf4j.Logger getLogger()
protected OperationLimitsTypeNode getOperationLimits()
protected void handleServiceResultException(org.opcfoundation.ua.builtintypes.ServiceResponse response,
ServiceException e)
response - The response message to sete - The exception info
protected void validateEncoding(org.opcfoundation.ua.core.ReadValueId v)
throws StatusException
StatusException
protected ServiceContext validateRequest(org.opcfoundation.ua.builtintypes.ServiceRequest request,
org.opcfoundation.ua.transport.ServerSecureChannel serverSecureChannel)
throws ServiceException
request - the request messageserverSecureChannel -
ServiceException
protected void validateResponse(org.opcfoundation.ua.builtintypes.ServiceRequest request,
org.opcfoundation.ua.builtintypes.ServiceResponse response,
ServiceContext serviceContext)
response - the response to validate - it must not be nullserviceContext -
protected org.opcfoundation.ua.builtintypes.DiagnosticInfo[] validateResponse(org.opcfoundation.ua.builtintypes.ServiceRequest request,
org.opcfoundation.ua.builtintypes.ServiceResponse response,
ServiceContext serviceContext,
org.opcfoundation.ua.builtintypes.DiagnosticInfo[] operationalDiagnosticInfos)
request - response - serviceContext - operationalDiagnosticInfos -
protected org.opcfoundation.ua.builtintypes.DiagnosticInfo validateServiceDiagnostics(org.opcfoundation.ua.builtintypes.ServiceRequest request,
org.opcfoundation.ua.builtintypes.DiagnosticInfo diagnosticInfo)
request - diagnosticInfo -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||