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 value, long timestamp)
          Creates an availability point with an explicitly known value.
AvailabilityPoint(long timestamp)
          Creates an availability point with an unknown value (whose getAvailabilityType() will return AvailabilityType.DOWN.
 
Method Summary
 org.rhq.core.domain.measurement.AvailabilityType getAvailabilityType()
           
 long getTimestamp()
          The timestamp that this data point object represents.
 int getValue()
          Returns the ordinal value of the availability type.
 boolean isKnown()
          Returns true if the availability data 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 value,
                         long timestamp)
Creates an availability point with an explicitly known value.

Parameters:
value - the availability status
timestamp - the time when the resource was in the given availability status

AvailabilityPoint

public AvailabilityPoint(long timestamp)
Creates an availability point with an unknown value (whose getAvailabilityType() will return AvailabilityType.DOWN.

Parameters:
timestamp - the time when the resource was in the given availability status
Method Detail

isKnown

public boolean isKnown()
Returns true if the availability data is explicitly known. If false, there was no explicit data in the database that indicated an availability, so the resource's availability will be assumed to be DOWN.

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()
Returns the ordinal value of the availability type.

Returns:
availability type ordinal value
See Also:
getAvailabilityType()

toString

public String toString()
Overrides:
toString in class Object


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