easypastry.core
Class PastryConnection
java.lang.Object
easypastry.core.PastryConnection
public class PastryConnection
- extends java.lang.Object
Field Summary |
protected java.net.InetSocketAddress |
bootaddress
|
protected rice.p2p.commonapi.Endpoint |
endpoint
|
Constructor Summary |
PastryConnection(java.lang.String bootHost,
int bootPort)
Creates a node and stablishs the connection with the network |
Method Summary |
void |
bootNode()
This method boots node previously created |
void |
close()
|
void |
createNode(java.lang.String bootHost,
int bootPort)
This method creates a new node which will serve as the underlying p2p layer |
rice.environment.Environment |
getEnvironment()
|
java.lang.String |
getHostname()
|
rice.p2p.commonapi.Node |
getNode()
|
long |
getTime()
|
boolean |
isAlive(rice.p2p.commonapi.NodeHandle nh)
|
double |
random()
Environment |
void |
sleep(long millis)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
endpoint
protected rice.p2p.commonapi.Endpoint endpoint
bootaddress
protected java.net.InetSocketAddress bootaddress
PastryConnection
public PastryConnection(java.lang.String bootHost,
int bootPort)
- Creates a node and stablishs the connection with the network
- Parameters:
String
- hostint
- port
createNode
public void createNode(java.lang.String bootHost,
int bootPort)
throws java.lang.Exception
- This method creates a new node which will serve as the underlying p2p layer
- Parameters:
args
- Constructor arguments: 0 - String bootstrap host; 1 - int bootstrap port; 2 - PastryNodeFactory factory; 3 - int protocol
- Throws:
java.lang.Exception
bootNode
public void bootNode()
throws java.lang.Exception
- This method boots node previously created
- Throws:
java.lang.Exception
getNode
public rice.p2p.commonapi.Node getNode()
isAlive
public boolean isAlive(rice.p2p.commonapi.NodeHandle nh)
getHostname
public java.lang.String getHostname()
getEnvironment
public rice.environment.Environment getEnvironment()
close
public void close()
random
public double random()
- Environment
getTime
public long getTime()
sleep
public void sleep(long millis)