com.kenmccrary.jtella
Class PushMessage
java.lang.Object
|
+--com.kenmccrary.jtella.Message
|
+--com.kenmccrary.jtella.PushMessage
- public class PushMessage
- extends com.kenmccrary.jtella.Message
Push message, represents a request to push a file to a receiving node
Constructor Summary |
PushMessage(SearchReplyMessage searchReplyMessage,
int fileIndex,
java.lang.String ipAddress,
short port)
Construct a PushMessage using a previously received SearchReplyMessage. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SIZE
public static final int SIZE
originatingConnection
protected Connection originatingConnection
guid
protected GUID guid
type
protected short type
ttl
protected byte ttl
hops
protected byte hops
payload
protected short[] payload
payloadSize
protected int payloadSize
PushMessage
public PushMessage(SearchReplyMessage searchReplyMessage,
int fileIndex,
java.lang.String ipAddress,
short port)
- Construct a PushMessage using a previously received SearchReplyMessage.
- Parameters:
searchReplyMessage
- search reply containing file to pushfileIndex
- index of file (from FileRecord) to pushipAddress
- for push transferport
- port for push transfer
getClientIdentifier
public GUID getClientIdentifier()
- Retrieve the client GUID targeted by this push request
- Returns:
- client GUID
getFileIndex
public int getFileIndex()
- Retrieve the index of the file to push
- Returns:
- file index
getIPAddress
public java.lang.String getIPAddress()
- Get the IP Address to push to
- Returns:
- IP address
getPort
public short getPort()
- Get the port the connection should use
- Returns:
- port
toString
public java.lang.String toString()
- String representation of the message
- Overrides:
toString
in class java.lang.Object
toRawString
public java.lang.String toRawString()
- Returns a String containing the flattened message
- Returns:
- message string
getOriginatingConnection
public Connection getOriginatingConnection()
- Get the connection that was the source for this message
- Returns:
- originating connection or null if this
Message
was
not read from the network