Project JXTA

net.jxta.peer
Interface PeerInfoService

All Superinterfaces:
Module, Service

public interface PeerInfoService
extends Service

This interface implements the peer information and management service that is used for monitoring and registering peer services. PeerInfo utilizes the Resolver service for send queries, and receiving responses. The PeerInfoService uses the PeerInfo(*)Messages for query, and reponse messages, in the case of query only sourcePid, and targetPid are populated. The targetPid peer is not required to respond the query, nor honor all the information requested.

Since:
JXTA 1.0
See Also:
Advertisement, Service, PeerInfoQueryMessage, PeerInfoResponseMessage

Method Summary
 void addPeerInfoListener(PeerInfoListener listener)
          Add a peerinfo listener
 void flushAdvertisements(ID id)
          Flush cached advertisements.
 java.util.Enumeration getLocalPeerInfo(ID peer)
          Get PeerInfoService from local cache.
 PeerInfoResponseMessage getPeerInfoService()
          Retrieve Peer Information Advertisement
 int getRemotePeerInfo(ID peer)
          Deprecated.  
 void getRemotePeerInfo(ID peer, PeerInfoListener listener)
          Get PeerInfoService from a remote peer.
 boolean removePeerInfoListener(PeerInfoListener listener)
          remove a peer info listener
 
Methods inherited from interface net.jxta.service.Service
getImplAdvertisement, getInterface
 
Methods inherited from interface net.jxta.platform.Module
init, startApp, stopApp
 

Method Detail

getRemotePeerInfo

public int getRemotePeerInfo(ID peer)
Deprecated.  

Get PeerInfoService from a remote peer.
Parameters:
peer - Address of a peer, or portal to connect to, if address is null
Returns:
int query id associated with the request

getRemotePeerInfo

public void getRemotePeerInfo(ID peer,
                              PeerInfoListener listener)
Get PeerInfoService from a remote peer.
Parameters:
peer - Address of a peer, or portal to connect to, if address is null
listener - The listener object will be called back when peer information is known.

getLocalPeerInfo

public java.util.Enumeration getLocalPeerInfo(ID peer)
                                       throws java.io.IOException
Get PeerInfoService from local cache.
Parameters:
peer - Address of a peer, or portal to connect to, if address is null
Returns:
The localPeerInfo value
Throws:
java.io.IOException -  

getPeerInfoService

public PeerInfoResponseMessage getPeerInfoService()
Retrieve Peer Information Advertisement
Returns:
PeerInfoResponseMessage
Since:
JXTA 1.0

flushAdvertisements

public void flushAdvertisements(ID id)
                         throws java.io.IOException
Flush cached advertisements.
Parameters:
id - peerId of peer whose locally cached PeerInfoResponseMessage is to be deleted. If null, locally cached PeerInfoResponseMessage of all peers are deleted.
Throws:
java.io.IOException -  
Since:
JXTA 1.0
See Also:
PeerInfoResponseMessage

addPeerInfoListener

public void addPeerInfoListener(PeerInfoListener listener)
Add a peerinfo listener
Parameters:
listener - The feature to be added to the PeerInfoListener attribute

removePeerInfoListener

public boolean removePeerInfoListener(PeerInfoListener listener)
remove a peer info listener
Parameters:
listener -  
Returns:
true if the argument was a component of this vector; false otherwise

Project JXTA