org.rhq.enterprise.server.measurement
Class AvailabilityPoint

java.lang.Object
  extended by org.rhq.enterprise.server.measurement.AvailabilityPoint
All Implemented Interfaces:
Serializable

public class AvailabilityPoint
extends Object
implements Serializable

An AvailabilityType for a point in time. This object not only tells you if the resource is UP or DOWN but it also tells you if the status is known or unknown (that is, either the data existed in the database and the availability type was known; or there is no data in the database that explicitly tells us what the resource status is - in that case, the availability will be DOWN but it will be listed as "unknown".

Author:
Heiko W. Rupp, John Mazzitelli
See Also:
Serialized Form

Constructor Summary
AvailabilityPoint(org.rhq.core.domain.measurement.AvailabilityType availabilityType, long timestamp)
          Creates an availability point with an explicitly known value.
 
Method Summary
 org.rhq.core.domain.measurement.AvailabilityType getAvailabilityType()
           
 long getTimestamp()
          The timestamp that this data point object represents.
 int getValue()
           
 boolean isKnown()
          Returns true if the availability type is explicitly known.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AvailabilityPoint

public AvailabilityPoint(org.rhq.core.domain.measurement.AvailabilityType availabilityType,
                         long timestamp)
Creates an availability point with an explicitly known value.

Parameters:
availabilityType - the availability type. if null set to UNKNOWN
timestamp - the time when the resource was in the given availability status
Method Detail

isKnown

public boolean isKnown()
Returns true if the availability type is explicitly known. If false, there was no explicit data in the database that indicated an availability.

Returns:
true if getAvailabilityType() returns a status that is explicitly known about the resource

getTimestamp

public long getTimestamp()
The timestamp that this data point object represents.

Returns:
the time when the resource was at the given availability status

getAvailabilityType

public org.rhq.core.domain.measurement.AvailabilityType getAvailabilityType()

getValue

public int getValue()

toString

public String toString()
Overrides:
toString in class Object


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