|
Project JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.discovery.DiscoveryServiceImpl
public class DiscoveryServiceImpl
This Discovery Service implementation provides a mechanism to discover peers within the horizon of the resolver service. The horizon is normally restricted to the group's boundaries but this is not an absolute requirement. Use of the Resolver service is not an absolute requirement either for a discovery service, but this is what this is part of the platform and default net peer group protocol set, which this code implements.
This implementation uses the standard JXTA Peer Discovery Protocol (PDP). The DiscoveryService service also provides a way to obtain information from a specified peer and request other peer advertisements, this method is particularly useful in the case of a portal where new relationships may be established starting from a predetermined peer (perhaps described in address book, or through an invitation)
DiscoveryService
,
DiscoveryQueryMsg
,
DiscoveryQuery
,
DiscoveryResponseMsg
,
DiscoveryResponse
,
ResolverService
,
JXTA Protocols Specification : Peer Discovery ProtocolField Summary | |
---|---|
protected Cm |
cm
The cache manager we're going to use to cache jxta advertisements |
protected static String[] |
dirname
adv types |
Fields inherited from interface net.jxta.discovery.DiscoveryService |
---|
ADV, DEFAULT_EXPIRATION, DEFAULT_LIFETIME, GROUP, INFINITE_LIFETIME, NO_EXPIRATION, PEER |
Fields inherited from interface net.jxta.platform.Module |
---|
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_OK |
Constructor Summary | |
---|---|
DiscoveryServiceImpl()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Cm cm
protected static final String[] dirname
Constructor Detail |
---|
public DiscoveryServiceImpl()
Method Detail |
---|
public Service getInterface()
getInterface
in interface Service
public Advertisement getImplAdvertisement()
getImplAdvertisement
in interface Service
public int getRemoteAdvertisements(String peer, int type, String attribute, String value, int threshold)
getRemoteAdvertisements
in interface DiscoveryService
public int getRemoteAdvertisements(String peer, int type, String attribute, String value, int threshold, DiscoveryListener listener)
getRemoteAdvertisements
in interface DiscoveryService
public Enumeration getLocalAdvertisements(int type, String attribute, String value) throws IOException
getLocalAdvertisements
in interface DiscoveryService
IOException
public void init(PeerGroup pg, ID assignedID, Advertisement impl) throws PeerGroupException
init
in interface Module
PeerGroupException
public int startApp(String[] arg)
startApp
in interface Module
public void stopApp()
stopApp
in interface Module
public void flushAdvertisements(String id, int type) throws IOException
flushAdvertisements
in interface DiscoveryService
IOException
public void flushAdvertisement(Advertisement adv) throws IOException
flushAdvertisement
in interface DiscoveryService
IOException
public void publish(Advertisement adv, int type) throws IOException
publish
in interface DiscoveryService
IOException
public void publish(Advertisement adv) throws IOException
publish
in interface DiscoveryService
IOException
public void publish(Advertisement adv, long lifetime, long expiration) throws IOException
publish
in interface DiscoveryService
IOException
public void publish(Advertisement adv, int type, long lifetime, long expiration) throws IOException
publish
in interface DiscoveryService
IOException
public void remotePublish(Advertisement adv, int type)
remotePublish
in interface DiscoveryService
public void remotePublish(Advertisement adv)
remotePublish
in interface DiscoveryService
public void remotePublish(Advertisement adv, int type, long timeout)
remotePublish
in interface DiscoveryService
public void remotePublish(Advertisement adv, long timeout)
remotePublish
in interface DiscoveryService
public void remotePublish(String peerid, Advertisement adv, int type)
remotePublish
in interface DiscoveryService
public void remotePublish(String peerid, Advertisement adv)
remotePublish
in interface DiscoveryService
public void remotePublish(String peerid, Advertisement adv, long timeout)
remotePublish
in interface DiscoveryService
public void processResponse(ResolverResponseMsg response)
processResponse
in interface QueryHandler
public int processQuery(ResolverQueryMsg query)
processQuery
in interface QueryHandler
public void addDiscoveryListener(DiscoveryListener listener)
addDiscoveryListener
in interface DiscoveryService
public boolean removeDiscoveryListener(DiscoveryListener listener)
removeDiscoveryListener
in interface DiscoveryService
public void remotePublish(String peerid, Advertisement adv, int type, long timeout)
remotePublish
in interface DiscoveryService
public long getAdvExpirationTime(ID id, int type)
getAdvExpirationTime
in interface DiscoveryService
public long getAdvLifeTime(ID id, int type)
getAdvLifeTime
in interface DiscoveryService
public long getAdvExpirationTime(Advertisement adv)
getAdvExpirationTime
in interface DiscoveryService
public long getAdvLifeTime(Advertisement adv)
getAdvLifeTime
in interface DiscoveryService
public boolean processSrdi(ResolverSrdiMsg message)
processSrdi
in interface SrdiHandler
public void messageSendFailed(PeerID peerid, OutgoingMessageEvent e)
messageSendFailed
in interface SrdiHandler
public void pushEntries(boolean all)
pushEntries
in interface Srdi.SrdiInterface
all
- if true then push all entries otherwise just push
those which have changed since the last push.protected void pushSrdi(ID peer, int type, boolean all)
all
- if true push all entries, otherwise just deltaspublic void rendezvousEvent(RendezvousEvent event)
rendezvousEvent
in interface RendezvousListener
|
JXTA J2SE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |