org.rhq.enterprise.server.measurement
Class MeasurementScheduleManagerBean

java.lang.Object
  extended by org.rhq.enterprise.server.measurement.MeasurementScheduleManagerBean
All Implemented Interfaces:
MeasurementScheduleManagerLocal, MeasurementScheduleManagerRemote

public class MeasurementScheduleManagerBean
extends Object
implements MeasurementScheduleManagerLocal, MeasurementScheduleManagerRemote

A manager for MeasurementSchedules.

Author:
Heiko W. Rupp, Ian Springer, Joseph Marques

Field Summary
static String ENTITYCONTEXT_GROUPID
           
static String ENTITYCONTEXT_PARENT_RESOURCEID
           
static String ENTITYCONTEXT_RESOURCEID
           
static String ENTITYCONTEXT_RESOURCETYPEID
           
static String SCHEDULE_SUBQUERY
           
static String TRIGGER_GROUP_NAME
           
static String TRIGGER_NAME
           
 
Constructor Summary
MeasurementScheduleManagerBean()
           
 
Method Summary
 void createSchedulesForExistingResources(org.rhq.core.domain.resource.ResourceType type, org.rhq.core.domain.measurement.MeasurementDefinition newDefinition)
          Create MeasurementSchedules for existing resources hanging on newType.
 void disableAllDefaultCollections(org.rhq.core.domain.auth.Subject subject)
          Disables all collection schedules for all measurement definitions.
 void disableAllSchedules(org.rhq.core.domain.auth.Subject subject)
          Disables all collection schedules attached to all resources.
 void disableDefaultCollectionForMeasurementDefinitions(org.rhq.core.domain.auth.Subject subject, int[] measurementDefinitionIds, boolean updateSchedules)
          Disables all collection schedules in the given measurement definition IDs.
 void disableMeasurementTemplates(org.rhq.core.domain.auth.Subject subject, int[] measurementDefinitionIds)
           
 void disableSchedulesForAutoGroup(org.rhq.core.domain.auth.Subject subject, int parentResourceId, int childResourceType, int[] measurementDefinitionIds)
          Disable the measurement schedules for the passed definitions of the rsource ot the passed auto group.
 void disableSchedulesForCompatibleGroup(org.rhq.core.domain.auth.Subject subject, int groupId, int[] measurementDefinitionIds)
          Disable the measurement schedules for the passed definitions for the resources of the passed compatible group.
 int disableSchedulesForContext(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.common.EntityContext context, int[] measurementDefinitionIds)
           
 void disableSchedulesForResource(org.rhq.core.domain.auth.Subject subject, int resourceId, int[] measurementDefinitionIds)
          Disables all collection schedules attached to the given resource whose schedules are based off the given definitions.
 void enableMeasurementTemplates(org.rhq.core.domain.auth.Subject subject, int[] measurementDefinitionIds)
           
 void enableSchedulesForAutoGroup(org.rhq.core.domain.auth.Subject subject, int parentResourceId, int childResourceType, int[] measurementDefinitionIds)
          Enable the measurement schedules for the passed definitions of the resource ot the passed auto group.
 void enableSchedulesForCompatibleGroup(org.rhq.core.domain.auth.Subject subject, int groupId, int[] measurementDefinitionIds)
          Enable the measurement schedules for the passed definitions for the resources of the passed compatible group.
 int enableSchedulesForContext(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.common.EntityContext context, int[] measurementDefinitionIds)
           
 void enableSchedulesForResource(org.rhq.core.domain.auth.Subject subject, int resourceId, int[] measurementDefinitionIds)
          Enable the schedules for the provided definitions and resource
 void errorCorrectSchedules()
          This method should be called when it is determined that the data in the measurement schedule table might be corrupt.
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.measurement.MeasurementSchedule> findSchedulesByCriteria(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.MeasurementScheduleCriteria criteria)
          TODO
 List<org.rhq.core.domain.measurement.MeasurementSchedule> findSchedulesByIds(int[] scheduleIds)
          Return a list of MeasurementSchedules for the given ids
 List<org.rhq.core.domain.measurement.MeasurementSchedule> findSchedulesByResourceIdAndDefinitionIds(org.rhq.core.domain.auth.Subject subject, int resourceId, int[] definitionIds)
          Return a list of MeasurementSchedules for the given definition ids and resource id.
 List<org.rhq.core.domain.measurement.MeasurementSchedule> findSchedulesByResourceIdsAndDefinitionId(org.rhq.core.domain.auth.Subject subject, int[] resourceIds, int definitionId)
          Find MeasurementSchedules that are attached to a certain definition and some resources
 List<org.rhq.core.domain.measurement.MeasurementSchedule> findSchedulesByResourceIdsAndDefinitionIds(int[] resourceIds, int[] definitionIds)
          Return a list of MeasurementSchedules for the given definition ids and resource ids.
 Set<org.rhq.core.domain.measurement.ResourceMeasurementScheduleRequest> findSchedulesForResourceAndItsDescendants(int[] resourceIds, boolean getDescendents)
          Given a resource ID, this will return all schedule collections for all of the resource's measurements, including all measurements for the resource's children.
 List<org.rhq.core.domain.measurement.MeasurementSchedule> findSchedulesForResourceAndType(org.rhq.core.domain.auth.Subject subject, int resourceId, org.rhq.core.domain.measurement.DataType dataType, org.rhq.core.domain.measurement.DisplayType displayType, boolean enabledOnly)
          Determine the Schedules for a Resource and DataType.
 AgentClient getAgentClientForSchedule(org.rhq.core.domain.measurement.MeasurementSchedule sched)
          Get the AgentClient (the connection to the agent) for a certain Schedule
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.measurement.composite.MeasurementScheduleComposite> getMeasurementScheduleCompositesByContext(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.common.EntityContext context, org.rhq.core.domain.util.PageControl pc)
           
 String getMeasurementScheduleSubQueryForContext(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.common.EntityContext context, int[] measurementDefinitionIds)
           
 org.rhq.core.domain.measurement.MeasurementSchedule getSchedule(org.rhq.core.domain.auth.Subject subject, int resourceId, int definitionId, boolean attachBaseline)
          Find MeasurementSchedules that are attached to a certain definition and a resource
 org.rhq.core.domain.measurement.MeasurementSchedule getScheduleById(int scheduleId)
          Returns a MeasurementSchedule by its primary key or null.
 org.rhq.core.domain.measurement.MeasurementSchedule getScheduleById(org.rhq.core.domain.auth.Subject subject, int scheduleId)
          Obtain a MeasurementSchedule by its Id after a check for a valid session
 int getScheduledMeasurementsPerMinute()
           
 int insertSchedulesFor(int[] batchIds)
           
 void notifyAgentsOfScheduleUpdates(org.rhq.core.domain.common.EntityContext entityContext, String scheduleSubQuery)
          Notifies all agents of measurement schedule changes.
 int returnSchedulesFor(int[] batchIds, Set<org.rhq.core.domain.measurement.ResourceMeasurementScheduleRequest> allSchedules)
           
 void updateDefaultCollectionIntervalAndEnablementForMeasurementDefinitions(org.rhq.core.domain.auth.Subject subject, int[] measurementDefinitionIds, long collectionInterval, boolean enable, boolean updateExistingSchedules)
          Using this method one can both update the default collection interval AND enable or disable the measurement definitions.
 void updateDefaultCollectionIntervalForMeasurementDefinitions(org.rhq.core.domain.auth.Subject subject, int[] measurementDefinitionIds, long collectionInterval, boolean updateExistingSchedules)
          (Re-)Enables all collection schedules in the given measurement definition IDs and sets their collection intervals.
 void updateMeasurementTemplates(org.rhq.core.domain.auth.Subject subject, int[] measurementDefinitionIds, long collectionInterval)
          Update default measurement schedules ("metric templates").
 void updateSchedule(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.measurement.MeasurementSchedule schedule)
          Reattach a Schedule to a PersitenceContext after a successful check for a valid session
 void updateSchedulesForAutoGroup(org.rhq.core.domain.auth.Subject subject, int parentResourceId, int childResourceType, int[] measurementDefinitionIds, long collectionInterval)
          Enables all collection schedules attached to the given auto group whose schedules are based off the given definitions.
 void updateSchedulesForCompatibleGroup(org.rhq.core.domain.auth.Subject subject, int groupId, int[] measurementDefinitionIds, long collectionInterval)
          Enables all collection schedules attached to the given compatible group whose schedules are based off the given definitions.
 int updateSchedulesForContext(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.common.EntityContext context, int[] measurementDefinitionIds, long collectionInterval)
           
 void updateSchedulesForResource(org.rhq.core.domain.auth.Subject subject, int resourceId, int[] measurementDefinitionIds, long collectionInterval)
          Enables all collection schedules attached to the given resource whose schedules are based off the given definitions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRIGGER_NAME

public static final String TRIGGER_NAME
See Also:
Constant Field Values

TRIGGER_GROUP_NAME

public static final String TRIGGER_GROUP_NAME
See Also:
Constant Field Values

SCHEDULE_SUBQUERY

public static final String SCHEDULE_SUBQUERY
See Also:
Constant Field Values

ENTITYCONTEXT_RESOURCEID

public static final String ENTITYCONTEXT_RESOURCEID
See Also:
Constant Field Values

ENTITYCONTEXT_GROUPID

public static final String ENTITYCONTEXT_GROUPID
See Also:
Constant Field Values

ENTITYCONTEXT_PARENT_RESOURCEID

public static final String ENTITYCONTEXT_PARENT_RESOURCEID
See Also:
Constant Field Values

ENTITYCONTEXT_RESOURCETYPEID

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

MeasurementScheduleManagerBean

public MeasurementScheduleManagerBean()
Method Detail

findSchedulesForResourceAndItsDescendants

public Set<org.rhq.core.domain.measurement.ResourceMeasurementScheduleRequest> findSchedulesForResourceAndItsDescendants(int[] resourceIds,
                                                                                                                         boolean getDescendents)
Description copied from interface: MeasurementScheduleManagerLocal
Given a resource ID, this will return all schedule collections for all of the resource's measurements, including all measurements for the resource's children. This will also create schedules for resources if they do not already exist.

Specified by:
findSchedulesForResourceAndItsDescendants in interface MeasurementScheduleManagerLocal
Parameters:
resourceIds - IDs of the resources whose measurements are to be returned
getDescendents - if true, descendents will be loaded as well
Returns:
the set of resource schedule requests for a subtree or a single resource

getAgentClientForSchedule

public AgentClient getAgentClientForSchedule(org.rhq.core.domain.measurement.MeasurementSchedule sched)
Get the AgentClient (the connection to the agent) for a certain Schedule

Specified by:
getAgentClientForSchedule in interface MeasurementScheduleManagerLocal
Parameters:
sched - A MeasurementSchedule for which we need a connection to the Agent
Returns:
an AgentClient to communicate with the Agent

getScheduleById

public org.rhq.core.domain.measurement.MeasurementSchedule getScheduleById(int scheduleId)
Returns a MeasurementSchedule by its primary key or null.

Parameters:
scheduleId - the id of the desired schedule
Returns:
The MeasurementSchedule or null if not found

findSchedulesByIds

public List<org.rhq.core.domain.measurement.MeasurementSchedule> findSchedulesByIds(int[] scheduleIds)
Return a list of MeasurementSchedules for the given ids

Specified by:
findSchedulesByIds in interface MeasurementScheduleManagerLocal
Parameters:
scheduleIds - PrimaryKeys of the schedules searched
Returns:
a list of Schedules

getScheduleById

public org.rhq.core.domain.measurement.MeasurementSchedule getScheduleById(org.rhq.core.domain.auth.Subject subject,
                                                                           int scheduleId)
Obtain a MeasurementSchedule by its Id after a check for a valid session

Specified by:
getScheduleById in interface MeasurementScheduleManagerLocal
Parameters:
subject - a session id that must be valid
scheduleId - The primary key of the Schedule
Returns:
a MeasurementSchedule or null, if there is

findSchedulesByResourceIdsAndDefinitionId

public List<org.rhq.core.domain.measurement.MeasurementSchedule> findSchedulesByResourceIdsAndDefinitionId(org.rhq.core.domain.auth.Subject subject,
                                                                                                           int[] resourceIds,
                                                                                                           int definitionId)
Find MeasurementSchedules that are attached to a certain definition and some resources

Specified by:
findSchedulesByResourceIdsAndDefinitionId in interface MeasurementScheduleManagerLocal
Parameters:
subject - A subject that must be valid
definitionId - The primary key of a MeasurementDefinition
resourceIds - primary of Resources wanted
Returns:
a List of MeasurementSchedules

findSchedulesByResourceIdsAndDefinitionIds

public List<org.rhq.core.domain.measurement.MeasurementSchedule> findSchedulesByResourceIdsAndDefinitionIds(int[] resourceIds,
                                                                                                            int[] definitionIds)
Description copied from interface: MeasurementScheduleManagerLocal
Return a list of MeasurementSchedules for the given definition ids and resource ids. Note that this method does not take a Subject argument. Security checks are the responsibility of the caller.

Specified by:
findSchedulesByResourceIdsAndDefinitionIds in interface MeasurementScheduleManagerLocal
Parameters:
resourceIds - The ids of the resource for which schedules are being fetched
definitionIds - The ids of the the measurement definitions
Returns:
A list of MeasurementSchedules

getSchedule

public org.rhq.core.domain.measurement.MeasurementSchedule getSchedule(org.rhq.core.domain.auth.Subject subject,
                                                                       int resourceId,
                                                                       int definitionId,
                                                                       boolean attachBaseline)
                                                                throws MeasurementNotFoundException
Find MeasurementSchedules that are attached to a certain definition and a resource

Specified by:
getSchedule in interface MeasurementScheduleManagerLocal
Parameters:
subject -
definitionId - The primary key of a MeasurementDefinition
resourceId - the id of the resource
attachBaseline - baseline won't be attached to the schedule by default do to LAZY annotation on the managed relationship. attachBaseline, if true, will eagerly load it for the caller
Returns:
the MeasurementSchedule of the given definition for the given resource
Throws:
MeasurementNotFoundException

disableDefaultCollectionForMeasurementDefinitions

public void disableDefaultCollectionForMeasurementDefinitions(org.rhq.core.domain.auth.Subject subject,
                                                              int[] measurementDefinitionIds,
                                                              boolean updateSchedules)
Description copied from interface: MeasurementScheduleManagerLocal
Disables all collection schedules in the given measurement definition IDs. This only disables the "templates", it does not disable actual schedules. For that capability, see #disableSchedules(Subject, int[], int).

Specified by:
disableDefaultCollectionForMeasurementDefinitions in interface MeasurementScheduleManagerLocal
updateSchedules - TODO

disableAllDefaultCollections

public void disableAllDefaultCollections(org.rhq.core.domain.auth.Subject subject)
Description copied from interface: MeasurementScheduleManagerLocal
Disables all collection schedules for all measurement definitions. This only disables the "templates", it does not disable actual schedules. For that capability, see #disableAllMeasurementSchedules(Subject).

This is a highly disruptive method - it turns off monitoring for future resources. The user making this call must have global inventory and setting permissions to execute this.

Specified by:
disableAllDefaultCollections in interface MeasurementScheduleManagerLocal
Parameters:
subject - user that must have global inventory and setting rights

disableAllSchedules

public void disableAllSchedules(org.rhq.core.domain.auth.Subject subject)
Description copied from interface: MeasurementScheduleManagerLocal
Disables all collection schedules attached to all resources. This only disables the currently existing schedules, it does not disable the templates for future resources. For that capability, see MeasurementScheduleManagerLocal.disableAllDefaultCollections(Subject).

This is a highly disruptive method - it turns off monitoring for existing resources. The user making this call must have global inventory and setting permissions to execute this.

Specified by:
disableAllSchedules in interface MeasurementScheduleManagerLocal
Parameters:
subject - user that must have global inventory and setting rights

createSchedulesForExistingResources

public void createSchedulesForExistingResources(org.rhq.core.domain.resource.ResourceType type,
                                                org.rhq.core.domain.measurement.MeasurementDefinition newDefinition)
Description copied from interface: MeasurementScheduleManagerLocal
Create MeasurementSchedules for existing resources hanging on newType.

Specified by:
createSchedulesForExistingResources in interface MeasurementScheduleManagerLocal
Parameters:
type - The ResourceType for which we want to add schedules
newDefinition - The MeasurementDefinition where we derive the schedules from

updateDefaultCollectionIntervalForMeasurementDefinitions

public void updateDefaultCollectionIntervalForMeasurementDefinitions(org.rhq.core.domain.auth.Subject subject,
                                                                     int[] measurementDefinitionIds,
                                                                     long collectionInterval,
                                                                     boolean updateExistingSchedules)
Description copied from interface: MeasurementScheduleManagerLocal
(Re-)Enables all collection schedules in the given measurement definition IDs and sets their collection intervals. This only enables the "templates", it does not enable actual schedules unless updateExistingSchedules is set to true.

Specified by:
updateDefaultCollectionIntervalForMeasurementDefinitions in interface MeasurementScheduleManagerLocal
Parameters:
subject - a valid subject that has the MANAGE_SETTINGS global permission
measurementDefinitionIds - the primary keys for the definitions
collectionInterval - if > 0, enable the metric with this value as the the new collection interval, in milliseconds; if == 0, enable the metric with its current collection interval; if < 0, disable the metric; if >0, the value should also be >=30000, since 30s is the minimum allowed interval; if it is not, 30000 will be used instead of the specified interval
updateExistingSchedules - if true, then existing schedules for this definition will also be updated.

updateDefaultCollectionIntervalAndEnablementForMeasurementDefinitions

public void updateDefaultCollectionIntervalAndEnablementForMeasurementDefinitions(org.rhq.core.domain.auth.Subject subject,
                                                                                  int[] measurementDefinitionIds,
                                                                                  long collectionInterval,
                                                                                  boolean enable,
                                                                                  boolean updateExistingSchedules)
Description copied from interface: MeasurementScheduleManagerLocal
Using this method one can both update the default collection interval AND enable or disable the measurement definitions. This method is therefore preferable if you need to do both these things in 1 go.

Specified by:
updateDefaultCollectionIntervalAndEnablementForMeasurementDefinitions in interface MeasurementScheduleManagerLocal
Parameters:
subject - the current user
measurementDefinitionIds - the ids of measurement definitions to update
collectionInterval - the default collection interval to set
enable - whether to enable or disable the measurement definition
updateExistingSchedules - whether to accordingly update the existing schedules

updateSchedulesForContext

public int updateSchedulesForContext(org.rhq.core.domain.auth.Subject subject,
                                     org.rhq.core.domain.common.EntityContext context,
                                     int[] measurementDefinitionIds,
                                     long collectionInterval)
Specified by:
updateSchedulesForContext in interface MeasurementScheduleManagerLocal

enableSchedulesForContext

public int enableSchedulesForContext(org.rhq.core.domain.auth.Subject subject,
                                     org.rhq.core.domain.common.EntityContext context,
                                     int[] measurementDefinitionIds)
Specified by:
enableSchedulesForContext in interface MeasurementScheduleManagerLocal

disableSchedulesForContext

public int disableSchedulesForContext(org.rhq.core.domain.auth.Subject subject,
                                      org.rhq.core.domain.common.EntityContext context,
                                      int[] measurementDefinitionIds)
Specified by:
disableSchedulesForContext in interface MeasurementScheduleManagerLocal

notifyAgentsOfScheduleUpdates

public void notifyAgentsOfScheduleUpdates(org.rhq.core.domain.common.EntityContext entityContext,
                                          String scheduleSubQuery)
Description copied from interface: MeasurementScheduleManagerLocal
Notifies all agents of measurement schedule changes.

Specified by:
notifyAgentsOfScheduleUpdates in interface MeasurementScheduleManagerLocal
Parameters:
entityContext - the context.
scheduleSubQuery - the subquery indicating which schedules changed

getMeasurementScheduleSubQueryForContext

public String getMeasurementScheduleSubQueryForContext(org.rhq.core.domain.auth.Subject subject,
                                                       org.rhq.core.domain.common.EntityContext context,
                                                       int[] measurementDefinitionIds)

updateSchedulesForAutoGroup

public void updateSchedulesForAutoGroup(org.rhq.core.domain.auth.Subject subject,
                                        int parentResourceId,
                                        int childResourceType,
                                        int[] measurementDefinitionIds,
                                        long collectionInterval)
Description copied from interface: MeasurementScheduleManagerLocal
Enables all collection schedules attached to the given auto group whose schedules are based off the given definitions. This does not enable the "templates" (aka definitions). If the passed group does not exist an Exception is thrown.

Specified by:
updateSchedulesForAutoGroup in interface MeasurementScheduleManagerLocal
Parameters:
subject - Subject of the caller
parentResourceId - the Id of the parent resource
childResourceType - the ID of the ResourceType of the children that form the autogroup
measurementDefinitionIds - the definitions on which the schedules to update are based
collectionInterval - the new interval

disableSchedulesForAutoGroup

public void disableSchedulesForAutoGroup(org.rhq.core.domain.auth.Subject subject,
                                         int parentResourceId,
                                         int childResourceType,
                                         int[] measurementDefinitionIds)
Description copied from interface: MeasurementScheduleManagerLocal
Disable the measurement schedules for the passed definitions of the rsource ot the passed auto group.

Specified by:
disableSchedulesForAutoGroup in interface MeasurementScheduleManagerLocal

enableSchedulesForAutoGroup

public void enableSchedulesForAutoGroup(org.rhq.core.domain.auth.Subject subject,
                                        int parentResourceId,
                                        int childResourceType,
                                        int[] measurementDefinitionIds)
Description copied from interface: MeasurementScheduleManagerLocal
Enable the measurement schedules for the passed definitions of the resource ot the passed auto group.

Specified by:
enableSchedulesForAutoGroup in interface MeasurementScheduleManagerLocal

findSchedulesForResourceAndType

public List<org.rhq.core.domain.measurement.MeasurementSchedule> findSchedulesForResourceAndType(org.rhq.core.domain.auth.Subject subject,
                                                                                                 int resourceId,
                                                                                                 org.rhq.core.domain.measurement.DataType dataType,
                                                                                                 org.rhq.core.domain.measurement.DisplayType displayType,
                                                                                                 boolean enabledOnly)
Determine the Schedules for a Resource and DataType. The data type is used to filter out (numerical) measurement and / or traits. If it is null, then we don't filter by DataType

Specified by:
findSchedulesForResourceAndType in interface MeasurementScheduleManagerLocal
Parameters:
subject - Subject of the caller
resourceId - PK of the resource we're interested in
dataType - DataType of the desired results use null for no filtering
displayType - the display type of the property or null for no filtering
enabledOnly - should we restrict the query to certain enablement state? null means "don't care".
Returns:
List of MeasuremenSchedules for the given resource

findSchedulesByResourceIdAndDefinitionIds

public List<org.rhq.core.domain.measurement.MeasurementSchedule> findSchedulesByResourceIdAndDefinitionIds(org.rhq.core.domain.auth.Subject subject,
                                                                                                           int resourceId,
                                                                                                           int[] definitionIds)
Return a list of MeasurementSchedules for the given definition ids and resource id.

Specified by:
findSchedulesByResourceIdAndDefinitionIds in interface MeasurementScheduleManagerLocal
Parameters:
definitionIds -
resourceId -
Returns:
a list of Schedules

insertSchedulesFor

public int insertSchedulesFor(int[] batchIds)
                       throws Exception
Specified by:
insertSchedulesFor in interface MeasurementScheduleManagerLocal
Throws:
Exception

returnSchedulesFor

public int returnSchedulesFor(int[] batchIds,
                              Set<org.rhq.core.domain.measurement.ResourceMeasurementScheduleRequest> allSchedules)
                       throws Exception
Specified by:
returnSchedulesFor in interface MeasurementScheduleManagerLocal
Throws:
Exception

getScheduledMeasurementsPerMinute

public int getScheduledMeasurementsPerMinute()
Specified by:
getScheduledMeasurementsPerMinute in interface MeasurementScheduleManagerLocal
Returns:
a rounded count of the average number of metrics that are scheduled per minute

errorCorrectSchedules

public void errorCorrectSchedules()
Description copied from interface: MeasurementScheduleManagerLocal
This method should be called when it is determined that the data in the measurement schedule table might be corrupt. This happens when the schedules get a collection interval of less than 30 seconds. Execution of this method will automatically correct that situation, and update the mtime's of the corresponding resources whose schedules were corrupt, to cause the agent to synchronize those schedules.

Specified by:
errorCorrectSchedules in interface MeasurementScheduleManagerLocal

disableSchedulesForResource

public void disableSchedulesForResource(org.rhq.core.domain.auth.Subject subject,
                                        int resourceId,
                                        int[] measurementDefinitionIds)
Description copied from interface: MeasurementScheduleManagerLocal
Disables all collection schedules attached to the given resource whose schedules are based off the given definitions. This does not disable the "templates" (aka definitions).

Specified by:
disableSchedulesForResource in interface MeasurementScheduleManagerLocal
Specified by:
disableSchedulesForResource in interface MeasurementScheduleManagerRemote

disableSchedulesForCompatibleGroup

public void disableSchedulesForCompatibleGroup(org.rhq.core.domain.auth.Subject subject,
                                               int groupId,
                                               int[] measurementDefinitionIds)
Description copied from interface: MeasurementScheduleManagerLocal
Disable the measurement schedules for the passed definitions for the resources of the passed compatible group.

Specified by:
disableSchedulesForCompatibleGroup in interface MeasurementScheduleManagerLocal
Specified by:
disableSchedulesForCompatibleGroup in interface MeasurementScheduleManagerRemote

disableMeasurementTemplates

public void disableMeasurementTemplates(org.rhq.core.domain.auth.Subject subject,
                                        int[] measurementDefinitionIds)
Specified by:
disableMeasurementTemplates in interface MeasurementScheduleManagerLocal
Specified by:
disableMeasurementTemplates in interface MeasurementScheduleManagerRemote

enableSchedulesForResource

public void enableSchedulesForResource(org.rhq.core.domain.auth.Subject subject,
                                       int resourceId,
                                       int[] measurementDefinitionIds)
Description copied from interface: MeasurementScheduleManagerLocal
Enable the schedules for the provided definitions and resource

Specified by:
enableSchedulesForResource in interface MeasurementScheduleManagerLocal
Specified by:
enableSchedulesForResource in interface MeasurementScheduleManagerRemote

enableSchedulesForCompatibleGroup

public void enableSchedulesForCompatibleGroup(org.rhq.core.domain.auth.Subject subject,
                                              int groupId,
                                              int[] measurementDefinitionIds)
Description copied from interface: MeasurementScheduleManagerLocal
Enable the measurement schedules for the passed definitions for the resources of the passed compatible group.

Specified by:
enableSchedulesForCompatibleGroup in interface MeasurementScheduleManagerLocal
Specified by:
enableSchedulesForCompatibleGroup in interface MeasurementScheduleManagerRemote

enableMeasurementTemplates

public void enableMeasurementTemplates(org.rhq.core.domain.auth.Subject subject,
                                       int[] measurementDefinitionIds)
Specified by:
enableMeasurementTemplates in interface MeasurementScheduleManagerLocal
Specified by:
enableMeasurementTemplates in interface MeasurementScheduleManagerRemote

updateSchedule

public void updateSchedule(org.rhq.core.domain.auth.Subject subject,
                           org.rhq.core.domain.measurement.MeasurementSchedule schedule)
Description copied from interface: MeasurementScheduleManagerLocal
Reattach a Schedule to a PersitenceContext after a successful check for a valid session

Specified by:
updateSchedule in interface MeasurementScheduleManagerLocal
Specified by:
updateSchedule in interface MeasurementScheduleManagerRemote
Parameters:
subject - A subject that must be valid
schedule - A MeasurementSchedule to persist.

updateSchedulesForResource

public void updateSchedulesForResource(org.rhq.core.domain.auth.Subject subject,
                                       int resourceId,
                                       int[] measurementDefinitionIds,
                                       long collectionInterval)
Description copied from interface: MeasurementScheduleManagerLocal
Enables all collection schedules attached to the given resource whose schedules are based off the given definitions. This does not enable the "templates" (aka definitions).

Specified by:
updateSchedulesForResource in interface MeasurementScheduleManagerLocal
Specified by:
updateSchedulesForResource in interface MeasurementScheduleManagerRemote

updateSchedulesForCompatibleGroup

public void updateSchedulesForCompatibleGroup(org.rhq.core.domain.auth.Subject subject,
                                              int groupId,
                                              int[] measurementDefinitionIds,
                                              long collectionInterval)
Description copied from interface: MeasurementScheduleManagerLocal
Enables all collection schedules attached to the given compatible group whose schedules are based off the given definitions. This does not enable the "templates" (aka definitions). If the passed group is not compatible or does not exist an Exception is thrown.

Specified by:
updateSchedulesForCompatibleGroup in interface MeasurementScheduleManagerLocal
Specified by:
updateSchedulesForCompatibleGroup in interface MeasurementScheduleManagerRemote
Parameters:
subject - Subject of the caller
groupId - ID of the group
measurementDefinitionIds - the definitions on which the schedules to update are based
collectionInterval - the new interval

updateMeasurementTemplates

public void updateMeasurementTemplates(org.rhq.core.domain.auth.Subject subject,
                                       int[] measurementDefinitionIds,
                                       long collectionInterval)
Description copied from interface: MeasurementScheduleManagerLocal
Update default measurement schedules ("metric templates").

Specified by:
updateMeasurementTemplates in interface MeasurementScheduleManagerLocal
Specified by:
updateMeasurementTemplates in interface MeasurementScheduleManagerRemote
Parameters:
subject - Subject of the caller
measurementDefinitionIds - the definitions on which the default schedules to update are based
collectionInterval - the new interval

getMeasurementScheduleCompositesByContext

public org.rhq.core.domain.util.PageList<org.rhq.core.domain.measurement.composite.MeasurementScheduleComposite> getMeasurementScheduleCompositesByContext(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                                           org.rhq.core.domain.common.EntityContext context,
                                                                                                                                                           org.rhq.core.domain.util.PageControl pc)
Specified by:
getMeasurementScheduleCompositesByContext in interface MeasurementScheduleManagerLocal

findSchedulesByCriteria

public org.rhq.core.domain.util.PageList<org.rhq.core.domain.measurement.MeasurementSchedule> findSchedulesByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                                                      org.rhq.core.domain.criteria.MeasurementScheduleCriteria criteria)
Description copied from interface: MeasurementScheduleManagerLocal
TODO

Specified by:
findSchedulesByCriteria in interface MeasurementScheduleManagerLocal
Specified by:
findSchedulesByCriteria in interface MeasurementScheduleManagerRemote


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