|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.p2psockets.P2PNetwork
This class signs us into the JXTA network. It is meant to model the JXTA network as a whole. By default, we re-profile this peer every time it starts up using the JXTA Profiler. To turn off this behavior, call the signin() method with the fourth boolean argument set to false to indicate not to peform profiling. Threading: the entire object is locked if any methods are called to mediate access to the netPeerGroup. We are assuming net.jxta.peergroup.PeerGroup is thread-safe.
Field Summary | |
static java.lang.String |
JXTA_HOME
The system property name that specifies where to find the Jxta configuration files. |
static java.lang.String |
JXTA_PASSWORD
The system property name for the password of this Jxta peer. |
static java.lang.String |
JXTA_USERNAME
The system property name for the username of this Jxta peer. |
static java.lang.String |
P2PSOCKETS_NETWORK
The system property name for setting the P2P network to sign into and initialize. |
Constructor Summary | |
P2PNetwork()
|
Method Summary | |
static boolean |
accountExists(java.lang.String userName)
Determines if an account exists for the given username. |
protected static void |
contactRendezVous(net.jxta.peergroup.PeerGroup inGroup)
|
static void |
createAccount()
Removes any old JXTA account and creates a new one, profiling the peer and signing them into the JXTA network. |
static void |
createAccount(java.lang.String userName,
java.lang.String password)
Removes any old JXTA account and creates a new one, profiling the peer and signing them into the JXTA network. |
static void |
createAccount(java.lang.String userName,
java.lang.String password,
java.lang.String appName)
Removes any old JXTA account and creates a new one, profiling the peer and signing them into the JXTA network. |
static java.lang.String |
getApplicationName()
|
static net.jxta.peergroup.PeerGroup |
getNetPeerGroup()
|
static void |
setApplicationName(java.lang.String appName)
|
static void |
signin()
|
static void |
signin(java.lang.String userName,
java.lang.String password)
|
static void |
signin(java.lang.String userName,
java.lang.String password,
java.lang.String appName)
|
static void |
signin(java.lang.String userName,
java.lang.String password,
java.lang.String appName,
boolean createIfNotExist)
|
static void |
signOff()
Signs us out of the P2P network. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String P2PSOCKETS_NETWORK
public static java.lang.String JXTA_USERNAME
public static java.lang.String JXTA_PASSWORD
public static java.lang.String JXTA_HOME
Constructor Detail |
public P2PNetwork()
Method Detail |
public static boolean accountExists(java.lang.String userName) throws java.lang.Exception
java.lang.Exception
public static void createAccount() throws java.lang.Exception
java.lang.Exception
public static void createAccount(java.lang.String userName, java.lang.String password) throws java.lang.Exception
java.lang.Exception
public static void createAccount(java.lang.String userName, java.lang.String password, java.lang.String appName) throws java.lang.Exception
java.lang.Exception
public static void signin() throws java.lang.Exception
java.lang.Exception
public static void signin(java.lang.String userName, java.lang.String password) throws java.lang.Exception
java.lang.Exception
public static void signin(java.lang.String userName, java.lang.String password, java.lang.String appName) throws java.lang.Exception
java.lang.Exception
public static void signin(java.lang.String userName, java.lang.String password, java.lang.String appName, boolean createIfNotExist) throws java.lang.Exception
userName
- The username to use for signing in.password
- The password to use for signing in.appName
- A unique string identifying your application.createIfNotExist
- Whether to create this account if it doesn't exist.
java.lang.Exception
public static void signOff() throws java.lang.Exception
java.lang.Exception
public static net.jxta.peergroup.PeerGroup getNetPeerGroup()
public static void setApplicationName(java.lang.String appName)
public static java.lang.String getApplicationName()
protected static void contactRendezVous(net.jxta.peergroup.PeerGroup inGroup) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |