Class FileDescriptorAckMessage

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

public class FileDescriptorAckMessage extends Message
Message sent in response to a file descriptor message to acknowledge that the receiver is ready to receive the file data.
  • Constructor Details

    • FileDescriptorAckMessage

      public FileDescriptorAckMessage()
    • FileDescriptorAckMessage

      public FileDescriptorAckMessage(String relativePath, boolean ready, String errorMessage)
      Creates a new file descriptor acknowledgment message.
      Parameters:
      relativePath - The relative path of the file
      ready - Whether the receiver is ready to receive the file data
      errorMessage - Error message if the receiver is not ready
  • Method Details

    • ready

      public static FileDescriptorAckMessage ready(String relativePath)
      Creates a new file descriptor acknowledgment message for a successful acknowledgment.
      Parameters:
      relativePath - The relative path of the file
      Returns:
      A new file descriptor acknowledgment message
    • notReady

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

      public boolean isReady()
    • setReady

      public void setReady(boolean ready)
    • getErrorMessage

      public String getErrorMessage()
    • setErrorMessage

      public void setErrorMessage(String errorMessage)