JXTA

net.jxta.meter
Class MonitorEvent

java.lang.Object
  extended by net.jxta.meter.MonitorEvent

public class MonitorEvent
extends Object

Information regarding a Remote Monitor's Report


Field Summary
static int CANCELLED_LOCALLY
          Report will not come because the registration was cancelled locally
static int CANCELLED_REMOTELY
          Report will not come because the registration was cancelled remotely
static int ERROR
          Internal Error processing Reports, probably due to a bad Monitor Implementation
static int INVALID_MONITOR_FILTER
          Report will not come because the provided MonitorFilter was invalid
static int INVALID_REPORT_RATE
          Report will not come because the requested report rate is not supported/invalid
static int LEASE_CANCELLED
          Further Reports will not come because the lease was cancelled
static int LEASE_RENEWAL_TIMEOUT
          Further Reports will not come because the lease renewal request did not receive a response.
static int OK
          Report received and is available in the event
static int PEERGROUP_DESTROYED
          Further Reports will not come because this PeerGroup was destroyed locally
static int REFUSED
          Report will not come because the Remote peer has refused it (for security, not supported or load reasons)
static int TIMEOUT
          Report will not come because the of a Timeout
 
Constructor Summary
MonitorEvent(PeerGroupID peerGroupID, MonitorReport monitorReport)
           
 
Method Summary
static MonitorEvent createFailureEvent(int type, PeerID peerID, int requestId)
          Convenience factory method
static MonitorEvent createRemoteMonitorReportEvent(PeerID peerID, int requestId, MonitorReport monitorReport)
          Convenience factory method
 long getLeaseTime()
          Most recent Lease time granted (not specified if a cumulative Report)
 MonitorFilter getMonitorFilter()
          MonitorFilter provided when the report was requested
 MonitorReport getMonitorReport()
          Get the corresponding MonitorReport
 PeerGroupID getPeerGroupID()
          PeerGroup of reported event
 PeerID getPeerID()
          PeerID of reporting Peer.
 long getReportRate()
          Reporting rate (unless Cumulative) specified when the report was requested
 int getType()
          Get the Type of Event (one of the above constants)
 MonitorFilter getValidMonitorFilter()
          The Validated MonitorFilter from the registration or query
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OK

public static final int OK
Report received and is available in the event

See Also:
Constant Field Values

CANCELLED_LOCALLY

public static final int CANCELLED_LOCALLY
Report will not come because the registration was cancelled locally

See Also:
Constant Field Values

CANCELLED_REMOTELY

public static final int CANCELLED_REMOTELY
Report will not come because the registration was cancelled remotely

See Also:
Constant Field Values

TIMEOUT

public static final int TIMEOUT
Report will not come because the of a Timeout

See Also:
Constant Field Values

REFUSED

public static final int REFUSED
Report will not come because the Remote peer has refused it (for security, not supported or load reasons)

See Also:
Constant Field Values

INVALID_REPORT_RATE

public static final int INVALID_REPORT_RATE
Report will not come because the requested report rate is not supported/invalid

See Also:
Constant Field Values

INVALID_MONITOR_FILTER

public static final int INVALID_MONITOR_FILTER
Report will not come because the provided MonitorFilter was invalid

See Also:
Constant Field Values

LEASE_CANCELLED

public static final int LEASE_CANCELLED
Further Reports will not come because the lease was cancelled

See Also:
Constant Field Values

LEASE_RENEWAL_TIMEOUT

public static final int LEASE_RENEWAL_TIMEOUT
Further Reports will not come because the lease renewal request did not receive a response. In all likelihood the remote peer has failed (ie crashed)

See Also:
Constant Field Values

ERROR

public static final int ERROR
Internal Error processing Reports, probably due to a bad Monitor Implementation

See Also:
Constant Field Values

PEERGROUP_DESTROYED

public static final int PEERGROUP_DESTROYED
Further Reports will not come because this PeerGroup was destroyed locally

See Also:
Constant Field Values
Constructor Detail

MonitorEvent

public MonitorEvent(PeerGroupID peerGroupID,
                    MonitorReport monitorReport)
Method Detail

getType

public int getType()
Get the Type of Event (one of the above constants)


getPeerID

public PeerID getPeerID()
PeerID of reporting Peer. My PeerID if local


getPeerGroupID

public PeerGroupID getPeerGroupID()
PeerGroup of reported event


getMonitorFilter

public MonitorFilter getMonitorFilter()
MonitorFilter provided when the report was requested


getReportRate

public long getReportRate()
Reporting rate (unless Cumulative) specified when the report was requested


getLeaseTime

public long getLeaseTime()
Most recent Lease time granted (not specified if a cumulative Report)


getMonitorReport

public MonitorReport getMonitorReport()
Get the corresponding MonitorReport


getValidMonitorFilter

public MonitorFilter getValidMonitorFilter()
The Validated MonitorFilter from the registration or query

Returns:
MonitorFilter

createRemoteMonitorReportEvent

public static MonitorEvent createRemoteMonitorReportEvent(PeerID peerID,
                                                          int requestId,
                                                          MonitorReport monitorReport)
Convenience factory method


createFailureEvent

public static MonitorEvent createFailureEvent(int type,
                                              PeerID peerID,
                                              int requestId)
Convenience factory method


JXSE