|
ANTS v2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ants.core.Node
The per-flow Node interface.
An instance of Node is created in the context of each Application and protocol.
PrimordialNode
,
AppBooster
,
ProtocolBooster
Method Summary | |
void |
arraycopy(java.lang.Object src,
int src_position,
java.lang.Object dst,
int dst_position,
int length)
|
static Node |
currentNode()
Return the Node interface associated with the current flow. |
static Principal |
currentPrincipal()
|
boolean |
deliverToApp(Capsule cap,
int port)
Deliver the given capsule to the Application on the given port number. |
int |
getAddress()
Return the logical 32-bit IP-like "active" address for this Node. |
NodeCache |
getCache()
|
NeighborTable |
getNeighborTable()
|
Principal |
getPrincipal()
Return the security principal associated with this node |
RouteTable |
getRouteTable()
|
double |
getStat(int index)
|
java.lang.String |
getVisibleAddressSpec()
Get the address spec that remote nodes can use to communicate with this node. |
java.lang.String |
getVisibleProtocolSpec()
Get the protocol spec that remote nodes can use to communicate with this node. |
java.lang.String |
hostname()
Return the string name of the host machine. |
void |
log(int level,
java.lang.String msg)
Log a message to this Node's "console". |
void |
log(int level,
java.lang.Throwable exception)
Log an exception. |
void |
logStackTrace(int level,
java.lang.Throwable exception)
Log an exception. |
void |
register(Protocol p)
Just calls register(Protocol,Principal)
with a default Principal (SecuirtyDefaults.REMOTE_USERS). |
void |
register(Protocol protocol,
Principal principal)
Called by applications that want to instantiate a locally originiating protocol. |
boolean |
routeForNode(Capsule cap,
int destination)
Route a capsule for a particular destination. |
boolean |
send(Capsule cap)
Inject a given capsule into the network via the local node. |
boolean |
sendToNeighbor(Capsule cap,
int neighbor)
Send a capsule to an adjacent node. |
void |
setAddress(int a)
Set the logical 32-bit address for this (and every) node This method assumes synchronization is provided elsewhere if this is necessary. |
void |
shutdown()
Shutdown this Node. |
void |
sleep(long millis)
Have the calling thread sleep for at least the given number of milliseconds. |
void |
threadStart(java.lang.Runnable r)
|
void |
threadStart(java.lang.Runnable r,
java.lang.String threadName)
Start a new thread executing the given Runnable. |
long |
time()
Return the current time in milliseconds. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Method Detail |
public Principal getPrincipal()
Principal
public int getAddress()
public void setAddress(int a)
public java.lang.String getVisibleProtocolSpec()
PrimordialNode#getVisibleProtocolSpec()
public java.lang.String getVisibleAddressSpec()
PrimordialNode#getVisibleProtocolSpec()
public static Node currentNode()
XXX This method is a hack and would go away if one were to re-write the basic ANTS interfaces. The "current node" should be an explicit paramter to those functions that need it.
public static final Principal currentPrincipal()
public void register(Protocol p)
register(Protocol,Principal)
with a default Principal (SecuirtyDefaults.REMOTE_USERS).SecuirtyDefaults.REMOTE_USERS
,
register(Protocol,Principal)
public void register(Protocol protocol, Principal principal)
public boolean deliverToApp(Capsule cap, int port)
public boolean send(Capsule cap)
public void threadStart(java.lang.Runnable r)
threadStart(java.lang.Runnable,String)
public void threadStart(java.lang.Runnable r, java.lang.String threadName)
public boolean routeForNode(Capsule cap, int destination)
public boolean sendToNeighbor(Capsule cap, int neighbor)
Note that an association between the neighbor's logical address and a physical address must have been established and installed in the PrimoridalNode's neighborTable.
Note that because the capsules sent this way are used for bootstrapping, they have no source address. This routine inserts "255.255.255.255" as the source addr, and fixes the TTL at 3. Because of this, this routine should only be used by privilged bootstrap protocols.
cap
- the capsule to send. Will be encoded and launched
just like any other capsule.neighbor
- the logical address of the neighbor node.PrimordialNode#neighborTable
,
PrimordialNode#loadRouteTableImpl(int,boolean,String)
public NodeCache getCache()
public void sleep(long millis) throws java.lang.InterruptedException
millis
- how long to sleep for, in milliseconds.public void shutdown()
Interface for shutting down the entire node isn't (yet) visible.
PrimordialNode#shutdown()
public java.lang.String hostname()
public long time()
public void log(int level, java.lang.String msg)
edu.utah.janos.io.Log
class for this parameterlevel
- the severity/priority of the log messagemsg
- the string message#logger
,
Log
public void log(int level, java.lang.Throwable exception)
XXX redundant with logStackTrace(int,Throwable)
log(int,String)
public void logStackTrace(int level, java.lang.Throwable exception)
XXX redundant with log(int,Throwable)
log(int,Throwable)
public RouteTable getRouteTable()
public NeighborTable getNeighborTable()
public double getStat(int index)
index
- The statistic to retrieve, the value should be one of
the NodeStat constants.public void arraycopy(java.lang.Object src, int src_position, java.lang.Object dst, int dst_position, int length)
public java.lang.String toString()
|
ANTS v2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |