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


Field Summary
protected  GUID guid
           
protected  byte hops
           
protected  Connection originatingConnection
           
protected  short[] payload
           
protected  int payloadSize
           
static int SIZE
           
protected  byte ttl
           
protected  short type
           
 
Constructor Summary
PushMessage(SearchReplyMessage searchReplyMessage, int fileIndex, java.lang.String ipAddress, short port)
          Construct a PushMessage using a previously received SearchReplyMessage.
 
Method Summary
 GUID getClientIdentifier()
          Retrieve the client GUID targeted by this push request
 int getFileIndex()
          Retrieve the index of the file to push
 java.lang.String getIPAddress()
          Get the IP Address to push to
 Connection getOriginatingConnection()
          Get the connection that was the source for this message
 short getPort()
          Get the port the connection should use
 java.lang.String toRawString()
          Returns a String containing the flattened message
 java.lang.String toString()
          String representation of the message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

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 push
fileIndex - index of file (from FileRecord) to push
ipAddress - for push transfer
port - port for push transfer
Method Detail

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