Class TcapOperation

  • All Implemented Interfaces:
    DataObject, Immutable, Serializable

    public final class TcapOperation
    extends ImmutableDataObject
    Describes a single TCAP operation. This corresponds to the OPERATION 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

      • TcapOperation

        public TcapOperation​(TcapOperation parent,
                             String fieldName,
                             String protocolName,
                             String moduleName,
                             String valuerefName,
                             String apiName,
                             Code code,
                             TcapOperation.OperationClass classOfOperation,
                             String argTypeName,
                             boolean argOptional,
                             String resultTypeName,
                             boolean resultOptional,
                             TcapError[] errors,
                             TcapOperation[] linkedOperations,
                             EventTypeID invokeEventTypeID,
                             String invokeEventClassName,
                             EventTypeID resultEventTypeID,
                             String resultEventClassName)
        Constructs a new TcapOperation.
        Parameters:
        parent - the parent operation to extend, or null if this operation does not extend a parent operation.
        fieldName - the full field name defining this operation
        protocolName - the name of this operation's protocol
        moduleName - the name of the ASN.1 module defining this operation
        valuerefName - the valueref name within the ASN.1 module for this operation definition
        apiName - the short name used within the API for this operation
        code - the operation code of the operation
        classOfOperation - the class of operation
        argTypeName - the name of the Java class used to carry the argument of this operation, or null if the operation has no argument
        argOptional - true iff the operation argument is optional
        resultTypeName - the name of the Java class used to carry the result of this operation, or null if the operation has no result
        resultOptional - true iff the operation result is optional
        errors - an array of possible user errors returned by this operation, or null if the operation allows no user errors
        linkedOperations - an array of possible linked operations for this operation, or null if the operation allows no linked operations
        invokeEventTypeID - an EventTypeID instance indicating the type of event this operation's invokes will be fired as.
        invokeEventClassName - the name of the Java class this operation's invokes will be fired as.
        resultEventTypeID - an EventTypeID instance indicating the type of event this operation's results will be fired as, or null if this operation does not fire result events
        resultEventClassName - the name of the Java class this operation's results will be fired as.
        Throws:
        NullPointerException - if a required parameter is null
        IllegalArgumentException - if the provided class of operation is inconsistent with the argument/result/error description provided
    • Method Detail

      • getFieldName

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

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

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

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

        public String getAPIName()
        Get the name used in this API for this operation. 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
      • getOperationCode

        public Code getOperationCode()
        Get the operation code of this operation.
        Returns:
        the operation code
      • getOperationClass

        public TcapOperation.OperationClass getOperationClass()
        Get the TCAP class of operation of this operation.
        Returns:
        the class of operation
      • getArgumentType

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

        public String getArgumentTypeName()
        Get the name of the Java class used to carry the argument of this operation.
        Returns:
        the argument type class name, or null if the operation has no argument type defined
      • isArgumentOptional

        public boolean isArgumentOptional()
        Check if the argument to this operation is optional.
        Returns:
        true iff the operation argument is optional
      • getResultType

        public Class<?> getResultType​(ClassLoader loader)
        Get the Java Class used to carry the result of this operation.
        Parameters:
        loader - the classloader to use to load the class
        Returns:
        the result type class, or null if the operation has no result type defined or the operation does not returns success
        Throws:
        TypeNotPresentException - if the class cannot be loaded
      • getResultTypeName

        public String getResultTypeName()
        Get the name of the Java class used to carry the result of this operation.
        Returns:
        the result type class name, or null if the operation has no result type defined or the operation does not returns success
      • isResultOptional

        public boolean isResultOptional()
        Check if the result data for this operation is optional.
        Returns:
        true iff the result data is optional
      • getErrors

        public TcapError[] getErrors()
        Get the set of allowable User Errors returned by this operation. If there are no allowable errors, or the operation does not return on failure, then a zero-sized array will be returned.
        Returns:
        a non-null set of TcapError instances
      • getLinkedOperations

        public TcapOperation[] getLinkedOperations()
        Get the set of allowable linked operations associated with this operation. If there are no allowable linked operations, then a zero-sized array will be returned.
        Returns:
        a non-null set of TcapOperation instances
      • getInvokeEventTypeID

        public EventTypeID getInvokeEventTypeID()
        Get the event type to use for this operation's invoke events
        Returns:
        the event type
      • getInvokeEventClass

        public Class<?> getInvokeEventClass​(ClassLoader loader)
        Get the event class to use for this operation's invoke events
        Parameters:
        loader - the classloader to use to load the class
        Returns:
        the event class
        Throws:
        TypeNotPresentException - if the class cannot be loaded
      • getInvokeEventClassName

        public String getInvokeEventClassName()
        Get the name of the event class to use for this operation's invoke events
        Returns:
        the event class name
      • getResultEventTypeID

        public EventTypeID getResultEventTypeID()
        Get the event type to use for this operation's result events
        Returns:
        the event type
      • getResultEventClass

        public Class<?> getResultEventClass​(ClassLoader loader)
        Get the event class to use for this operation's result events
        Parameters:
        loader - the classloader to use to load the class
        Returns:
        the event class
        Throws:
        TypeNotPresentException - if the class cannot be loaded
      • getResultEventClassName

        public String getResultEventClassName()
        Get the event class name to use for this operation's result events
        Returns:
        the event class name
      • getParentOperation

        public TcapOperation getParentOperation()
        Get the parent operation of this operation.
        Returns:
        the parent operation of this operation, or null if this operation has no parent.
      • getBaseOperation

        public TcapOperation getBaseOperation()
        Get the base operation of this operation. This is the "topmost" parent operation in the operation hierarchy, which has no declared parent itself.
        Returns:
        the base operation of this operation, or this if this operation has no parent.
      • isA

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

        public int hashCode()
        Overrides:
        hashCode in class Object