|
JXTA | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.jxta.instantp2p.PeerGroupApp
Constructor Summary | |
PeerGroupApp()
|
Method Summary | |
void |
addGroup(net.jxta.protocol.PeerGroupAdvertisement groupAdv)
Adds the PeerGroupAdvertisement to the list of discovered Groups in the PeerGroup |
void |
addPeer(net.jxta.protocol.PeerGroupAdvertisement peerAdv)
Adds the PeerGroupAdvertisement to the list of discovered Peers in the PeerGroup |
void |
checkDiscoverResults()
check results of discovery request |
net.jxta.protocol.PipeAdvertisement |
createPipeAdvertisement()
creates a new PipeAdvertisment |
net.jxta.protocol.PeerGroupAdvertisement |
getAdvertisement()
Returns the PeerGroupAdvertisement for this PeerGroupApp |
java.io.File |
getDirectory()
Returns the Group Directory for storing persistent data |
net.jxta.discovery.Discovery |
getDiscovery()
Returns the Discovery for the PeerGroup |
java.util.Enumeration |
getGids()
Returns an Enumeration of the gid Strings of currently discovered Groups in the PeerGroup |
net.jxta.protocol.PeerGroupAdvertisement |
getGroup(java.lang.String gid)
Returns the PeerGroupAdvertisement of the requested Group |
java.lang.String |
getGroupName()
Returns the Group name for this PeerGroupApp |
java.util.Enumeration |
getGroups()
Returns an Enumeration of the PeerGroupAdvertisements of currently discovered Groups in the PeerGroup |
protected net.jxta.protocol.PeerGroupAdvertisement |
getNewPeerGroupAdvertisement(java.lang.String name)
|
PeerGroupApp |
getParentApp()
Returns the parent PeerGroupApp for this PeerGroupApp |
net.jxta.protocol.PeerGroupAdvertisement |
getPeer(java.lang.String pid)
Returns the PeerGroupAdvertisement of the requested Peer |
net.jxta.peergroup.PeerGroup |
getPeerGroup()
Returns the PeerGroup for this PeerGroupApp |
java.util.Enumeration |
getPeers()
Returns an Enumeration of the PeerGroupAdvertisements of currently discovered Peers in the PeerGroup |
java.util.Enumeration |
getPids()
Returns an Enumeration of the pid Strings of currently discovered Peers in the PeerGroup |
net.jxta.pipe.Pipe |
getPipePolicy()
Returns the PipePolicy for the PeerGroup |
protected static java.io.File |
getRootDirectory()
|
void |
init(net.jxta.peergroup.PeerGroup group,
net.jxta.document.Advertisement adv)
Initialize the application |
protected boolean |
isValidPeer(net.jxta.protocol.PeerGroupAdvertisement newPeerAdv)
|
net.jxta.platform.Application |
joinGroup(java.lang.String gid)
Joins the PeerGroup with the given gid The group is only joined if the group is in the list and has not already been joined |
net.jxta.platform.Application |
joinNewGroup(java.lang.String name)
Creates a new PeerGroup with the given name and Joins the group |
net.jxta.document.Advertisement |
loadAdvertisement(java.io.File advFile)
load the advertisement located in the given file |
void |
pollDiscover(boolean flag)
set polling flag state if true, poll local discover results at regular intervals |
void |
removeGroup(java.lang.String gid)
Removes the PeerGroupAdvertisement for the given pid from the list of discovered Groups in the PeerGroup |
void |
removePeer(java.lang.String pid)
Removes the PeerGroupAdvertisement for the given pid from the list of discovered Peers in the PeerGroup |
protected boolean |
replaceTest(net.jxta.protocol.PeerGroupAdvertisement newPeerAdv,
net.jxta.protocol.PeerGroupAdvertisement oldPeerAdv)
|
void |
requestRemoteDiscover()
request remote discovery request |
void |
saveAdvertisement(net.jxta.document.Advertisement adv,
java.io.File advFile)
save the advertisement to the given file |
void |
selectPeer(net.jxta.protocol.PeerGroupAdvertisement pgAdv)
|
void |
setApp(PeerGroupApp app)
|
void |
setParentApp(PeerGroupApp parent)
Set the parent PeerGroupApp for this PeerGroupApp |
protected static void |
setRootDirectory(java.io.File newRootDir)
|
int |
startApp(java.lang.String[] str)
|
protected void |
startPolicy()
Protected Methods to be overloaded by subclasses |
void |
stopApp()
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public PeerGroupApp()
Method Detail |
public void init(net.jxta.peergroup.PeerGroup group, net.jxta.document.Advertisement adv) throws net.jxta.exception.PeerGroupException
group
- PeerGroup this application is started frompublic int startApp(java.lang.String[] str)
public void stopApp()
public net.jxta.peergroup.PeerGroup getPeerGroup()
public net.jxta.protocol.PeerGroupAdvertisement getAdvertisement()
public java.lang.String getGroupName()
public PeerGroupApp getParentApp()
public void setParentApp(PeerGroupApp parent)
parent
- new parent PeerGroupApppublic java.io.File getDirectory()
public net.jxta.discovery.Discovery getDiscovery()
public net.jxta.pipe.Pipe getPipePolicy()
public java.util.Enumeration getPids()
public net.jxta.protocol.PeerGroupAdvertisement getPeer(java.lang.String pid)
pid
- Pid of the requested Peerpublic void addPeer(net.jxta.protocol.PeerGroupAdvertisement peerAdv)
peer
- PeerGroupAdvertisement of the Peer to addpublic void removePeer(java.lang.String pid)
pid
- Pid of the Peer to removepublic java.util.Enumeration getPeers()
public java.util.Enumeration getGids()
public net.jxta.protocol.PeerGroupAdvertisement getGroup(java.lang.String gid)
gid
- Gid of the requested Grouppublic void addGroup(net.jxta.protocol.PeerGroupAdvertisement groupAdv)
peer
- PeerGroupAdvertisement of the Group to addpublic void removeGroup(java.lang.String gid)
gid
- Gid of the Group to removepublic java.util.Enumeration getGroups()
public void pollDiscover(boolean flag)
flag
- new polling flag valuepublic net.jxta.platform.Application joinGroup(java.lang.String gid) throws net.jxta.exception.PeerGroupException
gid
- Gid of the requested Group to joinpublic net.jxta.platform.Application joinNewGroup(java.lang.String name) throws net.jxta.exception.PeerGroupException
gid
- Gid of the requested Group to joinpublic void requestRemoteDiscover()
public void checkDiscoverResults()
public net.jxta.document.Advertisement loadAdvertisement(java.io.File advFile)
advFile
- file that contains the Advertisementpublic void saveAdvertisement(net.jxta.document.Advertisement adv, java.io.File advFile)
adv
- the Advertisement to saveadvFile
- file to write the Advertisementpublic net.jxta.protocol.PipeAdvertisement createPipeAdvertisement()
protected void startPolicy() throws net.jxta.exception.PeerGroupException
protected boolean isValidPeer(net.jxta.protocol.PeerGroupAdvertisement newPeerAdv)
protected boolean replaceTest(net.jxta.protocol.PeerGroupAdvertisement newPeerAdv, net.jxta.protocol.PeerGroupAdvertisement oldPeerAdv)
protected static java.io.File getRootDirectory()
protected static void setRootDirectory(java.io.File newRootDir)
public void setApp(PeerGroupApp app)
public void selectPeer(net.jxta.protocol.PeerGroupAdvertisement pgAdv)
protected net.jxta.protocol.PeerGroupAdvertisement getNewPeerGroupAdvertisement(java.lang.String name) throws net.jxta.exception.PeerGroupException
|
JXTA | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |