Class StatelessContextSerializationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.highdeal.pnr.hci.StatelessContextSerializationException
All Implemented Interfaces:
Serializable

public class StatelessContextSerializationException extends Exception
Exception thrown by the StatelessContextSerializer when errors occur. Errors are explained by error codes.
See Also:
  • Field Details

    • INCOMPATIBLE_SERIALIZER_VERSION

      public static final int INCOMPATIBLE_SERIALIZER_VERSION
      Reason indicating that the byte array to unserialize has a bad version number (for example, a version greater or incompatible with the version of the used StatelessContextSerializer).
      See Also:
    • WRITE_ERROR

      public static final int WRITE_ERROR
      Reason indicating that the StatelessContextSerializer is unable to write the given object in a byte array (details are in the message and/or the nested cause exception).
      See Also:
    • READ_ERROR

      public static final int READ_ERROR
      Reason indicating that the StatelessContextSerializer is unable to read the given byte array as a context (details are be add in the message and/or the nested cause exception).
      See Also:
    • CORRUPTED_DATA

      public static final int CORRUPTED_DATA
      Reason indicating that the given byte array for unserialization is corrupted, either it cannot be uncompressed using ZLIB, or the data part of the byte array (eventually after uncompressing) does not match the checksum.
      See Also:
    • INVALID_DATA

      public static final int INVALID_DATA
      Reason indicating that the given byte array for unserialization has an invalid format that obstructs to read it properly.
      See Also:
  • Constructor Details

    • StatelessContextSerializationException

      public StatelessContextSerializationException(int reason, String message)
      Creates a new StatelessContextSerializationException.
      Parameters:
      reason - The exception reason
      message - An additional message
    • StatelessContextSerializationException

      public StatelessContextSerializationException(int reason, String message, Throwable cause)
      Creates a new StatelessContextSerializationException.
      Parameters:
      reason - The exception reason
      message - An additional message
      cause - The cause of this exception
  • Method Details

    • setReason

      public void setReason(int reason)
      Sets the exception reason.
      Parameters:
      reason - The reason of the exception
    • getReason

      public int getReason()
      Gets the exception reason.
      Returns:
      The reason of the exception
    • setMessage

      public void setMessage(String message)
      Sets the message.
      Parameters:
      message - The message
    • getMessage

      public String getMessage()
      Gets the message.
      Overrides:
      getMessage in class Throwable
      Returns:
      The message
    • toString

      public String toString()
      Returns a string representation of this exception; The description includes the exception reason (ex.: INCOMPATIBLE_SERIALIZER_VERSION), the message, and the identified cause (The cause is the exception that caused this exception to get thrown).
      Overrides:
      toString in class Throwable
      Returns:
      The short string representation of this exception