Class NetricsErrorItem

  • All Implemented Interfaces:
    java.io.Serializable

    public final class NetricsErrorItem
    extends java.lang.Object
    implements java.io.Serializable
    Hold and provide access to detailed error information.

    These objects are generated by NetricsException objects. For known error item types this provides a means of accessing parsed out items from the detailed information. Which information is available will depend on the error item type.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int TYPE_NULL
      Indicates this error item contains no information.
      static int TYPE_TRANID
      Indicates this error item contains a transaction id.
      static int TYPE_UNKNOWN
      Indicates this error item contains uncategorized information.
    • Field Detail

      • TYPE_NULL

        public static final int TYPE_NULL
        Indicates this error item contains no information.
        See Also:
        Constant Field Values
      • TYPE_UNKNOWN

        public static final int TYPE_UNKNOWN
        Indicates this error item contains uncategorized information.
        See Also:
        Constant Field Values
      • TYPE_TRANID

        public static final int TYPE_TRANID
        Indicates this error item contains a transaction id.
        See Also:
        Constant Field Values
    • Method Detail

      • getItemType

        public int getItemType()
        Returns the type of the error item, one of NetricsErrorItem.TYPE_*.

        The type of the error item will determine which access methods are valid.

        Returns:
        one of NetricsErrorItem.TYPE_*.
      • getTranId

        @Deprecated
        public int getTranId()
                      throws java.lang.IllegalStateException
        Deprecated.
        Use getTransactionId() to obtain the full transaction id.
        Return the partial 32-bit transaction id.

        This is valid only for TYPE_TRANID. If this is not a TYPE_TRANID error item a IllegalStateException is thrown.

        Returns:
        the full transaction id.
        Throws:
        java.lang.IllegalStateException
      • getTransactionId

        public long getTransactionId()
                              throws java.lang.IllegalStateException
        Return the transaction id.

        This is valid only for TYPE_TRANID. If this is not a TYPE_TRANID error item a IllegalStateException is thrown.

        Returns:
        the transaction id.
        Throws:
        java.lang.IllegalStateException
      • getDetailsMsg

        public java.lang.String getDetailsMsg()
        Return the error details message.

        If this error item contains an error details message this returns the message. Otherwise it returns null. This is valid for all error item types.

        A detailed error message is returned by many different error cases. The message may be important in helping to debug the cause of an error. When contacting support about an error any detailed error message in the exception should be reported.

        Returns:
        the error details message.