Package org.kendar.sync.lib.protocol
Class ErrorMessage
java.lang.Object
org.kendar.sync.lib.protocol.Message
org.kendar.sync.lib.protocol.ErrorMessage
Message used to report errors during the synchronization process.
Can be sent by either the client or the server.
-
Constructor Summary
ConstructorsConstructorDescriptionErrorMessage(String errorCode, String errorMessage) Creates a new error message.ErrorMessage(String errorCode, String errorMessage, String details) Creates a new error message. -
Method Summary
Modifier and TypeMethodDescriptionprotected Messagedeserialize(ByteContainer buffer) static ErrorMessagefromException(String errorCode, Exception exception) Creates a new error message from an exception.Gets the message type for this message.protected voidserialize(ByteContainer buffer) voidsetDetails(String details) voidsetErrorCode(String errorCode) voidsetErrorMessage(String errorMessage) Methods inherited from class org.kendar.sync.lib.protocol.Message
deserialize, deserialize, getConnectionId, getPacketId, getSessionId, initialize, registerMessageType, serialize
-
Constructor Details
-
ErrorMessage
public ErrorMessage() -
ErrorMessage
Creates a new error message.- Parameters:
errorCode- The error codeerrorMessage- The error messagedetails- Additional details about the error
-
ErrorMessage
Creates a new error message.- Parameters:
errorCode- The error codeerrorMessage- The error message
-
-
Method Details
-
fromException
Creates a new error message from an exception.- Parameters:
errorCode- The error codeexception- The exception- Returns:
- A new error message
-
getMessageType
Description copied from class:MessageGets the message type for this message.- Specified by:
getMessageTypein classMessage- Returns:
- The message type
-
deserialize
- Specified by:
deserializein classMessage
-
serialize
-
getErrorCode
-
setErrorCode
-
getErrorMessage
-
setErrorMessage
-
getDetails
-
setDetails
-