Class FileEndAckMessage

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

public class FileEndAckMessage extends Message
Message sent in response to a file end message to acknowledge that the file has been successfully received.
  • Constructor Details

    • FileEndAckMessage

      public FileEndAckMessage()
    • FileEndAckMessage

      public FileEndAckMessage(String relativePath, boolean success, String errorMessage)
      Creates a new file end acknowledgment message.
      Parameters:
      relativePath - The relative path of the file
      success - Whether the file was successfully received
      errorMessage - Error message if the file was not successfully received
  • Method Details

    • success

      public static FileEndAckMessage success(String relativePath)
      Creates a new file end acknowledgment message for a successful acknowledgment.
      Parameters:
      relativePath - The relative path of the file
      Returns:
      A new file end acknowledgment message
    • failure

      public static FileEndAckMessage failure(String relativePath, String errorMessage)
      Creates a new file end acknowledgment message for a failed acknowledgment.
      Parameters:
      relativePath - The relative path of the file
      errorMessage - The reason for the failure
      Returns:
      A new file end acknowledgment 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
    • getRelativePath

      public String getRelativePath()
    • setRelativePath

      public void setRelativePath(String relativePath)
    • isSuccess

      public boolean isSuccess()
    • setSuccess

      public void setSuccess(boolean success)
    • getErrorMessage

      public String getErrorMessage()
    • setErrorMessage

      public void setErrorMessage(String errorMessage)