org.rhq.core.domain.discovery
Class AvailabilityReport

java.lang.Object
  extended by org.rhq.core.domain.discovery.AvailabilityReport
All Implemented Interfaces:
Serializable

public class AvailabilityReport
extends Object
implements Serializable

Contains a set of one or more Availability values used to indicate the statuses of a set of resources. Note that only the start times are used when looking at the resource times - the end times found in the Availability objects are ignored. This is because a report only defines a snapshot in time - at a particular time (the availabilities' start times) a resource was either up or down. Reports do not tell you the span of time a resource was up or down, it only tells you what state they were in at a particular millisecond in time.

See Also:
Serialized Form

Nested Class Summary
 class AvailabilityReport.Datum
           
 
Constructor Summary
AvailabilityReport(boolean changesOnly, String agentName)
          Constructor for AvailabilityReport.
AvailabilityReport(String agentName)
          Constructor for AvailabilityReport that assumes this report will represent a full inventory (same as if constructing with AvailabilityReport(boolean, String) with the first argument being false).
 
Method Summary
 void addAvailability(Availability availability)
           
 String getAgentName()
          Returns the agent name of the agent that produced this report.
 List<AvailabilityReport.Datum> getResourceAvailability()
           
 boolean isChangesOnlyReport()
          Returns false if all resources in inventory are represented in this report.
 String toString()
           
 String toString(boolean includeAll)
          Returns a string representation of this report.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AvailabilityReport

public AvailabilityReport(String agentName)
Constructor for AvailabilityReport that assumes this report will represent a full inventory (same as if constructing with AvailabilityReport(boolean, String) with the first argument being false).

Parameters:
agentName - identifies the agent that produced this report

AvailabilityReport

public AvailabilityReport(boolean changesOnly,
                          String agentName)
Constructor for AvailabilityReport.

Parameters:
changesOnly - if false, this report will represent the full inventory; in other words, it will contain availability statuses for all resources. If true, this report will only contain availability statuses for only those resources that have changed status
agentName - identifies the agent that produced this report
Method Detail

getAgentName

public String getAgentName()
Returns the agent name of the agent that produced this report.

Returns:
the agent name

addAvailability

public void addAvailability(Availability availability)

getResourceAvailability

public List<AvailabilityReport.Datum> getResourceAvailability()

isChangesOnlyReport

public boolean isChangesOnlyReport()
Returns false if all resources in inventory are represented in this report. true is returned if only those resources that have changed status are in this report.

Returns:
indicates if all resources or just resources that changed are found in this report

toString

public String toString()
Overrides:
toString in class Object

toString

public String toString(boolean includeAll)
Returns a string representation of this report.

Parameters:
includeAll - if true, the returned string includes all the individual availabilities, otherwise, the returned string only tells you how many of them there are
Returns:
string representation of the report


Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.