Class FileMessage
java.lang.Object
org.apache.catalina.ha.ClusterMessageBase
org.apache.catalina.ha.deploy.FileMessage
- All Implemented Interfaces:
Serializable, ClusterMessage
Contains the data for a file being transferred over TCP, this is essentially a fragment of a file, read and written
by the FileMessageFactory.
- See Also:
-
Field Summary
Fields inherited from class ClusterMessageBase
address -
Constructor Summary
ConstructorsConstructorDescriptionFileMessage(Member source, String fileName, String contextName) Creates a new FileMessage for transferring a file. -
Method Summary
Modifier and TypeMethodDescriptionReturns the context name associated with this file transfer.byte[]getData()Returns the data payload of this message.intReturns the length of the valid data in the data array.Returns the name of the file being transferred.intReturns the message number within the file transfer sequence.longReturns the total number of messages in the file transfer.Returns the unique identifier for this message.voidsetData(byte[] data, int length) Sets the data payload and its length for this message.voidsetMessageNumber(int messageNumber) Sets the message number within the file transfer sequence.voidsetTotalNrOfMsgs(long totalNrOfMsgs) Sets the total number of messages in the file transfer.Methods inherited from class ClusterMessageBase
getAddress, getTimestamp, setAddress, setTimestamp
-
Constructor Details
-
FileMessage
Creates a new FileMessage for transferring a file.- Parameters:
source- The member that is the source of this messagefileName- The name of the file being transferredcontextName- The name of the context associated with this file
-
-
Method Details
-
getMessageNumber
public int getMessageNumber()Returns the message number within the file transfer sequence.- Returns:
- The message number
-
setMessageNumber
public void setMessageNumber(int messageNumber) Sets the message number within the file transfer sequence.- Parameters:
messageNumber- The message number
-
getTotalNrOfMsgs
public long getTotalNrOfMsgs()Returns the total number of messages in the file transfer.- Returns:
- The total number of messages
-
setTotalNrOfMsgs
public void setTotalNrOfMsgs(long totalNrOfMsgs) Sets the total number of messages in the file transfer.- Parameters:
totalNrOfMsgs- The total number of messages
-
getData
public byte[] getData()Returns the data payload of this message.- Returns:
- The data byte array
-
setData
public void setData(byte[] data, int length) Sets the data payload and its length for this message.- Parameters:
data- The data byte arraylength- The length of valid data in the array
-
getDataLength
public int getDataLength()Returns the length of the valid data in the data array.- Returns:
- The data length
-
getUniqueId
Description copied from interface:ClusterMessageReturns the unique identifier for this message.- Returns:
- the unique ID
-
getFileName
-
getContextName
Returns the context name associated with this file transfer.- Returns:
- The context name
-