|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.server.measurement.MeasurementScheduleManagerBean
public class MeasurementScheduleManagerBean
A manager for MeasurementSchedules.
| 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 |
|---|
public static final String TRIGGER_NAME
public static final String TRIGGER_GROUP_NAME
public static final String SCHEDULE_SUBQUERY
public static final String ENTITYCONTEXT_RESOURCEID
public static final String ENTITYCONTEXT_GROUPID
public static final String ENTITYCONTEXT_PARENT_RESOURCEID
public static final String ENTITYCONTEXT_RESOURCETYPEID
| Constructor Detail |
|---|
public MeasurementScheduleManagerBean()
| Method Detail |
|---|
public Set<org.rhq.core.domain.measurement.ResourceMeasurementScheduleRequest> findSchedulesForResourceAndItsDescendants(int[] resourceIds,
boolean getDescendents)
MeasurementScheduleManagerLocal
findSchedulesForResourceAndItsDescendants in interface MeasurementScheduleManagerLocalresourceIds - IDs of the resources whose measurements are to be returnedgetDescendents - if true, descendents will be loaded as well
public AgentClient getAgentClientForSchedule(org.rhq.core.domain.measurement.MeasurementSchedule sched)
getAgentClientForSchedule in interface MeasurementScheduleManagerLocalsched - A MeasurementSchedule for which we need a connection to the Agent
public org.rhq.core.domain.measurement.MeasurementSchedule getScheduleById(int scheduleId)
scheduleId - the id of the desired schedule
public List<org.rhq.core.domain.measurement.MeasurementSchedule> findSchedulesByIds(int[] scheduleIds)
findSchedulesByIds in interface MeasurementScheduleManagerLocalscheduleIds - PrimaryKeys of the schedules searched
public org.rhq.core.domain.measurement.MeasurementSchedule getScheduleById(org.rhq.core.domain.auth.Subject subject,
int scheduleId)
getScheduleById in interface MeasurementScheduleManagerLocalsubject - a session id that must be validscheduleId - The primary key of the Schedule
public List<org.rhq.core.domain.measurement.MeasurementSchedule> findSchedulesByResourceIdsAndDefinitionId(org.rhq.core.domain.auth.Subject subject,
int[] resourceIds,
int definitionId)
findSchedulesByResourceIdsAndDefinitionId in interface MeasurementScheduleManagerLocalsubject - A subject that must be validdefinitionId - The primary key of a MeasurementDefinitionresourceIds - primary of Resources wanted
public List<org.rhq.core.domain.measurement.MeasurementSchedule> findSchedulesByResourceIdsAndDefinitionIds(int[] resourceIds,
int[] definitionIds)
MeasurementScheduleManagerLocal
findSchedulesByResourceIdsAndDefinitionIds in interface MeasurementScheduleManagerLocalresourceIds - The ids of the resource for which schedules are being fetcheddefinitionIds - The ids of the the measurement definitions
public org.rhq.core.domain.measurement.MeasurementSchedule getSchedule(org.rhq.core.domain.auth.Subject subject,
int resourceId,
int definitionId,
boolean attachBaseline)
throws MeasurementNotFoundException
getSchedule in interface MeasurementScheduleManagerLocalsubject - definitionId - The primary key of a MeasurementDefinitionresourceId - the id of the resourceattachBaseline - 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
MeasurementNotFoundException
public void disableDefaultCollectionForMeasurementDefinitions(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds,
boolean updateSchedules)
MeasurementScheduleManagerLocal#disableSchedules(Subject, int[], int).
disableDefaultCollectionForMeasurementDefinitions in interface MeasurementScheduleManagerLocalupdateSchedules - TODOpublic void disableAllDefaultCollections(org.rhq.core.domain.auth.Subject subject)
MeasurementScheduleManagerLocal#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.
disableAllDefaultCollections in interface MeasurementScheduleManagerLocalsubject - user that must have global inventory and setting rightspublic void disableAllSchedules(org.rhq.core.domain.auth.Subject subject)
MeasurementScheduleManagerLocalMeasurementScheduleManagerLocal.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.
disableAllSchedules in interface MeasurementScheduleManagerLocalsubject - user that must have global inventory and setting rights
public void createSchedulesForExistingResources(org.rhq.core.domain.resource.ResourceType type,
org.rhq.core.domain.measurement.MeasurementDefinition newDefinition)
MeasurementScheduleManagerLocalMeasurementSchedules for existing resources hanging on newType.
createSchedulesForExistingResources in interface MeasurementScheduleManagerLocaltype - The ResourceType for which we want to add schedulesnewDefinition - The MeasurementDefinition where we derive the schedules from
public void updateDefaultCollectionIntervalForMeasurementDefinitions(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds,
long collectionInterval,
boolean updateExistingSchedules)
MeasurementScheduleManagerLocal
updateDefaultCollectionIntervalForMeasurementDefinitions in interface MeasurementScheduleManagerLocalsubject - a valid subject that has the MANAGE_SETTINGS
global permissionmeasurementDefinitionIds - the primary keys for the definitionscollectionInterval - 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 intervalupdateExistingSchedules - if true, then existing schedules for this definition will also be updated.
public void updateDefaultCollectionIntervalAndEnablementForMeasurementDefinitions(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds,
long collectionInterval,
boolean enable,
boolean updateExistingSchedules)
MeasurementScheduleManagerLocal
updateDefaultCollectionIntervalAndEnablementForMeasurementDefinitions in interface MeasurementScheduleManagerLocalsubject - the current usermeasurementDefinitionIds - the ids of measurement definitions to updatecollectionInterval - the default collection interval to setenable - whether to enable or disable the measurement definitionupdateExistingSchedules - whether to accordingly update the existing schedules
public int updateSchedulesForContext(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.common.EntityContext context,
int[] measurementDefinitionIds,
long collectionInterval)
updateSchedulesForContext in interface MeasurementScheduleManagerLocal
public int enableSchedulesForContext(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.common.EntityContext context,
int[] measurementDefinitionIds)
enableSchedulesForContext in interface MeasurementScheduleManagerLocal
public int disableSchedulesForContext(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.common.EntityContext context,
int[] measurementDefinitionIds)
disableSchedulesForContext in interface MeasurementScheduleManagerLocal
public void notifyAgentsOfScheduleUpdates(org.rhq.core.domain.common.EntityContext entityContext,
String scheduleSubQuery)
MeasurementScheduleManagerLocal
notifyAgentsOfScheduleUpdates in interface MeasurementScheduleManagerLocalentityContext - the context.scheduleSubQuery - the subquery indicating which schedules changed
public String getMeasurementScheduleSubQueryForContext(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.common.EntityContext context,
int[] measurementDefinitionIds)
public void updateSchedulesForAutoGroup(org.rhq.core.domain.auth.Subject subject,
int parentResourceId,
int childResourceType,
int[] measurementDefinitionIds,
long collectionInterval)
MeasurementScheduleManagerLocal
updateSchedulesForAutoGroup in interface MeasurementScheduleManagerLocalsubject - Subject of the callerparentResourceId - the Id of the parent resourcechildResourceType - the ID of the ResourceType of the children that form the autogroupmeasurementDefinitionIds - the definitions on which the schedules to update are basedcollectionInterval - the new interval
public void disableSchedulesForAutoGroup(org.rhq.core.domain.auth.Subject subject,
int parentResourceId,
int childResourceType,
int[] measurementDefinitionIds)
MeasurementScheduleManagerLocal
disableSchedulesForAutoGroup in interface MeasurementScheduleManagerLocal
public void enableSchedulesForAutoGroup(org.rhq.core.domain.auth.Subject subject,
int parentResourceId,
int childResourceType,
int[] measurementDefinitionIds)
MeasurementScheduleManagerLocal
enableSchedulesForAutoGroup in interface MeasurementScheduleManagerLocal
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)
findSchedulesForResourceAndType in interface MeasurementScheduleManagerLocalsubject - Subject of the callerresourceId - PK of the resource we're interested indataType - DataType of the desired results use null for no filteringdisplayType - the display type of the property or null for no filteringenabledOnly - should we restrict the query to certain enablement state? null means "don't care".
public List<org.rhq.core.domain.measurement.MeasurementSchedule> findSchedulesByResourceIdAndDefinitionIds(org.rhq.core.domain.auth.Subject subject,
int resourceId,
int[] definitionIds)
findSchedulesByResourceIdAndDefinitionIds in interface MeasurementScheduleManagerLocaldefinitionIds - resourceId -
public int insertSchedulesFor(int[] batchIds)
throws Exception
insertSchedulesFor in interface MeasurementScheduleManagerLocalException
public int returnSchedulesFor(int[] batchIds,
Set<org.rhq.core.domain.measurement.ResourceMeasurementScheduleRequest> allSchedules)
throws Exception
returnSchedulesFor in interface MeasurementScheduleManagerLocalExceptionpublic int getScheduledMeasurementsPerMinute()
getScheduledMeasurementsPerMinute in interface MeasurementScheduleManagerLocalpublic void errorCorrectSchedules()
MeasurementScheduleManagerLocal
errorCorrectSchedules in interface MeasurementScheduleManagerLocal
public void disableSchedulesForResource(org.rhq.core.domain.auth.Subject subject,
int resourceId,
int[] measurementDefinitionIds)
MeasurementScheduleManagerLocal
disableSchedulesForResource in interface MeasurementScheduleManagerLocaldisableSchedulesForResource in interface MeasurementScheduleManagerRemote
public void disableSchedulesForCompatibleGroup(org.rhq.core.domain.auth.Subject subject,
int groupId,
int[] measurementDefinitionIds)
MeasurementScheduleManagerLocal
disableSchedulesForCompatibleGroup in interface MeasurementScheduleManagerLocaldisableSchedulesForCompatibleGroup in interface MeasurementScheduleManagerRemote
public void disableMeasurementTemplates(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds)
disableMeasurementTemplates in interface MeasurementScheduleManagerLocaldisableMeasurementTemplates in interface MeasurementScheduleManagerRemote
public void enableSchedulesForResource(org.rhq.core.domain.auth.Subject subject,
int resourceId,
int[] measurementDefinitionIds)
MeasurementScheduleManagerLocal
enableSchedulesForResource in interface MeasurementScheduleManagerLocalenableSchedulesForResource in interface MeasurementScheduleManagerRemote
public void enableSchedulesForCompatibleGroup(org.rhq.core.domain.auth.Subject subject,
int groupId,
int[] measurementDefinitionIds)
MeasurementScheduleManagerLocal
enableSchedulesForCompatibleGroup in interface MeasurementScheduleManagerLocalenableSchedulesForCompatibleGroup in interface MeasurementScheduleManagerRemote
public void enableMeasurementTemplates(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds)
enableMeasurementTemplates in interface MeasurementScheduleManagerLocalenableMeasurementTemplates in interface MeasurementScheduleManagerRemote
public void updateSchedule(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.measurement.MeasurementSchedule schedule)
MeasurementScheduleManagerLocal
updateSchedule in interface MeasurementScheduleManagerLocalupdateSchedule in interface MeasurementScheduleManagerRemotesubject - A subject that must be validschedule - A MeasurementSchedule to persist.
public void updateSchedulesForResource(org.rhq.core.domain.auth.Subject subject,
int resourceId,
int[] measurementDefinitionIds,
long collectionInterval)
MeasurementScheduleManagerLocal
updateSchedulesForResource in interface MeasurementScheduleManagerLocalupdateSchedulesForResource in interface MeasurementScheduleManagerRemote
public void updateSchedulesForCompatibleGroup(org.rhq.core.domain.auth.Subject subject,
int groupId,
int[] measurementDefinitionIds,
long collectionInterval)
MeasurementScheduleManagerLocal
updateSchedulesForCompatibleGroup in interface MeasurementScheduleManagerLocalupdateSchedulesForCompatibleGroup in interface MeasurementScheduleManagerRemotesubject - Subject of the callergroupId - ID of the groupmeasurementDefinitionIds - the definitions on which the schedules to update are basedcollectionInterval - the new interval
public void updateMeasurementTemplates(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds,
long collectionInterval)
MeasurementScheduleManagerLocal
updateMeasurementTemplates in interface MeasurementScheduleManagerLocalupdateMeasurementTemplates in interface MeasurementScheduleManagerRemotesubject - Subject of the callermeasurementDefinitionIds - the definitions on which the default schedules to update are basedcollectionInterval - the new interval
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)
getMeasurementScheduleCompositesByContext in interface MeasurementScheduleManagerLocal
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)
MeasurementScheduleManagerLocal
findSchedulesByCriteria in interface MeasurementScheduleManagerLocalfindSchedulesByCriteria in interface MeasurementScheduleManagerRemote
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||