|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.platform.NetworkManager
public class NetworkManager
NetworkManager provides a simplified JXTA platform configuration abstraction, and provides a JXTA platform life-cycle management. The node configuration is created during construction of this object and can be obtained for fine tuning or alteration. Note that all alterations must be done prior to calling #startNetwork(), otherwise the default configuration is used. Configuration persistence is on by default and maybe overridden by call to #setEnableConfigPersistence
NetworkManager defines six abstractions of a node configurations as follows : ADHOC : A node which typically deployed in an ad-hoc network EDGE : In addition to supporting ADHOC function, an Edge node can attach to a infrastructure (a Rendezvous, Relay, or both) RENDEZVOUS: provides network bootstrapping services, such as discovery, pipe resolution, etc. RELAY: provides message relaying services, enabling cross firewall traversal PROXY: provide JXME JXTA for J2ME proxying services SUPER: provide the functionality of a Rendezvous, Relay, Proxy node.
Nested Class Summary | |
---|---|
static class |
NetworkManager.ConfigMode
Define node standard node operating modes |
Field Summary | |
---|---|
protected URI |
publicSeedingRdvURI
|
protected URI |
publicSeedingRelayURI
|
Constructor Summary | |
---|---|
NetworkManager(NetworkManager.ConfigMode mode,
String instanceName)
Creates NetworkManger instance with default instance home set to "$CWD"/.jxta" At this point, alternate Infrastructure PeerGroupID maybe specified, as well as a PeerID. if neither are specified, the default NetPeerGroupID will be used, and a new PeerID will be generated. |
|
NetworkManager(NetworkManager.ConfigMode mode,
String instanceName,
URI instanceHome)
Creates NetworkManger instance. |
Method Summary | |
---|---|
NetworkConfigurator |
getConfigurator()
Returns the NetworkConfigurator for additional tuning |
PeerGroupID |
getInfrastructureID()
Getter for property 'infrastructureID'. |
URI |
getInstanceHome()
Getter for property 'instanceHome'. |
String |
getInstanceName()
Getter for property 'instanceName'. |
NetworkManager.ConfigMode |
getMode()
Getter for property node operating 'mode'. |
PeerGroup |
getNetPeerGroup()
Gets the netPeerGroup object |
PeerID |
getPeerID()
Getter for property 'peerID'. |
boolean |
getUseDefaultSeeds()
Returns true if useDefaultSeeds is set to true |
boolean |
isConfigPersistent()
Getter for property 'configPersistent'. |
static void |
login(PeerGroup group,
char[] keystore_password,
char[] principal_password)
Establishes group credential. |
void |
registerShutdownHook()
Registers a Runtime shutdown hook to cleanly shutdown the JXTA platform |
void |
rendezvousEvent(RendezvousEvent event)
rendezvousEvent the rendezvous event |
void |
setConfigPersistent(boolean persisted)
Setter for property 'configPersistent'. if disabled a PlatformConfig is not persisted. |
void |
setInfrastructureID(PeerGroupID infrastructureID)
Setter for property 'infrastructureID'. |
void |
setInstanceHome(URI instanceHome)
Setter for property 'instanceHome'. |
void |
setInstanceName(String instanceName)
Setter for property 'instanceName'. |
void |
setMode(NetworkManager.ConfigMode mode)
Setter for property 'mode'. |
void |
setPeerID(PeerID peerID)
Setter for property 'peerID'. |
void |
setUseDefaultSeeds(boolean useDefaultSeeds)
if true uses the public rendezvous seeding service |
PeerGroup |
startNetwork()
Creates and starts the JXTA infrastructure peer group (aka NetPeerGroup) based on the specified mode template. |
void |
stopNetwork()
Stops and unreferences the NetPeerGroup |
void |
unregisterShutdownHook()
Unregisters a Runtime shutdown hook to cleanly shutdown the JXTA platform |
boolean |
waitForRendezvousConnection(long timeout)
Blocks only, if not connected to a rendezvous, or until a connection to rendezvous node occurs. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final transient URI publicSeedingRdvURI
protected final transient URI publicSeedingRelayURI
Constructor Detail |
---|
public NetworkManager(NetworkManager.ConfigMode mode, String instanceName) throws IOException
startNetwork()
mode
- Operating mode the node operating NetworkManager.ConfigMode
instanceName
- Node name
IOException
- if an io error occurspublic NetworkManager(NetworkManager.ConfigMode mode, String instanceName, URI instanceHome) throws IOException
startNetwork()
mode
- Operating mode the node operating NetworkManager.ConfigMode
instanceName
- Node nameinstanceHome
- instance home is a uri to the instance persistent store (aka Cache Manager store home)
IOException
- if an io error occursMethod Detail |
---|
public NetworkConfigurator getConfigurator() throws IOException
NetworkConfigurator
for additional tuning
NetworkConfigurator
for additional tuning
IOException
- if an io error occurspublic PeerGroupID getInfrastructureID()
public void setInfrastructureID(PeerGroupID infrastructureID)
infrastructureID
- Value to set for property 'infrastructureID'.public String getInstanceName()
public void setInstanceName(String instanceName)
instanceName
- Value to set for property 'instanceName'.public URI getInstanceHome()
public void setInstanceHome(URI instanceHome)
instanceHome
- Value to set for property 'instanceHome'.public NetworkManager.ConfigMode getMode()
public void setMode(NetworkManager.ConfigMode mode) throws IOException
mode
- Value to set for property 'mode'.
IOException
- if an io error occurspublic PeerID getPeerID()
public void setPeerID(PeerID peerID)
peerID
- Value to set for property 'peerID'.public boolean isConfigPersistent()
public void setConfigPersistent(boolean persisted)
persisted
- Value to set for property 'configPersistent'.public PeerGroup startNetwork() throws PeerGroupException, IOException
PeerGroupException
- if the group fails to initialize
IOException
- if an io error occurspublic static void login(PeerGroup group, char[] keystore_password, char[] principal_password) throws PeerGroupException, ProtocolNotSupportedException
group
- peer group to establish credentials inkeystore_password
- The passphrase for the keystore. This is a
char[] rather than a String so that it can be blanked after use.principal_password
- The passphrase for the identity. This is a
char[] rather than a String so that it can be blanked after use.
PeerGroupException
- if group credentials were rejected
ProtocolNotSupportedException
- if authenticator rejected the credentialpublic void stopNetwork()
public PeerGroup getNetPeerGroup()
public boolean waitForRendezvousConnection(long timeout)
timeout
- timeout in milliseconds, a zero timeout of waits forever
public void rendezvousEvent(RendezvousEvent event)
rendezvousEvent
in interface RendezvousListener
event
- rendezvousEventpublic void setUseDefaultSeeds(boolean useDefaultSeeds)
useDefaultSeeds
- if true uses the default development seeding servicepublic boolean getUseDefaultSeeds()
public void registerShutdownHook()
public void unregisterShutdownHook()
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |