Package org.apache.catalina.ha.deploy
Class FileMessage
- java.lang.Object
-
- org.apache.catalina.ha.ClusterMessageBase
-
- org.apache.catalina.ha.deploy.FileMessage
-
- All Implemented Interfaces:
java.io.Serializable,ClusterMessage
public class FileMessage extends ClusterMessageBase
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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.catalina.ha.ClusterMessageBase
address
-
-
Constructor Summary
Constructors Constructor Description FileMessage(Member source, java.lang.String fileName, java.lang.String contextName)Creates a new FileMessage for transferring a file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetContextName()Returns the context name associated with this file transfer.byte[]getData()Returns the data payload of this message.intgetDataLength()Returns the length of the valid data in the data array.java.lang.StringgetFileName()Returns the name of the file being transferred.intgetMessageNumber()Returns the message number within the file transfer sequence.longgetTotalNrOfMsgs()Returns the total number of messages in the file transfer.java.lang.StringgetUniqueId()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 org.apache.catalina.ha.ClusterMessageBase
getAddress, getTimestamp, setAddress, setTimestamp
-
-
-
-
Constructor Detail
-
FileMessage
public FileMessage(Member source, java.lang.String fileName, java.lang.String contextName)
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 Detail
-
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
public java.lang.String getUniqueId()
Description copied from interface:ClusterMessageReturns the unique identifier for this message.- Returns:
- the unique ID
-
getFileName
public java.lang.String getFileName()
Returns the name of the file being transferred.- Returns:
- The file name
-
getContextName
public java.lang.String getContextName()
Returns the context name associated with this file transfer.- Returns:
- The context name
-
-