|
||||||||||
| 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)
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. |
| 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
@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 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
@Deprecated
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
@Deprecated
public void disableSchedulesForAutoGroup(org.rhq.core.domain.auth.Subject subject,
int parentResourceId,
int childResourceType,
int[] measurementDefinitionIds)
MeasurementScheduleManagerLocal
disableSchedulesForAutoGroup in interface MeasurementScheduleManagerLocal
@Deprecated
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)
MeasurementScheduleManagerRemote
disableSchedulesForResource in interface MeasurementScheduleManagerRemote
public void disableSchedulesForCompatibleGroup(org.rhq.core.domain.auth.Subject subject,
int groupId,
int[] measurementDefinitionIds)
MeasurementScheduleManagerRemote
disableSchedulesForCompatibleGroup in interface MeasurementScheduleManagerRemote
public void disableSchedulesForResourceType(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds,
boolean updateExistingSchedules)
MeasurementScheduleManagerRemote
disableSchedulesForResourceType in interface MeasurementScheduleManagerRemote
@Deprecated
public void disableMeasurementTemplates(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds)
disableMeasurementTemplates in interface MeasurementScheduleManagerRemote
public void enableSchedulesForResource(org.rhq.core.domain.auth.Subject subject,
int resourceId,
int[] measurementDefinitionIds)
MeasurementScheduleManagerRemote
enableSchedulesForResource in interface MeasurementScheduleManagerRemote
public void enableSchedulesForCompatibleGroup(org.rhq.core.domain.auth.Subject subject,
int groupId,
int[] measurementDefinitionIds)
MeasurementScheduleManagerRemote
enableSchedulesForCompatibleGroup in interface MeasurementScheduleManagerRemote
public void enableSchedulesForResourceType(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds,
boolean updateExistingSchedules)
MeasurementScheduleManagerRemote
enableSchedulesForResourceType in interface MeasurementScheduleManagerRemote
public void enableMeasurementTemplates(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds)
enableMeasurementTemplates in interface MeasurementScheduleManagerRemote
public 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 MeasurementScheduleManagerRemote
public void updateSchedulesForCompatibleGroup(org.rhq.core.domain.auth.Subject subject,
int groupId,
int[] measurementDefinitionIds,
long collectionInterval)
updateSchedulesForCompatibleGroup in interface MeasurementScheduleManagerRemote
public void updateSchedulesForResourceType(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds,
long collectionInterval,
boolean updateExistingSchedules)
MeasurementScheduleManagerRemote
updateSchedulesForResourceType in interface MeasurementScheduleManagerRemote
@Deprecated
public void updateMeasurementTemplates(org.rhq.core.domain.auth.Subject subject,
int[] measurementDefinitionIds,
long collectionInterval)
updateMeasurementTemplates in interface MeasurementScheduleManagerRemote
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)
findSchedulesByCriteria in interface MeasurementScheduleManagerRemote
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||