org.rhq.core.domain.discovery
Class AvailabilityReport

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

public class AvailabilityReport
extends Object
implements Externalizable

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

Constructor Summary
AvailabilityReport()
          Constructor for AvailabilityReport that is here solely to support the Externalizable interface.
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<Availability> getResourceAvailability()
           
 boolean isChangesOnlyReport()
          Returns false if all resources in inventory are represented in this report.
 void readExternal(ObjectInput in)
           
 String toString()
           
 String toString(boolean includeAll)
          Returns a string representation of this report.
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AvailabilityReport

public AvailabilityReport()
Constructor for AvailabilityReport that is here solely to support the Externalizable interface. Callers should not use this - instead, use the other constructors.


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<Availability> 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

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException


Copyright © 2008-2009 RHQ Project Advisory Board (Red Hat, Inc.). All Rights Reserved.