com.prosysopc.ua
Class ServiceException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.prosysopc.ua.UaException
              extended by com.prosysopc.ua.ServiceException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ConnectException, SessionActivationException

public class ServiceException
extends UaException

An exception from an OPC UA service call. On client-side, read the ServiceResult to check which error occurred during a call to an OPC UA service. On server side, generate these exceptions to make the server return the error. The standard error codes are defined in StatusCodes.

See Also:
Serialized Form

Constructor Summary
ServiceException(org.opcfoundation.ua.common.ServiceFaultException e)
          Creates a new ServiceException from a ServiceFaultException (generated by the stack)
ServiceException(org.opcfoundation.ua.common.ServiceResultException e)
          Creates a new ServiceException from a ServiceResultException (generated by the stack)
ServiceException(org.opcfoundation.ua.builtintypes.StatusCode statusCode)
          Creates a new Service Result Exception.
ServiceException(org.opcfoundation.ua.builtintypes.StatusCode statusCode, org.opcfoundation.ua.builtintypes.DiagnosticInfo diagnosticInfo)
          Creates a new Service Result Exception.
ServiceException(String msg)
          Creates a new Service Result Exception with StatusCode = Bad_UnexpectedError.
ServiceException(String msg, org.opcfoundation.ua.common.ServiceFaultException e)
           
ServiceException(String msg, org.opcfoundation.ua.common.ServiceResultException e)
           
ServiceException(String msg, org.opcfoundation.ua.builtintypes.StatusCode statusCode)
          Creates a new Service Result Exception.
ServiceException(String msg, org.opcfoundation.ua.builtintypes.StatusCode statusCode, org.opcfoundation.ua.builtintypes.DiagnosticInfo diagnosticInfo, Throwable cause)
          Creates a new Service Result Exception.
ServiceException(String msg, org.opcfoundation.ua.builtintypes.UnsignedInteger statusCode)
          Creates a new Service Result Exception.
ServiceException(String msg, org.opcfoundation.ua.builtintypes.UnsignedInteger statusCode, org.opcfoundation.ua.builtintypes.DiagnosticInfo diagnosticInfo, Throwable cause)
          Creates a new Service Result Exception.
ServiceException(org.opcfoundation.ua.builtintypes.UnsignedInteger statusCode)
          Creates a new Service Result Exception.
 
Method Summary
 org.opcfoundation.ua.builtintypes.DiagnosticInfo getDiagnosticInfo()
           
 org.opcfoundation.ua.builtintypes.StatusCode getServiceResult()
           
 String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceException

public ServiceException(org.opcfoundation.ua.common.ServiceFaultException e)
Creates a new ServiceException from a ServiceFaultException (generated by the stack)

Parameters:
e -

ServiceException

public ServiceException(org.opcfoundation.ua.common.ServiceResultException e)
Creates a new ServiceException from a ServiceResultException (generated by the stack)

Parameters:
e -

ServiceException

public ServiceException(org.opcfoundation.ua.builtintypes.StatusCode statusCode)
Creates a new Service Result Exception.

Parameters:
statusCode - The error status code defining the actual service call error.

ServiceException

public ServiceException(org.opcfoundation.ua.builtintypes.StatusCode statusCode,
                        org.opcfoundation.ua.builtintypes.DiagnosticInfo diagnosticInfo)
Creates a new Service Result Exception.

Parameters:
statusCode - The error status code defining the actual service call error.
diagnosticInfo - The diagnostic info for the exception

ServiceException

public ServiceException(String msg)
Creates a new Service Result Exception with StatusCode = Bad_UnexpectedError.

Parameters:
msg - Error message.

ServiceException

public ServiceException(String msg,
                        org.opcfoundation.ua.common.ServiceFaultException e)
Parameters:
msg - Error message.
e -

ServiceException

public ServiceException(String msg,
                        org.opcfoundation.ua.common.ServiceResultException e)
Parameters:
msg - Error message.
e -

ServiceException

public ServiceException(String msg,
                        org.opcfoundation.ua.builtintypes.StatusCode statusCode)
Creates a new Service Result Exception.

Parameters:
msg - Error message.
statusCode - The error status code value defining the actual service call error.

ServiceException

public ServiceException(String msg,
                        org.opcfoundation.ua.builtintypes.StatusCode statusCode,
                        org.opcfoundation.ua.builtintypes.DiagnosticInfo diagnosticInfo,
                        Throwable cause)
Creates a new Service Result Exception.

Parameters:
msg - Error message.
statusCode - The error status code defining the actual service call error.
diagnosticInfo - The additional diagnostic information as returned from the server.
cause - the original exception

ServiceException

public ServiceException(String msg,
                        org.opcfoundation.ua.builtintypes.UnsignedInteger statusCode)
Creates a new Service Result Exception.

Parameters:
msg - Error message.
statusCode - The error status code value defining the actual service call error.

ServiceException

public ServiceException(String msg,
                        org.opcfoundation.ua.builtintypes.UnsignedInteger statusCode,
                        org.opcfoundation.ua.builtintypes.DiagnosticInfo diagnosticInfo,
                        Throwable cause)
Creates a new Service Result Exception.

Parameters:
msg - Error message.
statusCode - The error status code value defining the actual service call error.
cause - The original exception

ServiceException

public ServiceException(org.opcfoundation.ua.builtintypes.UnsignedInteger statusCode)
Creates a new Service Result Exception.

Parameters:
statusCode - The error status code value defining the actual service call error.
Method Detail

getDiagnosticInfo

public org.opcfoundation.ua.builtintypes.DiagnosticInfo getDiagnosticInfo()
Returns:
the diagnosticInfo

getServiceResult

public org.opcfoundation.ua.builtintypes.StatusCode getServiceResult()
Returns:
the serviceResult

toString

public String toString()
Overrides:
toString in class Throwable


Copyright © 2018. All rights reserved.