|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.pastry.messaging.Message rice.pastry.messaging.PRawMessage rice.pastry.socket.SourceRoute
Class which represets a source route to a remote IP address.
Field Summary | |
protected EpochInetSocketAddress[] |
path
DESCRIBE THE FIELD |
static short |
TYPE
DESCRIBE THE FIELD |
Fields inherited from class rice.pastry.messaging.Message |
DEFAULT_PRIORITY_LEVEL |
Fields inherited from interface rice.p2p.commonapi.Message |
HIGH_PRIORITY, LOW_PRIORITY, MAX_PRIORITY, MEDIUM_HIGH_PRIORITY, MEDIUM_LOW_PRIORITY, MEDIUM_PRIORITY |
Method Summary | |
SourceRoute |
append(EpochInetSocketAddress address)
Method which creates a new source route by appending the given address to the end of this one |
static SourceRoute |
build(EpochInetSocketAddress address)
Constructor. |
static SourceRoute |
build(EpochInetSocketAddress[] path)
Constructor. |
static SourceRoute |
build(InputBuffer buf)
DESCRIBE THE METHOD |
boolean |
equals(java.lang.Object o)
Checks equaltiy on source routes |
EpochInetSocketAddress |
getFirstHop()
Method which returns the first "hop" of this source route |
EpochInetSocketAddress |
getHop(int i)
Returns the hop at the given index |
EpochInetSocketAddress |
getLastHop()
Method which returns the first "hop" of this source route |
int |
getNumHops()
Returns the number of hops in this source route |
short |
getType()
Raw Serialization ************************************** |
boolean |
goesThrough(EpochInetSocketAddress address)
Returns whether or not this route goes through the given address |
int |
hashCode()
Returns the hashCode of this source route |
boolean |
isDirect()
Returns whether or not this route is direct |
SourceRoute |
prepend(EpochInetSocketAddress address)
Method which creates a new source route by appending the given address to the end of this one |
SourceRoute |
removeLastHop()
Method which creates a new source route by removing the last hop of this one |
protected static SourceRoute |
resolve(java.util.WeakHashMap map,
SourceRoute route)
Method which performs the coalescing and interaction with the weak hash map |
SourceRoute |
reverse()
Method which revereses path |
SourceRoute |
reverse(EpochInetSocketAddress localAddress)
Method which revereses path and cliams the corresponding address |
void |
serialize(OutputBuffer buf)
DESCRIBE THE METHOD |
java.net.InetSocketAddress[] |
toArray()
Internal method which returns an array representing the source route |
java.lang.String |
toString()
Internal method for computing the toString of an array of InetSocketAddresses |
java.lang.String |
toStringFull()
Internal method for computing the toString of an array of InetSocketAddresses |
Methods inherited from class rice.pastry.messaging.Message |
getDate, getDestination, getPriority, getSender, getSenderId, setPriority, setSender, stamp |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface rice.p2p.commonapi.Message |
getPriority |
Field Detail |
protected EpochInetSocketAddress[] path
public static final short TYPE
Method Detail |
public EpochInetSocketAddress getFirstHop()
public EpochInetSocketAddress getLastHop()
public int getNumHops()
public EpochInetSocketAddress getHop(int i)
i
- The hop index
public boolean isDirect()
public short getType()
getType
in interface RawMessage
public int hashCode()
public boolean equals(java.lang.Object o)
o
- The source route to compare to
public java.lang.String toString()
public java.lang.String toStringFull()
public SourceRoute reverse(EpochInetSocketAddress localAddress)
localAddress
- DESCRIBE THE PARAMETER
public SourceRoute reverse()
public boolean goesThrough(EpochInetSocketAddress address)
address
- DESCRIBE THE PARAMETER
public java.net.InetSocketAddress[] toArray()
public SourceRoute removeLastHop()
public SourceRoute append(EpochInetSocketAddress address)
address
- The address to append
public SourceRoute prepend(EpochInetSocketAddress address)
address
- The address to append
public void serialize(OutputBuffer buf) throws java.io.IOException
serialize
in interface RawMessage
buf
- DESCRIBE THE PARAMETER
java.io.IOException
- DESCRIBE THE EXCEPTIONprotected static SourceRoute resolve(java.util.WeakHashMap map, SourceRoute route)
map
- DESCRIBE THE PARAMETERroute
- DESCRIBE THE PARAMETER
public static SourceRoute build(EpochInetSocketAddress[] path)
path
- The path of the route
public static SourceRoute build(EpochInetSocketAddress address)
address
- DESCRIBE THE PARAMETER
public static SourceRoute build(InputBuffer buf) throws java.io.IOException
buf
- DESCRIBE THE PARAMETER
java.io.IOException
- DESCRIBE THE EXCEPTION
|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |