|
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrice.pastry.PastryNodeFactory
rice.pastry.dist.DistPastryNodeFactory
rice.pastry.socket.CopyOfSocketPastryNodeFactory
public class CopyOfSocketPastryNodeFactory
Pastry node factory for Socket-linked nodes.
| Field Summary | |
|---|---|
static int |
ALWAYS
|
static int |
FAIL
|
protected int |
findFireWallPolicy
|
static int |
NEVER
|
static int |
OVERWRITE
|
static int |
PREFIX_MATCH
|
protected int |
testFireWallPolicy
|
static int |
USE_DIFFERENT_PORT
|
| Fields inherited from class rice.pastry.dist.DistPastryNodeFactory |
|---|
PROTOCOL_DEFAULT, PROTOCOL_SOCKET |
| Fields inherited from class rice.pastry.PastryNodeFactory |
|---|
environment, logger, lSetSize, pingCache, rtBase, rtMax |
| Constructor Summary | |
|---|---|
CopyOfSocketPastryNodeFactory(NodeIdFactory nf,
java.net.InetAddress bindAddress,
int startPort,
Environment env,
NATHandler handler)
Constructor. |
|
CopyOfSocketPastryNodeFactory(NodeIdFactory nf,
int startPort,
Environment env)
|
|
| Method Summary | |
|---|---|
protected void |
findFireWallIfNecessary()
|
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)
|
NodeHandle |
generateNodeHandle(java.net.InetSocketAddress address,
int timeout)
Way to generate a NodeHandle with a maximum timeout to receive the result. |
protected int |
getFireWallPolicyVariable(java.lang.String key)
|
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)
Non-blocking version. |
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)
|
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)
Non-blocking version. |
SourceRoute[] |
getRoutes(NodeHandle handle,
NodeHandle local)
This method returns the routes a remote node is using |
protected boolean |
localAddressIsProbablyNatted()
|
PastryNode |
newNode(Id id)
|
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 the specified nodeId (or one generated from the NodeIdFactory if not specified) |
PastryNode |
newNode(NodeHandle bootstrap,
Id nodeId,
java.net.InetSocketAddress pAddress)
Method which creates a Pastry node from the next port with the specified nodeId (or one generated from the NodeIdFactory if not specified) |
PastryNode |
newNode(NodeHandle bootstrap,
Id nodeId,
java.net.InetSocketAddress pAddress,
boolean throwException)
Method which creates a Pastry node from the next port with the specified nodeId (or one generated from the NodeIdFactory if not specified) |
PastryNode |
newNode(NodeHandle bootstrap,
java.net.InetSocketAddress proxy)
Method which creates a Pastry node from the next port with the specified nodeId (or one generated from the NodeIdFactory if not specified) |
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. |
static java.net.InetSocketAddress |
verifyConnection(int timeout,
int tries,
java.net.InetSocketAddress local,
java.net.InetSocketAddress[] existingInput,
Environment env,
Logger logger)
|
| Methods inherited from class rice.pastry.dist.DistPastryNodeFactory |
|---|
getFactory, getNodeHandle, getNodeHandle, getNodeHandle, getNodeHandle, getNodeHandle, getNodeHandle |
| Methods inherited from class rice.pastry.PastryNodeFactory |
|---|
getEnvironment, getNearest, newNode, proximity, sortedProximityCache |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ALWAYS
public static final int PREFIX_MATCH
public static final int NEVER
public static final int OVERWRITE
public static final int USE_DIFFERENT_PORT
public static final int FAIL
protected int testFireWallPolicy
protected int findFireWallPolicy
| Constructor Detail |
|---|
public CopyOfSocketPastryNodeFactory(NodeIdFactory nf,
java.net.InetAddress bindAddress,
int startPort,
Environment env,
NATHandler handler)
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
public CopyOfSocketPastryNodeFactory(NodeIdFactory nf,
int startPort,
Environment env)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public SourceRoute[] getRoutes(NodeHandle handle,
NodeHandle local)
throws java.io.IOException
handle - The node to connect to
java.io.IOException
public LeafSet getLeafSet(NodeHandle handle)
throws java.io.IOException
getLeafSet in class PastryNodeFactoryhandle - The node to connect to
java.io.IOException
public CancellableTask getLeafSet(NodeHandle handle,
Continuation c)
PastryNodeFactory
getLeafSet in class PastryNodeFactory
public RouteSet[] getRouteRow(NodeHandle handle,
int row)
throws java.io.IOException
getRouteRow in class PastryNodeFactoryhandle - The node to connect torow - The row number to retrieve
java.io.IOException
public CancellableTask getRouteRow(NodeHandle handle,
int row,
Continuation c)
PastryNodeFactory
getRouteRow in class PastryNodeFactory
public int getProximity(NodeHandle local,
NodeHandle handle)
getProximity in class PastryNodeFactoryhandle - The handle to determine the proximity oflocal - DESCRIBE THE PARAMETER
public NodeHandle generateNodeHandle(java.net.InetSocketAddress address,
int timeout)
generateNodeHandle in class DistPastryNodeFactoryaddress - 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 DistPastryNodeFactorypublic PastryNode newNode(NodeHandle bootstrap)
newNode in class DistPastryNodeFactorybootstrap - Node handle to bootstrap from.
public PastryNode newNode(NodeHandle bootstrap,
Id nodeId)
newNode in class DistPastryNodeFactorybootstrap - Node handle to bootstrap from.nodeId - if non-null, will use this nodeId for the node, rather than using the NodeIdFactory
public PastryNode newNode(NodeHandle bootstrap,
java.net.InetSocketAddress proxy)
newNode in class DistPastryNodeFactorybootstrap - Node handle to bootstrap from.
public PastryNode newNode(NodeHandle bootstrap,
Id nodeId,
java.net.InetSocketAddress pAddress)
newNode in class DistPastryNodeFactorybootstrap - Node handle to bootstrap from.nodeId - if non-null, will use this nodeId for the node, rather than using the NodeIdFactorypAddress - The address to claim that this node is at - used for proxies
behind NATs
public PastryNode newNode(NodeHandle bootstrap,
Id nodeId,
java.net.InetSocketAddress pAddress,
boolean throwException)
throws java.io.IOException
bootstrap - Node handle to bootstrap from.nodeId - if non-null, will use this nodeId for the node, rather than using the NodeIdFactorypAddress - The address to claim that this node is at - used for proxies
behind NATsthrowException - if true, the method will throw an exception if it can't fill the request, if false, it will try another port/address than specified
java.io.IOException
protected void findFireWallIfNecessary()
throws java.io.IOException
java.io.IOExceptionprotected int getFireWallPolicyVariable(java.lang.String key)
protected boolean localAddressIsProbablyNatted()
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 EXCEPTION
protected CancellableTask getResponse(java.net.InetSocketAddress address,
Message message,
Continuation c)
public static java.net.InetSocketAddress verifyConnection(int timeout,
java.net.InetSocketAddress local,
java.net.InetSocketAddress[] existing,
Environment env,
Logger logger)
throws java.io.IOException
java.io.IOException
public static java.net.InetSocketAddress verifyConnection(int timeout,
int tries,
java.net.InetSocketAddress local,
java.net.InetSocketAddress[] existingInput,
Environment env,
Logger logger)
throws java.io.IOException
java.io.IOExceptionpublic PastryNode newNode(Id id)
newNode in class PastryNodeFactory
|
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||