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_CHILD_COMPOSITE_BY_AGENT_AND_NONMATCHING_TYPE
           
static String FIND_CURRENT_BY_RESOURCE
           
static String FIND_FOR_AGENT_PLATFORM
           
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_PLATFORM_COMPOSITE_BY_AGENT_AND_NONMATCHING_TYPE
           
static String NATIVE_QUERY_PURGE
           
static String QUERY_DELETE_BY_RESOURCES
           
 
Constructor Summary
protected Availability()
           
  Availability(Resource resource, AvailabilityType type)
          StartTime defaults to current time, no end time is set.
  Availability(Resource resource, Long startTime, AvailabilityType type)
          No end time is set.
 
Method Summary
 boolean equals(Object obj)
           
 AvailabilityType getAvailabilityType()
           
 Long getEndTime()
          The end time of this availability period.
 int getId()
           
 Resource getResource()
           
 Long getStartTime()
           
 int hashCode()
           
 void setAvailabilityType(AvailabilityType availabilityType)
           
 void setEndTime(Long endTime)
           
 void setStartTime(Long 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_PLATFORM_COMPOSITE_BY_AGENT_AND_NONMATCHING_TYPE

public static final String FIND_PLATFORM_COMPOSITE_BY_AGENT_AND_NONMATCHING_TYPE
See Also:
Constant Field Values

FIND_CHILD_COMPOSITE_BY_AGENT_AND_NONMATCHING_TYPE

public static final String FIND_CHILD_COMPOSITE_BY_AGENT_AND_NONMATCHING_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

FIND_FOR_AGENT_PLATFORM

public static final String FIND_FOR_AGENT_PLATFORM
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,
                    AvailabilityType type)
StartTime defaults to current time, no end time is set.

Parameters:
resource -
type - if null this will be set to UNKNOWN

Availability

public Availability(Resource resource,
                    Long startTime,
                    AvailabilityType type)
No end time is set.

Parameters:
resource -
startTime - if null set to current time
type - if null this will be set to UNKNOWN
Method Detail

getId

public int getId()

getResource

public Resource getResource()

getStartTime

public Long getStartTime()

setStartTime

public void setStartTime(Long startTime)

getEndTime

public Long 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(Long endTime)

getAvailabilityType

public AvailabilityType getAvailabilityType()

setAvailabilityType

public void setAvailabilityType(AvailabilityType 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-2012 Red Hat, Inc.. All Rights Reserved.