Project JXTA

net.jxta.impl.peer
Class PeerInfoServiceImpl

java.lang.Object
  extended by net.jxta.impl.peer.PeerInfoServiceImpl
All Implemented Interfaces:
PeerInfoService, Module, Service

public class PeerInfoServiceImpl
extends Object
implements PeerInfoService

Peer Info provides a mechanism to obtain information about peers.


Nested Class Summary
(package private)  class PeerInfoServiceImpl.PipQueryHandler
           
 
Field Summary
(package private) static Hashtable peerInfoServices
           
 
Fields inherited from interface net.jxta.platform.Module
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_OK
 
Constructor Summary
PeerInfoServiceImpl()
           
 
Method Summary
 long addMonitorListener(MonitorFilter monitorFilter, long reportRate, boolean includeCumulative, MonitorListener monitorListener)
           
 void addRemoteMonitorListener(PeerID peerID, MonitorFilter monitorFilter, long reportRate, boolean includeCumulative, MonitorListener monitorListener, long lease, long timeout)
           
 long getBestReportRate(long desiredReportRate)
           
 MonitorReport getCumulativeMonitorReport(MonitorFilter monitorFilter)
           
 void getCumulativeMonitorReport(PeerID peerID, MonitorFilter monitorFilter, MonitorListener monitorListener, long timeout)
           
 PeerGroup getGroup()
          Returns the group to which this service is attached.
 Advertisement getImplAdvertisement()
          Returns the advertisement for that service.
 Service getInterface()
          Service objects are not manipulated directly to protect usage of the service.
(package private)  int getNextQueryId()
           
(package private)  PeerInfoHandler getPeerInfoHandler(String name)
           
 PeerMonitorInfo getPeerMonitorInfo()
           
 void getPeerMonitorInfo(PeerID peerID, PeerMonitorInfoListener peerMonitorInfoListener, long timeout)
           
 long[] getSupportedReportRates()
           
 void init(PeerGroup group, ID assignedID, Advertisement impl)
          init is called by PeerGroup to init the Service
 boolean isLocalMonitoringAvailable()
           
 boolean isLocalMonitoringAvailable(ModuleClassID moduleClassID)
           
 boolean isSupportedReportRate(long reportRate)
           
 boolean removeMonitorListener(MonitorListener monitorListener)
           
 void removeRemoteMonitorListener(MonitorListener monitorListener, long timeout)
           
 void removeRemoteMonitorListener(PeerID peerID, MonitorListener monitorListener, long timeout)
           
 int startApp(String[] arg)
          Supply arguments and starts this service if it hadn't started by itself.
 void stopApp()
          Ask this service to stop.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

peerInfoServices

static Hashtable peerInfoServices
Constructor Detail

PeerInfoServiceImpl

public PeerInfoServiceImpl()
Method Detail

getNextQueryId

int getNextQueryId()

startApp

public int startApp(String[] arg)
Supply arguments and starts this service if it hadn't started by itself. Currently this service starts by itself and does not expect arguments.

Specified by:
startApp in interface Module
Parameters:
arg - A table of strings arguments.
Returns:
int status indication.

stopApp

public void stopApp()
Ask this service to stop. This request is currently ignored.

Specified by:
stopApp in interface Module

getPeerInfoHandler

PeerInfoHandler getPeerInfoHandler(String name)

getInterface

public Service getInterface()
Service objects are not manipulated directly to protect usage of the service. A Service interface is returned to access the service methods.

Specified by:
getInterface in interface Service
Returns:
Service public interface of the service

getImplAdvertisement

public Advertisement getImplAdvertisement()
Returns the advertisement for that service.

Specified by:
getImplAdvertisement in interface Service
Returns:
Advertisement the advertisement.

init

public void init(PeerGroup group,
                 ID assignedID,
                 Advertisement impl)
          throws PeerGroupException
init is called by PeerGroup to init the Service

Specified by:
init in interface Module
Parameters:
group -
assignedID -
impl -
Throws:
PeerGroupException - throw any exception thrown during obtaining Service

getGroup

public PeerGroup getGroup()
Returns the group to which this service is attached.

Returns:
PeerGroup the group

isLocalMonitoringAvailable

public boolean isLocalMonitoringAvailable()
Specified by:
isLocalMonitoringAvailable in interface PeerInfoService

isLocalMonitoringAvailable

public boolean isLocalMonitoringAvailable(ModuleClassID moduleClassID)
Specified by:
isLocalMonitoringAvailable in interface PeerInfoService

getSupportedReportRates

public long[] getSupportedReportRates()
Specified by:
getSupportedReportRates in interface PeerInfoService

isSupportedReportRate

public boolean isSupportedReportRate(long reportRate)
Specified by:
isSupportedReportRate in interface PeerInfoService

getBestReportRate

public long getBestReportRate(long desiredReportRate)
Specified by:
getBestReportRate in interface PeerInfoService

getPeerMonitorInfo

public PeerMonitorInfo getPeerMonitorInfo()
Specified by:
getPeerMonitorInfo in interface PeerInfoService

getPeerMonitorInfo

public void getPeerMonitorInfo(PeerID peerID,
                               PeerMonitorInfoListener peerMonitorInfoListener,
                               long timeout)
                        throws MonitorException
Specified by:
getPeerMonitorInfo in interface PeerInfoService
Throws:
MonitorException

getCumulativeMonitorReport

public MonitorReport getCumulativeMonitorReport(MonitorFilter monitorFilter)
                                         throws MonitorException
Specified by:
getCumulativeMonitorReport in interface PeerInfoService
Throws:
MonitorException

getCumulativeMonitorReport

public void getCumulativeMonitorReport(PeerID peerID,
                                       MonitorFilter monitorFilter,
                                       MonitorListener monitorListener,
                                       long timeout)
                                throws MonitorException
Specified by:
getCumulativeMonitorReport in interface PeerInfoService
Throws:
MonitorException

addMonitorListener

public long addMonitorListener(MonitorFilter monitorFilter,
                               long reportRate,
                               boolean includeCumulative,
                               MonitorListener monitorListener)
                        throws MonitorException
Specified by:
addMonitorListener in interface PeerInfoService
Throws:
MonitorException

addRemoteMonitorListener

public void addRemoteMonitorListener(PeerID peerID,
                                     MonitorFilter monitorFilter,
                                     long reportRate,
                                     boolean includeCumulative,
                                     MonitorListener monitorListener,
                                     long lease,
                                     long timeout)
                              throws MonitorException
Specified by:
addRemoteMonitorListener in interface PeerInfoService
Throws:
MonitorException

removeMonitorListener

public boolean removeMonitorListener(MonitorListener monitorListener)
                              throws MonitorException
Specified by:
removeMonitorListener in interface PeerInfoService
Throws:
MonitorException

removeRemoteMonitorListener

public void removeRemoteMonitorListener(PeerID peerID,
                                        MonitorListener monitorListener,
                                        long timeout)
                                 throws MonitorException
Specified by:
removeRemoteMonitorListener in interface PeerInfoService
Throws:
MonitorException

removeRemoteMonitorListener

public void removeRemoteMonitorListener(MonitorListener monitorListener,
                                        long timeout)
                                 throws MonitorException
Specified by:
removeRemoteMonitorListener in interface PeerInfoService
Throws:
MonitorException

JXTA J2SE