Package com.highdeal.pnr.hci
Class StatelessContextSerializationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.highdeal.pnr.hci.StatelessContextSerializationException
- All Implemented Interfaces:
Serializable
Exception thrown by the
StatelessContextSerializer
when errors occur. Errors are explained by error codes.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intReason 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.static final intReason indicating that the byte array to unserialize has a bad version number (for example, a version greater or incompatible with the version of the usedStatelessContextSerializer).static final intReason indicating that the given byte array for unserialization has an invalid format that obstructs to read it properly.static final intReason indicating that theStatelessContextSerializeris unable to read the given byte array as a context (details are be add in the message and/or the nested cause exception).static final intReason indicating that theStatelessContextSerializeris unable to write the given object in a byte array (details are in the message and/or the nested cause exception). -
Constructor Summary
ConstructorsConstructorDescriptionStatelessContextSerializationException(int reason, String message) Creates a new StatelessContextSerializationException.StatelessContextSerializationException(int reason, String message, Throwable cause) Creates a new StatelessContextSerializationException. -
Method Summary
Modifier and TypeMethodDescriptionGets the message.intGets the exception reason.voidsetMessage(String message) Sets the message.voidsetReason(int reason) Sets the exception reason.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).Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Field Details
-
INCOMPATIBLE_SERIALIZER_VERSION
public static final int INCOMPATIBLE_SERIALIZER_VERSIONReason indicating that the byte array to unserialize has a bad version number (for example, a version greater or incompatible with the version of the usedStatelessContextSerializer).- See Also:
-
WRITE_ERROR
public static final int WRITE_ERRORReason indicating that theStatelessContextSerializeris 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_ERRORReason indicating that theStatelessContextSerializeris 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_DATAReason 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_DATAReason indicating that the given byte array for unserialization has an invalid format that obstructs to read it properly.- See Also:
-
-
Constructor Details
-
StatelessContextSerializationException
Creates a new StatelessContextSerializationException.- Parameters:
reason- The exception reasonmessage- An additional message
-
StatelessContextSerializationException
Creates a new StatelessContextSerializationException.- Parameters:
reason- The exception reasonmessage- An additional messagecause- 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
Sets the message.- Parameters:
message- The message
-
getMessage
Gets the message.- Overrides:
getMessagein classThrowable- Returns:
- The message
-
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).
-