public class MeasurementScheduleManagerBean extends Object implements MeasurementScheduleManagerLocal, MeasurementScheduleManagerRemote
MeasurementSchedules.| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
MeasurementScheduleManagerBean() |
| Modifier and Type | Method and Description |
|---|---|
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)
Deprecated.
|
void |
disableAllSchedules(org.rhq.core.domain.auth.Subject subject)
Deprecated.
|
void |
disableDefaultCollectionForMeasurementDefinitions(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds,
boolean updateSchedules)
Deprecated.
|
void |
disableMeasurementTemplates(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds)
Deprecated.
|
void |
disableSchedulesForAutoGroup(org.rhq.core.domain.auth.Subject subject,
int parentResourceId,
int childResourceType,
int[] measurementDefinitionIds)
Deprecated.
|
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 |
disableSchedulesForResourceType(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds,
boolean updateExistingSchedules)
Requires MANAGE_SETTINGS global permission.
|
void |
enableMeasurementTemplates(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds)
Deprecated.
|
void |
enableSchedulesForAutoGroup(org.rhq.core.domain.auth.Subject subject,
int parentResourceId,
int childResourceType,
int[] measurementDefinitionIds)
Deprecated.
|
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 |
enableSchedulesForResourceType(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds,
boolean updateExistingSchedules)
Requires MANAGE_SETTINGS global permission.
|
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) |
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)
Deprecated.
|
void |
updateMeasurementTemplates(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds,
long collectionInterval)
Deprecated.
|
void |
updateSchedule(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.measurement.MeasurementSchedule schedule) |
void |
updateSchedulesForAutoGroup(org.rhq.core.domain.auth.Subject subject,
int parentResourceId,
int childResourceType,
int[] measurementDefinitionIds,
long collectionInterval)
Deprecated.
used for portal war
|
void |
updateSchedulesForCompatibleGroup(org.rhq.core.domain.auth.Subject subject,
int groupId,
int[] measurementDefinitionIds,
long collectionInterval) |
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) |
void |
updateSchedulesForResourceType(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds,
long collectionInterval,
boolean updateExistingSchedules)
Requires MANAGE_SETTINGS global permission.
|
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
public Set<org.rhq.core.domain.measurement.ResourceMeasurementScheduleRequest> findSchedulesForResourceAndItsDescendants(int[] resourceIds, boolean getDescendents)
MeasurementScheduleManagerLocalfindSchedulesForResourceAndItsDescendants in interface MeasurementScheduleManagerLocalresourceIds - IDs of the resources whose measurements are to be returnedgetDescendents - if true, descendents will be loaded as wellpublic AgentClient getAgentClientForSchedule(org.rhq.core.domain.measurement.MeasurementSchedule sched)
getAgentClientForSchedule in interface MeasurementScheduleManagerLocalsched - A MeasurementSchedule for which we need a connection to the Agentpublic org.rhq.core.domain.measurement.MeasurementSchedule getScheduleById(int scheduleId)
scheduleId - the id of the desired schedulepublic List<org.rhq.core.domain.measurement.MeasurementSchedule> findSchedulesByIds(int[] scheduleIds)
findSchedulesByIds in interface MeasurementScheduleManagerLocalscheduleIds - PrimaryKeys of the schedules searchedpublic 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 Schedulepublic 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 wantedpublic List<org.rhq.core.domain.measurement.MeasurementSchedule> findSchedulesByResourceIdsAndDefinitionIds(int[] resourceIds, int[] definitionIds)
MeasurementScheduleManagerLocalfindSchedulesByResourceIdsAndDefinitionIds in interface MeasurementScheduleManagerLocalresourceIds - The ids of the resource for which schedules are being fetcheddefinitionIds - The ids of the the measurement definitionspublic 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 callerMeasurementNotFoundException@Deprecated public void disableDefaultCollectionForMeasurementDefinitions(org.rhq.core.domain.auth.Subject subject, int[] measurementDefinitionIds, boolean updateSchedules)
MeasurementScheduleManagerLocal#disableSchedules(Subject, int[], int).disableDefaultCollectionForMeasurementDefinitions in interface MeasurementScheduleManagerLocalupdateSchedules - TODO@Deprecated public 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 rights@Deprecated public 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 rightspublic 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@Deprecated public void updateDefaultCollectionIntervalForMeasurementDefinitions(org.rhq.core.domain.auth.Subject subject, int[] measurementDefinitionIds, long collectionInterval, boolean updateExistingSchedules)
MeasurementScheduleManagerLocalupdateDefaultCollectionIntervalForMeasurementDefinitions 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)
MeasurementScheduleManagerLocalupdateDefaultCollectionIntervalAndEnablementForMeasurementDefinitions 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 schedulespublic int updateSchedulesForContext(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.common.EntityContext context,
int[] measurementDefinitionIds,
long collectionInterval)
updateSchedulesForContext in interface MeasurementScheduleManagerLocalpublic int enableSchedulesForContext(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.common.EntityContext context,
int[] measurementDefinitionIds)
enableSchedulesForContext in interface MeasurementScheduleManagerLocalpublic int disableSchedulesForContext(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.common.EntityContext context,
int[] measurementDefinitionIds)
disableSchedulesForContext in interface MeasurementScheduleManagerLocalpublic void notifyAgentsOfScheduleUpdates(org.rhq.core.domain.common.EntityContext entityContext,
String scheduleSubQuery)
MeasurementScheduleManagerLocalnotifyAgentsOfScheduleUpdates in interface MeasurementScheduleManagerLocalentityContext - the context.scheduleSubQuery - the subquery indicating which schedules changedpublic 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)
MeasurementScheduleManagerLocalupdateSchedulesForAutoGroup 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@Deprecated public void disableSchedulesForAutoGroup(org.rhq.core.domain.auth.Subject subject, int parentResourceId, int childResourceType, int[] measurementDefinitionIds)
MeasurementScheduleManagerLocaldisableSchedulesForAutoGroup in interface MeasurementScheduleManagerLocal@Deprecated public void enableSchedulesForAutoGroup(org.rhq.core.domain.auth.Subject subject, int parentResourceId, int childResourceType, int[] measurementDefinitionIds)
MeasurementScheduleManagerLocalenableSchedulesForAutoGroup in interface MeasurementScheduleManagerLocalpublic 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 MeasurementScheduleManagerLocalExceptionpublic 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()
MeasurementScheduleManagerLocalerrorCorrectSchedules in interface MeasurementScheduleManagerLocalpublic void disableSchedulesForResource(org.rhq.core.domain.auth.Subject subject,
int resourceId,
int[] measurementDefinitionIds)
MeasurementScheduleManagerRemotedisableSchedulesForResource in interface MeasurementScheduleManagerRemotepublic void disableSchedulesForCompatibleGroup(org.rhq.core.domain.auth.Subject subject,
int groupId,
int[] measurementDefinitionIds)
MeasurementScheduleManagerRemotedisableSchedulesForCompatibleGroup in interface MeasurementScheduleManagerRemotepublic void disableSchedulesForResourceType(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds,
boolean updateExistingSchedules)
MeasurementScheduleManagerRemotedisableSchedulesForResourceType in interface MeasurementScheduleManagerRemote@Deprecated public void disableMeasurementTemplates(org.rhq.core.domain.auth.Subject subject, int[] measurementDefinitionIds)
disableMeasurementTemplates in interface MeasurementScheduleManagerRemotepublic void enableSchedulesForResource(org.rhq.core.domain.auth.Subject subject,
int resourceId,
int[] measurementDefinitionIds)
MeasurementScheduleManagerRemoteenableSchedulesForResource in interface MeasurementScheduleManagerRemotepublic void enableSchedulesForCompatibleGroup(org.rhq.core.domain.auth.Subject subject,
int groupId,
int[] measurementDefinitionIds)
MeasurementScheduleManagerRemoteenableSchedulesForCompatibleGroup in interface MeasurementScheduleManagerRemotepublic void enableSchedulesForResourceType(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds,
boolean updateExistingSchedules)
MeasurementScheduleManagerRemoteenableSchedulesForResourceType in interface MeasurementScheduleManagerRemotepublic void enableMeasurementTemplates(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds)
enableMeasurementTemplates in interface MeasurementScheduleManagerRemotepublic void updateSchedule(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.measurement.MeasurementSchedule schedule)
updateSchedule 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)
updateSchedulesForResource in interface MeasurementScheduleManagerRemotepublic void updateSchedulesForCompatibleGroup(org.rhq.core.domain.auth.Subject subject,
int groupId,
int[] measurementDefinitionIds,
long collectionInterval)
updateSchedulesForCompatibleGroup in interface MeasurementScheduleManagerRemotepublic void updateSchedulesForResourceType(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds,
long collectionInterval,
boolean updateExistingSchedules)
MeasurementScheduleManagerRemoteupdateSchedulesForResourceType in interface MeasurementScheduleManagerRemote@Deprecated public void updateMeasurementTemplates(org.rhq.core.domain.auth.Subject subject, int[] measurementDefinitionIds, long collectionInterval)
updateMeasurementTemplates in interface MeasurementScheduleManagerRemotepublic 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 MeasurementScheduleManagerLocalpublic 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)
findSchedulesByCriteria in interface MeasurementScheduleManagerRemoteCopyright © 2008-2013 Red Hat, Inc.. All Rights Reserved.