|
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
An abstraction of the nodeId factory for distributed nodes. In order to obtain a nodeId factory, a client should use the getFactory method, passing in either PROTOCOL_RMI or PROTOCOL_WIRE as the protocol, and the port number the factory should use. In the wire protocol, the port number is the starting port number that the nodes are constructed on, and in the rmi protocol, the port number is the location of the local RMI registry.
Field Summary | |
static int |
PROTOCOL_DEFAULT
DESCRIBE THE FIELD |
static int |
PROTOCOL_SOCKET
DESCRIBE THE FIELD |
Fields inherited from class rice.pastry.PastryNodeFactory |
environment, logger, lSetSize, pingCache, rtBase, rtMax |
Constructor Summary | |
protected |
DistPastryNodeFactory(Environment env)
Constructor. |
Method Summary | |
abstract CancellableTask |
generateNodeHandle(java.net.InetSocketAddress address,
Continuation c)
DESCRIBE THE METHOD |
abstract NodeHandle |
generateNodeHandle(java.net.InetSocketAddress address,
int timeout)
Method which all subclasses should implement allowing the client to generate a node handle given the address of a node. |
static DistPastryNodeFactory |
getFactory(NodeIdFactory nf,
int protocol,
int port,
Environment env)
Static method which is designed to be used by clients needing a distrubuted pastry node factory. |
NodeHandle |
getNodeHandle(java.net.InetSocketAddress address)
Method which a client should use in order to get a bootstrap node from the factory. |
NodeHandle |
getNodeHandle(java.net.InetSocketAddress[] addresses)
Method which a client should use in order to get a bootstrap node from the factory. |
CancellableTask |
getNodeHandle(java.net.InetSocketAddress[] addresses,
Continuation c)
Gets the NodeHandle attribute of the DistPastryNodeFactory object |
NodeHandle |
getNodeHandle(java.net.InetSocketAddress[] addresses,
int timeoutMillis)
Gets the NodeHandle attribute of the DistPastryNodeFactory object |
CancellableTask |
getNodeHandle(java.net.InetSocketAddress address,
Continuation c)
Gets the NodeHandle attribute of the DistPastryNodeFactory object |
NodeHandle |
getNodeHandle(java.net.InetSocketAddress address,
int timeout)
Gets the NodeHandle attribute of the DistPastryNodeFactory object |
abstract PastryNode |
newNode(NodeHandle bootstrap)
Generates a new pastry node with a random NodeId using the bootstrap bootstrap. |
abstract PastryNode |
newNode(NodeHandle bootstrap,
Id nodeId)
Generates a new pastry node with the specified NodeId using the bootstrap bootstrap. |
abstract PastryNode |
newNode(NodeHandle bootstrap,
Id nodeId,
java.net.InetSocketAddress proxy)
Generates a new pastry node with the specified NodeId using the bootstrap bootstrap. |
abstract PastryNode |
newNode(NodeHandle bootstrap,
java.net.InetSocketAddress proxy)
Generates a new pastry node with the specified NodeId using the bootstrap bootstrap. |
Methods inherited from class rice.pastry.PastryNodeFactory |
getEnvironment, getLeafSet, getLeafSet, getNearest, getProximity, getRouteRow, getRouteRow, proximity |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int PROTOCOL_SOCKET
public static int PROTOCOL_DEFAULT
Constructor Detail |
protected DistPastryNodeFactory(Environment env)
env
- DESCRIBE THE PARAMETERMethod Detail |
public final NodeHandle getNodeHandle(java.net.InetSocketAddress address)
address
- The address of the remote node.
public final NodeHandle getNodeHandle(java.net.InetSocketAddress address, int timeout)
address
- DESCRIBE THE PARAMETERtimeout
- DESCRIBE THE PARAMETER
public final CancellableTask getNodeHandle(java.net.InetSocketAddress address, Continuation c)
address
- DESCRIBE THE PARAMETERc
- DESCRIBE THE PARAMETER
public final NodeHandle getNodeHandle(java.net.InetSocketAddress[] addresses)
addresses
- DESCRIBE THE PARAMETER
public final NodeHandle getNodeHandle(java.net.InetSocketAddress[] addresses, int timeoutMillis)
addresses
- DESCRIBE THE PARAMETERtimeoutMillis
- DESCRIBE THE PARAMETER
public final CancellableTask getNodeHandle(java.net.InetSocketAddress[] addresses, Continuation c)
addresses
- DESCRIBE THE PARAMETERc
- DESCRIBE THE PARAMETER
public abstract NodeHandle generateNodeHandle(java.net.InetSocketAddress address, int timeout)
address
- DESCRIBE THE PARAMETERtimeout
- maximum time in milliseconds to return the result
public abstract CancellableTask generateNodeHandle(java.net.InetSocketAddress address, Continuation c)
address
- DESCRIBE THE PARAMETERc
- DESCRIBE THE PARAMETER
public abstract PastryNode newNode(NodeHandle bootstrap)
newNode
in class PastryNodeFactory
bootstrap
- Node handle to bootstrap from.
public abstract PastryNode newNode(NodeHandle bootstrap, Id nodeId)
newNode
in class PastryNodeFactory
bootstrap
- Node handle to bootstrap from.nodeId
- DESCRIBE THE PARAMETER
public abstract PastryNode newNode(NodeHandle bootstrap, Id nodeId, java.net.InetSocketAddress proxy)
bootstrap
- Node handle to bootstrap from.nodeId
- DESCRIBE THE PARAMETERproxy
- DESCRIBE THE PARAMETER
public abstract PastryNode newNode(NodeHandle bootstrap, java.net.InetSocketAddress proxy)
bootstrap
- Node handle to bootstrap from.proxy
- DESCRIBE THE PARAMETER
public static DistPastryNodeFactory getFactory(NodeIdFactory nf, int protocol, int port, Environment env) throws java.io.IOException
protocol
- The protocol to use (PROTOCOL_RMI or PROTOCOL_WIRE)port
- The RMI registry port if RMI, or the starting port if wire.nf
- DESCRIBE THE PARAMETERenv
- DESCRIBE THE PARAMETER
java.io.IOException
- DESCRIBE THE EXCEPTION
java.lang.IllegalArgumentException
- If protocol is an unsupported port.
|
Rice Pastry API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |