|
Project JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PeerInfoService
The PeerInfoService is a generic API for getting information about the local Peer as well as remote Peers.
The most important type of information about a Peer may be gotten through the Monitoring Service that may be accessed via the PeerInfoService. The Monitoring Service provides an open mechanism for reporting any type of Metrics gathered on a Peer by a ServiceMonitor. Attached Service Monitors are identified by their ModuleClassID. A ServiceMonitor may monitor anything (ie it is not restricted to JXTA Services).
There are several methods for accessing the capabilities and metrics from ServiceMonitors attached to the Peer (either locally or from remote peers).
Cumulative MonitorReports containing metrics since the Monitoring began (or was reset) on a local/remote Peer may be obtained. Alternatively, you may register listeners get periodic MonitorReports (at a specified rate) of metrics (since the previous report). The amount of information obtained (either cumulatively or periodically) is determined by a MonitorFilter whi The PeerInfoService utilizes the ResolverService to send queries and receive responses (PeerInfoQueryMessage / PeerInfoResponseMessage). These contain requests and responses that are specific to the type of info being requested. Depending upon the type of information requested, a peer may provide multiple varying responses over time (as is the case for periodic remote peer Monitoring).
At the time of writing this documentation Service Monitoring is the only type of Peer Information available though the implementation and underlying protocol can support other types of information.
See the document:
MonitorFilter
,
MonitorReport
,
ServiceMonitor
,
PeerMonitorInfo
,
PeerInfoQueryMessage
,
PeerInfoResponseMessage
Field Summary |
---|
Fields inherited from interface net.jxta.platform.Module |
---|
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_OK |
Method Summary | |
---|---|
long |
addMonitorListener(MonitorFilter monitorFilter,
long reportRate,
boolean includeCumulative,
MonitorListener monitorListener)
Get MonitorReports at a specified rates of metrics accrued over time from the ServiceMonitors (specified in the MonitorFilter) about the local Peer. |
void |
addRemoteMonitorListener(PeerID peerID,
MonitorFilter monitorFilter,
long reportRate,
boolean includeCumulative,
MonitorListener monitorListener,
long lease,
long timeout)
Get MonitorReports at a specified rates of metrics accrued over time from the ServiceMonitors (specified in the MonitorFilter) about the specified remote Peer. |
long |
getBestReportRate(long desiredReportRate)
Asynchronous reporting of Monitored data may be obtained only at rates supported by the MonitorManager on the peer. |
MonitorReport |
getCumulativeMonitorReport(MonitorFilter monitorFilter)
Get a MonitorReport of total accumulated metrics from the ServiceMonitors (specified in the MonitorFilter) since they were created/reset for the local Peer. |
void |
getCumulativeMonitorReport(PeerID peerID,
MonitorFilter monitorFilter,
MonitorListener monitorListener,
long timeout)
Get a MonitorReport of total accumulated metrics from the ServiceMonitors (specified in the MonitorFilter) since they were created/reset for the specified remote Peer. |
PeerMonitorInfo |
getPeerMonitorInfo()
Obtain the monitoring capabilities of the Local Peer. |
void |
getPeerMonitorInfo(PeerID peerID,
PeerMonitorInfoListener peerMonitorInfoListener,
long timeout)
Obtain the monitoring capabilities of a Remote Peer. |
long[] |
getSupportedReportRates()
Asynchronous reporting of Monitored data may be obtained only at rates supported by the MonitorManager on the peer. |
boolean |
isLocalMonitoringAvailable()
See if Local Monitoring is available on this Peer Local monitoring is only available if you are using a version of of jxta.jar that was build with metering activated. |
boolean |
isLocalMonitoringAvailable(ModuleClassID moduleClassID)
See if Local monitoring is available from a specific ServiceMonitor. |
boolean |
isSupportedReportRate(long reportRate)
Asynchronous reporting of Monitored data may be obtained only at rates supported by the MonitorManager on the peer. |
boolean |
removeMonitorListener(MonitorListener monitorListener)
Stop the periodic reporting for all registered filters corresponding to this MonitorListener |
void |
removeRemoteMonitorListener(MonitorListener monitorListener,
long timeout)
Stop the periodic reporting for all registered filters to the all remote Peers corresponding to this MonitorListener. |
void |
removeRemoteMonitorListener(PeerID peerID,
MonitorListener monitorListener,
long timeout)
Stop the periodic reporting for all registered filters to the specified Peer corresponding to this MonitorListener. |
Methods inherited from interface net.jxta.service.Service |
---|
getImplAdvertisement, getInterface |
Methods inherited from interface net.jxta.platform.Module |
---|
init, startApp, stopApp |
Method Detail |
---|
boolean isLocalMonitoringAvailable()
See the document:
boolean isLocalMonitoringAvailable(ModuleClassID moduleClassID)
See the document:
moduleClassID
- The Module classID of the ServiceMonitor. Note that the ServiceMonitor
moduleClassID is not the same as moduleClassID of the Service
being monitored.long[] getSupportedReportRates()
boolean isSupportedReportRate(long reportRate)
long getBestReportRate(long desiredReportRate)
PeerMonitorInfo getPeerMonitorInfo()
The PeerMonitorInfo provides:
void getPeerMonitorInfo(PeerID peerID, PeerMonitorInfoListener peerMonitorInfoListener, long timeout) throws MonitorException
The PeerMonitorInfo provides:
peerID
- The PeerID of the Peer you wish information aboutpeerMonitorInfoListener
- The Listener to be told about the obtained PeerMonitorInfotimeout
- Generate a timeout event if no answer has been received in this time (in Milliseconds)
MonitorException
MonitorReport getCumulativeMonitorReport(MonitorFilter monitorFilter) throws MonitorException
monitorFilter
- The MonitorFilter containing the specific ServiceMonitors and types of Service Metrics desired
MonitorException
void getCumulativeMonitorReport(PeerID peerID, MonitorFilter monitorFilter, MonitorListener monitorListener, long timeout) throws MonitorException
peerID
- The PeerID of the Peer you wish information aboutmonitorFilter
- The MonitorFilter containing the specific ServiceMonitors and types of Service Metrics desiredmonitorListener
- The Listener to obtain the report when it arrives (or timed out)timeout
- The timeout for reporting that the information has not arrived.
MonitorException
long addMonitorListener(MonitorFilter monitorFilter, long reportRate, boolean includeCumulative, MonitorListener monitorListener) throws MonitorException
There is a problem with the following approach:
monitorFilter
- The MonitorFilter containing the specific ServiceMonitors and types of Service Metrics desiredreportRate
- The rate at which you wish metric delta reportsincludeCumulative
- Should the first report you receive be the cumulative data since the ServiceMonitors were created/reset?monitorListener
- The Listener to obtain the report when it arrives (or timed out)
MonitorException
void addRemoteMonitorListener(PeerID peerID, MonitorFilter monitorFilter, long reportRate, boolean includeCumulative, MonitorListener monitorListener, long lease, long timeout) throws MonitorException
There is a problem with the following approach:
peerID
- The PeerID of the Peer you wish information aboutmonitorFilter
- The MonitorFilter containing the specific ServiceMonitors and types of Service Metrics desiredreportRate
- The rate at which you wish metric delta reportsincludeCumulative
- Should the first report you receive be the cumulative data since the ServiceMonitors were created/reset?monitorListener
- The Listener to obtain the report when it arrives (or timed out)timeout
- The timeout for reporting that the information has not arrived.
MonitorException
boolean removeMonitorListener(MonitorListener monitorListener) throws MonitorException
MonitorException
void removeRemoteMonitorListener(PeerID peerID, MonitorListener monitorListener, long timeout) throws MonitorException
peerID
- The Peer that you wish to deregister periodic reportingmonitorListener
- The MonitorListener that was originally registeredtimeout
- The timeout for reporting that the remote listener was acknowledged as deregistered
MonitorException
void removeRemoteMonitorListener(MonitorListener monitorListener, long timeout) throws MonitorException
monitorListener
- The MonitorListener that was originally registeredtimeout
- The timeout for reporting that the remote listener was acknowledged as deregistered
MonitorException
|
JXTA J2SE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |