Class ErrorMessage

java.lang.Object
org.kendar.sync.lib.protocol.Message
org.kendar.sync.lib.protocol.ErrorMessage

public class ErrorMessage extends Message
Message used to report errors during the synchronization process. Can be sent by either the client or the server.
  • Constructor Details

    • ErrorMessage

      public ErrorMessage()
    • ErrorMessage

      public ErrorMessage(String errorCode, String errorMessage, String details)
      Creates a new error message.
      Parameters:
      errorCode - The error code
      errorMessage - The error message
      details - Additional details about the error
    • ErrorMessage

      public ErrorMessage(String errorCode, String errorMessage)
      Creates a new error message.
      Parameters:
      errorCode - The error code
      errorMessage - The error message
  • Method Details

    • fromException

      public static ErrorMessage fromException(String errorCode, Exception exception)
      Creates a new error message from an exception.
      Parameters:
      errorCode - The error code
      exception - The exception
      Returns:
      A new error message
    • getMessageType

      public MessageType getMessageType()
      Description copied from class: Message
      Gets the message type for this message.
      Specified by:
      getMessageType in class Message
      Returns:
      The message type
    • deserialize

      protected Message deserialize(ByteContainer buffer)
      Specified by:
      deserialize in class Message
    • serialize

      protected void serialize(ByteContainer buffer)
      Specified by:
      serialize in class Message
    • getErrorCode

      public String getErrorCode()
    • setErrorCode

      public void setErrorCode(String errorCode)
    • getErrorMessage

      public String getErrorMessage()
    • setErrorMessage

      public void setErrorMessage(String errorMessage)
    • getDetails

      public String getDetails()
    • setDetails

      public void setDetails(String details)