Class TcapError

  • All Implemented Interfaces:
    DataObject, Immutable, Serializable

    public final class TcapError
    extends ImmutableDataObject
    Describes a single TCAP error. This corresponds to the ERROR information object class defined in the ITU X.880 ASN.1 module Remote-Operations-Information-Objects {joint-iso-itu-t remote-operations(4) informationObjects(5) version1(0)}
    See Also:
    Serialized Form
    • Constructor Detail

      • TcapError

        public TcapError​(TcapError parent,
                         String fieldName,
                         String protocolName,
                         String moduleName,
                         String valuerefName,
                         String apiName,
                         Code code,
                         String paramTypeName,
                         boolean paramOptional,
                         EventTypeID errorEventTypeID,
                         String errorEventClassName)
        Creates a new TcapError.
        Parameters:
        parent - the parent error of this error, or null if this error has no parent
        fieldName - the full field name defining this error
        protocolName - the name of this error's protocol
        moduleName - the name of the ASN.1 module defining this error
        valuerefName - the valueref name within the ASN.1 module for this error definition
        apiName - the short name of this operation used within the API
        code - the error code of the error
        paramTypeName - the name of the Java class used to carry the parameter data of this error, or null if the operation has no parameter
        paramOptional - true iff the error parameter is optional
        errorEventTypeID - the event type that this error is fired as
        errorEventClassName - the name of the event class that this error is fired as
    • Method Detail

      • getFieldName

        public String getFieldName()
        Get the field name of this error.
        Returns:
        the field name
      • getProtocolName

        public String getProtocolName()
        Get the name of the error's protocol.
        Returns:
        the protocol name
      • getASN1Name

        public String getASN1Name()
        Get the ASN.1 value reference name defining this error
        Returns:
        the unqualified value reference name
      • getASN1Module

        public String getASN1Module()
        Get the name of the ASN.1 module containing the definition of this error
        Returns:
        the ASN.1 module name
      • getAPIName

        public String getAPIName()
        Get the name used in this API for this error. This is used to construct names of event classes, helper methods, etc. and usually (but not always) it is the same as the ASN.1 value reference name.
        Returns:
        the API name
      • getErrorCode

        public Code getErrorCode()
        Get the error code of this error.
        Returns:
        the error code
      • getParameterType

        public Class<?> getParameterType​(ClassLoader loader)
        Get the Java Class used to carry the parameter of this error
        Parameters:
        loader - the classloader to use to load the class
        Returns:
        the parameter type class, or null if the error has no parameter type defined
        Throws:
        TypeNotPresentException - if the class cannot be loaded
      • getParameterTypeName

        public String getParameterTypeName()
        Get the name of the Java Class used to carry the parameter of this error
        Returns:
        the parameter type class, or null if the error has no parameter type defined
      • isParameterOptional

        public boolean isParameterOptional()
        Check if the parameter of this error is optional.
        Returns:
        true iff the error parameter is optional
      • getParentError

        public TcapError getParentError()
        Get the parent error of this error.
        Returns:
        the parent error of this error, or null if this error has no parent
      • getBaseError

        public TcapError getBaseError()
        Get the base error of this error. This is the "topmost" parent error in the error hierarchy, which has no declared parent itself.
        Returns:
        the base error of this error, or this if this error has no parent.
      • getErrorEventTypeID

        public EventTypeID getErrorEventTypeID()
        Get the event type used to fire this error.
        Returns:
        the event type
      • getErrorEventClass

        public Class<?> getErrorEventClass​(ClassLoader loader)
        Get the event class used to fire this error.
        Parameters:
        loader - the classloader to use to load the class
        Returns:
        the event class
        Throws:
        TypeNotPresentException - if the class cannot be loaded
      • getErrorEventClassName

        public String getErrorEventClassName()
        Get the name of the event class used to fire this error.
        Returns:
        the event class name
      • isA

        public boolean isA​(TcapError other)
        Test if this is a suberror of another error
        Parameters:
        other - the other error to test against
        Returns:
        true if other is a transitive parent of this error
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object