org.rhq.core.domain.measurement
Class Availability

java.lang.Object
  extended by org.rhq.core.domain.measurement.Availability
All Implemented Interfaces:
Serializable

public class Availability
extends Object
implements Serializable

This Entity Bean stores information about resource availability. The actual data is run-length encoded. This means that the availability state (e.g. UP or DOWN) changed at the start time. This provides historical data regarding when a resource was up or down. To get the current availability of a resource, it is best to use the ResourceAvailability entity instead.

See Also:
ResourceAvailability, Serialized Form

Field Summary
static String FIND_BY_RESOURCE
           
static String FIND_BY_RESOURCE_AND_DATE
           
static String FIND_BY_RESOURCE_NO_SORT
           
static String FIND_CURRENT_BY_RESOURCE
           
static String FIND_FOR_AUTO_GROUP_WITHIN_INTERVAL
           
static String FIND_FOR_RESOURCE_GROUP_WITHIN_INTERVAL
           
static String FIND_FOR_RESOURCE_WITHIN_INTERVAL
           
static String FIND_NONMATCHING_WITH_RESOURCE_ID_BY_AGENT_AND_TYPE
           
static String NATIVE_QUERY_PURGE
           
static String QUERY_DELETE_BY_RESOURCES
           
 
Constructor Summary
protected Availability()
           
  Availability(Resource resource, Date startTime, AvailabilityType type)
          Constructor for Availability.
 
Method Summary
 boolean equals(Object obj)
           
 AvailabilityType getAvailabilityType()
          Indicates the availability status as either UP or DOWN; if null is returned, the status is unknown.
 Date getEndTime()
          The end time of this availability period.
 int getId()
           
 Resource getResource()
           
 Date getStartTime()
           
 int hashCode()
           
 void setAvailabilityType(AvailabilityType availabilityType)
          Sets the availability status.
 void setEndTime(Date endTime)
           
 void setStartTime(Date startTime)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FIND_CURRENT_BY_RESOURCE

public static final String FIND_CURRENT_BY_RESOURCE
See Also:
Constant Field Values

FIND_BY_RESOURCE

public static final String FIND_BY_RESOURCE
See Also:
Constant Field Values

FIND_BY_RESOURCE_NO_SORT

public static final String FIND_BY_RESOURCE_NO_SORT
See Also:
Constant Field Values

FIND_NONMATCHING_WITH_RESOURCE_ID_BY_AGENT_AND_TYPE

public static final String FIND_NONMATCHING_WITH_RESOURCE_ID_BY_AGENT_AND_TYPE
See Also:
Constant Field Values

FIND_FOR_RESOURCE_WITHIN_INTERVAL

public static final String FIND_FOR_RESOURCE_WITHIN_INTERVAL
See Also:
Constant Field Values

FIND_FOR_RESOURCE_GROUP_WITHIN_INTERVAL

public static final String FIND_FOR_RESOURCE_GROUP_WITHIN_INTERVAL
See Also:
Constant Field Values

FIND_FOR_AUTO_GROUP_WITHIN_INTERVAL

public static final String FIND_FOR_AUTO_GROUP_WITHIN_INTERVAL
See Also:
Constant Field Values

FIND_BY_RESOURCE_AND_DATE

public static final String FIND_BY_RESOURCE_AND_DATE
See Also:
Constant Field Values

QUERY_DELETE_BY_RESOURCES

public static final String QUERY_DELETE_BY_RESOURCES
See Also:
Constant Field Values

NATIVE_QUERY_PURGE

public static final String NATIVE_QUERY_PURGE
See Also:
Constant Field Values
Constructor Detail

Availability

protected Availability()

Availability

public Availability(Resource resource,
                    Date startTime,
                    AvailabilityType type)
Constructor for Availability. If type is null, it will be considered unknown.

Parameters:
resource -
startTime -
type -
Method Detail

getId

public int getId()

getResource

public Resource getResource()

getStartTime

public Date getStartTime()

setStartTime

public void setStartTime(Date startTime)

getEndTime

public Date getEndTime()
The end time of this availability period. This will be null if this represents the last known availability.

Returns:
end of the availability period

setEndTime

public void setEndTime(Date endTime)

getAvailabilityType

public AvailabilityType getAvailabilityType()
Indicates the availability status as either UP or DOWN; if null is returned, the status is unknown.

Returns:
availability status

setAvailabilityType

public void setAvailabilityType(AvailabilityType availabilityType)
Sets the availability status. This can be null to indicate an "unknown" availability status.

Parameters:
availabilityType -

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


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