|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.pastry.PastryNodeFactory rice.pastry.dist.DistPastryNodeFactory rice.pastry.socket.SocketPastryNodeFactory
Pastry node factory for Socket-linked nodes.
Field Summary | |
static byte[] |
TOTAL_HEADER
DESCRIBE THE FIELD |
Fields inherited from class rice.pastry.dist.DistPastryNodeFactory |
PROTOCOL_DEFAULT, PROTOCOL_SOCKET |
Fields inherited from class rice.pastry.PastryNodeFactory |
logger, lSetSize, pingCache, rtBase, rtMax |
Constructor Summary | |
SocketPastryNodeFactory(NodeIdFactory nf,
java.net.InetAddress bindAddress,
int startPort,
Environment env)
Constructor. |
|
SocketPastryNodeFactory(NodeIdFactory nf,
int startPort,
Environment env)
Constructor for SocketPastryNodeFactory. |
Method Summary | |
NodeHandle |
generateNodeHandle(java.net.InetSocketAddress address)
Method which contructs a node handle (using the socket protocol) for the node at address NodeHandle. |
CancellableTask |
generateNodeHandle(java.net.InetSocketAddress address,
Continuation c)
DESCRIBE THE METHOD |
NodeHandle |
generateNodeHandle(java.net.InetSocketAddress address,
int timeout)
Way to generate a NodeHandle with a maximum timeout to receive the result. |
LeafSet |
getLeafSet(NodeHandle handle)
This method returns the remote leafset of the provided handle to the caller, in a protocol-dependent fashion. |
CancellableTask |
getLeafSet(NodeHandle handle,
Continuation c)
Gets the LeafSet attribute of the SocketPastryNodeFactory object |
int |
getProximity(NodeHandle local,
NodeHandle handle)
This method determines and returns the proximity of the current local node to the provided NodeHandle. |
protected Message |
getResponse(java.net.InetSocketAddress address,
Message message)
This method anonymously sends the given message to the remote address, blocks until a response is received, and then closes the socket and returns the response. |
protected CancellableTask |
getResponse(java.net.InetSocketAddress address,
Message message,
Continuation c)
Gets the Response attribute of the SocketPastryNodeFactory object |
RouteSet[] |
getRouteRow(NodeHandle handle,
int row)
This method returns the remote route row of the provided handle to the caller, in a protocol-dependent fashion. |
CancellableTask |
getRouteRow(NodeHandle handle,
int row,
Continuation c)
Gets the RouteRow attribute of the SocketPastryNodeFactory object |
SourceRoute[] |
getRoutes(NodeHandle handle,
NodeHandle local)
This method returns the routes a remote node is using |
PastryNode |
newNode(NodeHandle bootstrap)
Method which creates a Pastry node from the next port with a randomly generated NodeId. |
PastryNode |
newNode(NodeHandle bootstrap,
Id nodeId)
Method which creates a Pastry node from the next port with a randomly generated NodeId. |
PastryNode |
newNode(NodeHandle bootstrap,
Id nodeId,
java.net.InetSocketAddress pAddress)
Method which creates a Pastry node from the next port with a randomly generated NodeId. |
PastryNode |
newNode(NodeHandle bootstrap,
Id nodeId,
java.net.InetSocketAddress pAddress,
boolean throwException)
DESCRIBE THE METHOD |
PastryNode |
newNode(NodeHandle bootstrap,
java.net.InetSocketAddress proxy)
Method which creates a Pastry node from the next port with a randomly generated NodeId. |
static java.net.InetSocketAddress |
verifyConnection(int timeout,
java.net.InetSocketAddress local,
java.net.InetSocketAddress[] existing,
Environment env,
Logger logger)
Method which can be used to test the connectivity contstrains of the local node. |
Methods inherited from class rice.pastry.dist.DistPastryNodeFactory |
getFactory, getNodeHandle, getNodeHandle, getNodeHandle, getNodeHandle, getNodeHandle, getNodeHandle |
Methods inherited from class rice.pastry.PastryNodeFactory |
getEnvironment, getNearest, proximity |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static byte[] TOTAL_HEADER
Constructor Detail |
public SocketPastryNodeFactory(NodeIdFactory nf, java.net.InetAddress bindAddress, int startPort, Environment env) throws java.io.IOException
nf
- The factory for building node idsbindAddress
- which address to bind tostartPort
- The port to start creating nodes onenv
- The environment.
java.io.IOException
- DESCRIBE THE EXCEPTIONpublic SocketPastryNodeFactory(NodeIdFactory nf, int startPort, Environment env) throws java.io.IOException
nf
- DESCRIBE THE PARAMETERstartPort
- DESCRIBE THE PARAMETERenv
- DESCRIBE THE PARAMETER
java.io.IOException
- DESCRIBE THE EXCEPTIONMethod Detail |
public SourceRoute[] getRoutes(NodeHandle handle, NodeHandle local) throws java.io.IOException
handle
- The node to connect tolocal
- DESCRIBE THE PARAMETER
java.io.IOException
- DESCRIBE THE EXCEPTIONpublic LeafSet getLeafSet(NodeHandle handle) throws java.io.IOException
getLeafSet
in class PastryNodeFactory
handle
- The node to connect to
java.io.IOException
- DESCRIBE THE EXCEPTIONpublic CancellableTask getLeafSet(NodeHandle handle, Continuation c)
getLeafSet
in class PastryNodeFactory
handle
- DESCRIBE THE PARAMETERc
- DESCRIBE THE PARAMETER
public RouteSet[] getRouteRow(NodeHandle handle, int row) throws java.io.IOException
getRouteRow
in class PastryNodeFactory
handle
- The node to connect torow
- The row number to retrieve
java.io.IOException
- DESCRIBE THE EXCEPTIONpublic CancellableTask getRouteRow(NodeHandle handle, int row, Continuation c)
getRouteRow
in class PastryNodeFactory
handle
- DESCRIBE THE PARAMETERrow
- DESCRIBE THE PARAMETERc
- DESCRIBE THE PARAMETER
public int getProximity(NodeHandle local, NodeHandle handle)
getProximity
in class PastryNodeFactory
handle
- The handle to determine the proximity oflocal
- DESCRIBE THE PARAMETER
protected Message getResponse(java.net.InetSocketAddress address, Message message) throws java.io.IOException
address
- The address to send tomessage
- The message to send
java.io.IOException
- DESCRIBE THE EXCEPTIONprotected CancellableTask getResponse(java.net.InetSocketAddress address, Message message, Continuation c)
address
- DESCRIBE THE PARAMETERmessage
- DESCRIBE THE PARAMETERc
- DESCRIBE THE PARAMETER
public NodeHandle generateNodeHandle(java.net.InetSocketAddress address, int timeout)
generateNodeHandle
in class DistPastryNodeFactory
address
- timeout
- maximum time in millis to return the result. <= 0 will use
the blocking version.
public NodeHandle generateNodeHandle(java.net.InetSocketAddress address)
address
- The address of the remote node.
public CancellableTask generateNodeHandle(java.net.InetSocketAddress address, Continuation c)
generateNodeHandle
in class DistPastryNodeFactory
address
- DESCRIBE THE PARAMETERc
- DESCRIBE THE PARAMETER
public PastryNode newNode(NodeHandle bootstrap)
newNode
in class DistPastryNodeFactory
bootstrap
- Node handle to bootstrap from.
public PastryNode newNode(NodeHandle bootstrap, Id nodeId)
newNode
in class DistPastryNodeFactory
bootstrap
- Node handle to bootstrap from.nodeId
- DESCRIBE THE PARAMETER
public PastryNode newNode(NodeHandle bootstrap, java.net.InetSocketAddress proxy)
newNode
in class DistPastryNodeFactory
bootstrap
- Node handle to bootstrap from.proxy
- DESCRIBE THE PARAMETER
public PastryNode newNode(NodeHandle bootstrap, Id nodeId, java.net.InetSocketAddress pAddress)
newNode
in class DistPastryNodeFactory
bootstrap
- Node handle to bootstrap from.nodeId
- DESCRIBE THE PARAMETERpAddress
- DESCRIBE THE PARAMETER
public PastryNode newNode(NodeHandle bootstrap, Id nodeId, java.net.InetSocketAddress pAddress, boolean throwException) throws java.io.IOException
bootstrap
- DESCRIBE THE PARAMETERnodeId
- DESCRIBE THE PARAMETERpAddress
- DESCRIBE THE PARAMETERthrowException
- DESCRIBE THE PARAMETER
java.io.IOException
- DESCRIBE THE EXCEPTIONpublic static java.net.InetSocketAddress verifyConnection(int timeout, java.net.InetSocketAddress local, java.net.InetSocketAddress[] existing, Environment env, Logger logger) throws java.io.IOException
timeout
- DESCRIBE THE PARAMETERlocal
- DESCRIBE THE PARAMETERexisting
- DESCRIBE THE PARAMETERenv
- DESCRIBE THE PARAMETERlogger
- 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 |