Package org.kendar.sync.lib.protocol
Class FileDescriptorAckMessage
java.lang.Object
org.kendar.sync.lib.protocol.Message
org.kendar.sync.lib.protocol.FileDescriptorAckMessage
Message sent in response to a file descriptor message to acknowledge that the receiver
is ready to receive the file data.
-
Constructor Summary
ConstructorsConstructorDescriptionFileDescriptorAckMessage(String relativePath, boolean ready, String errorMessage) Creates a new file descriptor acknowledgment message. -
Method Summary
Modifier and TypeMethodDescriptionprotected Messagedeserialize(ByteContainer buffer) Gets the message type for this message.booleanisReady()static FileDescriptorAckMessageCreates a new file descriptor acknowledgment message for a failed acknowledgment.static FileDescriptorAckMessageCreates a new file descriptor acknowledgment message for a successful acknowledgment.protected voidserialize(ByteContainer buffer) voidsetErrorMessage(String errorMessage) voidsetReady(boolean ready) voidsetRelativePath(String relativePath) Methods inherited from class org.kendar.sync.lib.protocol.Message
deserialize, deserialize, getConnectionId, getPacketId, getSessionId, initialize, serialize
-
Constructor Details
-
FileDescriptorAckMessage
public FileDescriptorAckMessage() -
FileDescriptorAckMessage
Creates a new file descriptor acknowledgment message.- Parameters:
relativePath- The relative path of the fileready- Whether the receiver is ready to receive the file dataerrorMessage- Error message if the receiver is not ready
-
-
Method Details
-
ready
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
Creates a new file descriptor acknowledgment message for a failed acknowledgment.- Parameters:
relativePath- The relative path of the fileerrorMessage- The reason for the failure- Returns:
- A new file descriptor acknowledgment 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
-
getRelativePath
-
setRelativePath
-
isReady
public boolean isReady() -
setReady
public void setReady(boolean ready) -
getErrorMessage
-
setErrorMessage
-