org.rhq.enterprise.server.operation
Interface OperationManagerLocal

All Known Implementing Classes:
OperationManagerBean

public interface OperationManagerLocal


Method Summary
 void cancelOperationHistory(org.rhq.core.domain.auth.Subject subject, int historyId, boolean ignoreAgentErrors)
          Cancels a currently in-progress operation.
 void checkForCompletedGroupOperation(int historyId)
          This is, for all intents and purposes, and internal method.
 void checkForTimedOutOperations(org.rhq.core.domain.auth.Subject whoami)
          Will check to see if any in progress operation jobs are taking too long to finish and if so marks their histories as failed.
 void deleteOperationHistory(org.rhq.core.domain.auth.Subject subject, int historyId, boolean purgeInProgress)
          Purges the history from the database.
 void deleteOperationScheduleEntity(org.rhq.core.domain.operation.ScheduleJobId jobId)
          This will delete an operation schedule entity identified with the given job ID.
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.GroupOperationHistory> findCompletedGroupOperationHistories(org.rhq.core.domain.auth.Subject subject, int groupId, org.rhq.core.domain.util.PageControl pc)
          Returns the list of completed operation histories for the group resource.
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.ResourceOperationHistory> findCompletedResourceOperationHistories(org.rhq.core.domain.auth.Subject subject, int resourceId, Long startDate, Long endDate, org.rhq.core.domain.util.PageControl pc)
          Returns the list of completed operation histories for the given resource.
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.composite.GroupOperationScheduleComposite> findCurrentlyScheduledGroupOperations(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.util.PageControl pc)
          Gets a list of all currently scheduled group operations (that is, scheduled but not yet invoked and/or completed).
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.composite.ResourceOperationScheduleComposite> findCurrentlyScheduledResourceOperations(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.util.PageControl pc)
          Gets a list of all currently scheduled resource operations (that is, scheduled but not yet invoked and/or completed).
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.GroupOperationHistory> findGroupOperationHistoriesByCriteria(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.GroupOperationHistoryCriteria criteria)
           
 List<org.rhq.core.domain.operation.OperationDefinition> findOperationDefinitionsByCriteria(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.OperationDefinitionCriteria criteria)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.GroupOperationHistory> findPendingGroupOperationHistories(org.rhq.core.domain.auth.Subject subject, int groupId, org.rhq.core.domain.util.PageControl pc)
          Returns the list of pending operation histories for the group resource.
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.ResourceOperationHistory> findPendingResourceOperationHistories(org.rhq.core.domain.auth.Subject subject, int resourceId, org.rhq.core.domain.util.PageControl pc)
          Returns the list of pending operation histories for the given resource.
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.composite.GroupOperationLastCompletedComposite> findRecentlyCompletedGroupOperations(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.util.PageControl pc)
          Gets a list of all recently completed group operations.
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.composite.ResourceOperationLastCompletedComposite> findRecentlyCompletedResourceOperations(org.rhq.core.domain.auth.Subject subject, Integer resourceId, org.rhq.core.domain.util.PageControl pc)
          Gets a list of all recently completed resource operations.
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.ResourceOperationHistory> findResourceOperationHistoriesByCriteria(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria criteria)
           
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.ResourceOperationHistory> findResourceOperationHistoriesByGroupHistoryId(org.rhq.core.domain.auth.Subject subject, int historyId, org.rhq.core.domain.util.PageControl pc)
          Get the paged resource operation histories for a given group history.
 List<org.rhq.core.domain.operation.bean.GroupOperationSchedule> findScheduledGroupOperations(org.rhq.core.domain.auth.Subject subject, int groupId)
          Returns the list of schedules for the group itself.
 List<org.rhq.core.domain.operation.bean.ResourceOperationSchedule> findScheduledResourceOperations(org.rhq.core.domain.auth.Subject subject, int resourceId)
          Returns the list of scheduled operations for the given resource.
 List<org.rhq.core.domain.operation.OperationDefinition> findSupportedGroupOperations(org.rhq.core.domain.auth.Subject subject, int compatibleGroupId, boolean eagerLoaded)
          Returns the definitions of all the operations supported by the given group.
 List<org.rhq.core.domain.operation.OperationDefinition> findSupportedResourceOperations(org.rhq.core.domain.auth.Subject subject, int resourceId, boolean eagerLoaded)
          Returns the definitions of all the operations supported by the given resource.
 List<org.rhq.core.domain.operation.OperationDefinition> findSupportedResourceTypeOperations(org.rhq.core.domain.auth.Subject subject, int resourceTypeId, boolean eagerLoaded)
          Returns the definitions of all the operations supported by the given resource type.
 org.rhq.core.domain.operation.bean.GroupOperationSchedule getGroupOperationSchedule(org.rhq.core.domain.auth.Subject whoami, int scheduleId)
          TODO
 org.rhq.core.domain.operation.bean.GroupOperationSchedule getGroupOperationSchedule(org.rhq.core.domain.auth.Subject subject, org.quartz.JobDetail jobDetail)
          Given a group operation job's details, this returns a schedule POJO corresponding to that job.
 org.rhq.core.domain.operation.bean.GroupOperationSchedule getGroupOperationSchedule(org.rhq.core.domain.auth.Subject subject, String jobId)
          Given a group job's id, this returns the schedule for that group job.
 org.rhq.core.domain.operation.ResourceOperationHistory getLatestCompletedResourceOperation(org.rhq.core.domain.auth.Subject subject, int resourceId)
          Get the mostly recently run operation for the Resource with the given id, or null if the resource has had no operations performed against it yet (or if all previously performed operations have been deleted from the history).
 org.rhq.core.domain.operation.ResourceOperationHistory getOldestInProgressResourceOperation(org.rhq.core.domain.auth.Subject subject, int resourceId)
          Get the oldest operation still in progress for the Resource with the given id, or null if the resource has no operations being performed against it.
 org.rhq.core.domain.operation.OperationDefinition getOperationDefinition(org.rhq.core.domain.auth.Subject subject, int operationId)
          Get the OperationDefinition object that corresponds to this operationId
 org.rhq.core.domain.operation.OperationDefinition getOperationDefinitionByResourceTypeAndName(int resourceTypeId, String operationName, boolean eagerLoaded)
           
 org.rhq.core.domain.operation.OperationHistory getOperationHistoryByHistoryId(org.rhq.core.domain.auth.Subject subject, int historyId)
          TODO
 org.rhq.core.domain.operation.OperationHistory getOperationHistoryByJobId(org.rhq.core.domain.auth.Subject subject, String historyJobId)
          TODO
 List<org.rhq.core.domain.common.composite.IntegerOptionItem> getResourceNameOptionItems(int groupId)
          TODO
 org.rhq.core.domain.operation.bean.ResourceOperationSchedule getResourceOperationSchedule(org.rhq.core.domain.auth.Subject whoami, int scheduleId)
          TODO
 org.rhq.core.domain.operation.bean.ResourceOperationSchedule getResourceOperationSchedule(org.rhq.core.domain.auth.Subject subject, org.quartz.JobDetail jobDetail)
          Given a Resource operation job's details, this returns a schedule POJO corresponding to that job.
 org.rhq.core.domain.operation.bean.ResourceOperationSchedule getResourceOperationSchedule(org.rhq.core.domain.auth.Subject subject, String jobId)
          Given a resource job's id, this returns the schedule for that resource job.
 org.rhq.core.domain.operation.OperationDefinition getSupportedGroupOperation(org.rhq.core.domain.auth.Subject subject, int compatibleGroupId, String operationName, boolean eagerLoaded)
          Returns the definition of the named operation supported by the given group.
 org.rhq.core.domain.operation.OperationDefinition getSupportedResourceOperation(org.rhq.core.domain.auth.Subject subject, int resourceId, String operationName, boolean eagerLoaded)
          Returns the definition of the named operation supported by the given resource.
 boolean isGroupOperationSupported(org.rhq.core.domain.auth.Subject subject, int resourceGroupId)
          Determines if the given group has at least one operation.
 boolean isResourceOperationSupported(org.rhq.core.domain.auth.Subject subject, int resourceId)
          Determines if the given resource has at least one operation.
 int scheduleGroupOperation(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.operation.bean.GroupOperationSchedule schedule)
          Schedules a Resource group operation for execution.
 org.rhq.core.domain.operation.bean.GroupOperationSchedule scheduleGroupOperation(org.rhq.core.domain.auth.Subject subject, int groupId, int[] executionOrderResourceIds, boolean haltOnFailure, String operationName, org.rhq.core.domain.configuration.Configuration parameters, long delay, long repeatInterval, int repeatCount, int timeout, String description)
          #see {@link OperationManagerRemote#scheduleGroupOperation
 org.rhq.core.domain.operation.bean.GroupOperationSchedule scheduleGroupOperation(org.rhq.core.domain.auth.Subject subject, int groupId, int[] executionOrderResourceIds, boolean haltOnFailure, String operationName, org.rhq.core.domain.configuration.Configuration parameters, org.quartz.Trigger trigger, String description)
          Schedules an operation for execution on members of the given group.
 org.rhq.core.domain.operation.bean.ResourceOperationSchedule scheduleResourceOperation(org.rhq.core.domain.auth.Subject subject, int resourceId, String operationName, org.rhq.core.domain.configuration.Configuration parameters, org.quartz.Trigger trigger, String description)
          Schedules an operation for execution on the given resource.
 org.rhq.core.domain.operation.bean.ResourceOperationSchedule scheduleResourceOperation(org.rhq.core.domain.auth.Subject subject, int resourceId, String operationName, long delay, long repeatInterval, int repeatCount, int timeout, org.rhq.core.domain.configuration.Configuration parameters, String description)
          Schedules an operation for execution on the given resource.
 int scheduleResourceOperation(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.operation.bean.ResourceOperationSchedule schedule)
          Schedules a Resource operation for execution.
 void unscheduleGroupOperation(org.rhq.core.domain.auth.Subject subject, String jobId, int resourceGroupId)
          see OperationManagerRemote.unscheduleGroupOperation(org.rhq.core.domain.auth.Subject, String, int)
 void unscheduleResourceOperation(org.rhq.core.domain.auth.Subject subject, String jobId, int resourceId)
          Unschedules the resource operation identified with the given job ID.
 org.rhq.core.domain.operation.OperationHistory updateOperationHistory(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.operation.OperationHistory history)
          This is called by the jobs so they can update the history.
 void updateOperationScheduleEntity(org.rhq.core.domain.operation.ScheduleJobId jobId, long nextFireTime)
          This allows you to update an operation schedule entity with a new next-fire-time.
 

Method Detail

getResourceNameOptionItems

List<org.rhq.core.domain.common.composite.IntegerOptionItem> getResourceNameOptionItems(int groupId)
TODO

Parameters:
groupId -
Returns:

scheduleResourceOperation

int scheduleResourceOperation(org.rhq.core.domain.auth.Subject subject,
                              org.rhq.core.domain.operation.bean.ResourceOperationSchedule schedule)
Schedules a Resource operation for execution.

Parameters:
subject - the user who is asking to schedule the job
schedule - the information describing the operation to be scheduled along with the schedule to be used
Returns:
the id of the ResourceOperationScheduleEntity created to track the scheduled operation

scheduleGroupOperation

int scheduleGroupOperation(org.rhq.core.domain.auth.Subject subject,
                           org.rhq.core.domain.operation.bean.GroupOperationSchedule schedule)
                           throws ScheduleException
Schedules a Resource group operation for execution.

Parameters:
subject - the user who is asking to schedule the job
schedule - the information describing the operation to be scheduled along with the schedule to be used
Returns:
the id of the GroupOperationScheduleEntity created to track the scheduled operation
Throws:
ScheduleException

scheduleResourceOperation

org.rhq.core.domain.operation.bean.ResourceOperationSchedule scheduleResourceOperation(org.rhq.core.domain.auth.Subject subject,
                                                                                       int resourceId,
                                                                                       String operationName,
                                                                                       org.rhq.core.domain.configuration.Configuration parameters,
                                                                                       org.quartz.Trigger trigger,
                                                                                       String description)
                                                                                       throws org.quartz.SchedulerException
Schedules an operation for execution on the given resource.

Parameters:
subject - the user who is asking to schedule the job
resourceId - the resource that is the target of the operation
operationName - the actual operation to invoke
parameters - optional parameters to pass into the operation
trigger - the schedule of when the job runs (the names and group names in this trigger are ignored and reset by this method)
description - user-entered description of the job to be scheduled
Returns:
the information on the new schedule
Throws:
org.quartz.SchedulerException - if failed to schedule the operation

scheduleGroupOperation

org.rhq.core.domain.operation.bean.GroupOperationSchedule scheduleGroupOperation(org.rhq.core.domain.auth.Subject subject,
                                                                                 int groupId,
                                                                                 int[] executionOrderResourceIds,
                                                                                 boolean haltOnFailure,
                                                                                 String operationName,
                                                                                 org.rhq.core.domain.configuration.Configuration parameters,
                                                                                 org.quartz.Trigger trigger,
                                                                                 String description)
                                                                                 throws org.quartz.SchedulerException
Schedules an operation for execution on members of the given group.

Parameters:
subject - the user who is asking to schedule the job
groupId - the group whose member resources are the target of the operation
executionOrderResourceIds - optional order of exection - if notnull, these are group members resource IDs in the order in which the operations are invoked
haltOnFailure - if true, the group operation will halt whenever one individual resource fails to execute. When executing in order, this means once a failure occurs, the resources next in line to execute will abort and not attempt to execute. If not executing in any particular order, you are not guaranteed which will stop and which will continue since all are executed as fast as possible, but the group operation will attempt to stop as best it can.
operationName - the actual operation to invoke
parameters - optional parameters to pass into the operation
trigger - the schedule of when the job runs (the names and group names in this trigger are ignored and reset by this method)
description - user-entered description of the job to be scheduled
Returns:
the information on the new schedule
Throws:
org.quartz.SchedulerException - if failed to schedule the operation

getResourceOperationSchedule

org.rhq.core.domain.operation.bean.ResourceOperationSchedule getResourceOperationSchedule(org.rhq.core.domain.auth.Subject whoami,
                                                                                          int scheduleId)
TODO

Parameters:
whoami -
scheduleId -
Returns:

getGroupOperationSchedule

org.rhq.core.domain.operation.bean.GroupOperationSchedule getGroupOperationSchedule(org.rhq.core.domain.auth.Subject whoami,
                                                                                    int scheduleId)
TODO

Parameters:
whoami -
scheduleId -
Returns:

deleteOperationScheduleEntity

void deleteOperationScheduleEntity(org.rhq.core.domain.operation.ScheduleJobId jobId)
This will delete an operation schedule entity identified with the given job ID. Note that this does not actually unschedule the job - it merely removed our schedule tracking entity. This schedule tracking entity is really just used to provide some additional querying capabilities since it allows us to link a resource or group ID with a Quartz job directly within SQL.

This method is really just for the OperationJob objects to clean out the schedule tracking entity when the schedule has run its course and will no longer be triggered. The UI or other pieces of client code will usually not have to ever use this method; if you are thinking about having a need to call this method, please know what you are doing.

Parameters:
jobId -

updateOperationScheduleEntity

void updateOperationScheduleEntity(org.rhq.core.domain.operation.ScheduleJobId jobId,
                                   long nextFireTime)
This allows you to update an operation schedule entity with a new next-fire-time.

This method is really just for the OperationJob objects to update the schedule tracking entity. The UI or other pieces of client code will usually not have to ever use this method; if you are thinking about having a need to call this method, please know what you are doing.

Parameters:
jobId -
nextFireTime - the next time this job is due to be triggered

findScheduledGroupOperations

List<org.rhq.core.domain.operation.bean.GroupOperationSchedule> findScheduledGroupOperations(org.rhq.core.domain.auth.Subject subject,
                                                                                             int groupId)
                                                                                             throws Exception
Returns the list of schedules for the group itself. The returned schedules will only be for operations scheduled on the group; it will not include individually scheduled resource operations, even if the resource is a member of the group.

Parameters:
subject -
groupId -
Returns:
group scheduled operations
Throws:
Exception - TODO

getResourceOperationSchedule

@Nullable
org.rhq.core.domain.operation.bean.ResourceOperationSchedule getResourceOperationSchedule(org.rhq.core.domain.auth.Subject subject,
                                                                                                   org.quartz.JobDetail jobDetail)
Given a Resource operation job's details, this returns a schedule POJO corresponding to that job.

Parameters:
subject -
jobDetail -
Returns:
the object that encapsulates the resource schedule, or null if the specified job is no longer scheduled

getResourceOperationSchedule

org.rhq.core.domain.operation.bean.ResourceOperationSchedule getResourceOperationSchedule(org.rhq.core.domain.auth.Subject subject,
                                                                                          String jobId)
                                                                                          throws org.quartz.SchedulerException
Given a resource job's id, this returns the schedule for that resource job.

Parameters:
subject -
jobId -
Returns:
the object that encapsulates the resource schedule
Throws:
org.quartz.SchedulerException - if failed to find the schedule

getGroupOperationSchedule

@Nullable
org.rhq.core.domain.operation.bean.GroupOperationSchedule getGroupOperationSchedule(org.rhq.core.domain.auth.Subject subject,
                                                                                             org.quartz.JobDetail jobDetail)
Given a group operation job's details, this returns a schedule POJO corresponding to that job.

Parameters:
subject -
jobDetail -
Returns:
the object that encapsulates the group schedule, , or null if the specified job is no longer scheduled

getGroupOperationSchedule

org.rhq.core.domain.operation.bean.GroupOperationSchedule getGroupOperationSchedule(org.rhq.core.domain.auth.Subject subject,
                                                                                    String jobId)
                                                                                    throws org.quartz.SchedulerException
Given a group job's id, this returns the schedule for that group job.

Parameters:
subject -
jobId -
Returns:
the object that encapsulates the group schedule
Throws:
org.quartz.SchedulerException - if failed to find the schedule

findResourceOperationHistoriesByGroupHistoryId

org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.ResourceOperationHistory> findResourceOperationHistoriesByGroupHistoryId(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                         int historyId,
                                                                                                                                         org.rhq.core.domain.util.PageControl pc)
Get the paged resource operation histories for a given group history.

Parameters:
subject - the user that wants to see the history
historyId - ID of the history to retrieve
pc - the page control used for sorting and paging of results
Returns:
the requested page of sorted resource operation history results for the given group history

findCompletedGroupOperationHistories

org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.GroupOperationHistory> findCompletedGroupOperationHistories(org.rhq.core.domain.auth.Subject subject,
                                                                                                                            int groupId,
                                                                                                                            org.rhq.core.domain.util.PageControl pc)
Returns the list of completed operation histories for the group resource. This will return all items that are no longer INPROGRESS that were invoked on this group. This only returns the group history item - not the individual resource operation histories for the group member invocation results. See findCompletedResourceOperationHistories(Subject, int, Long, Long, PageControl) for that.

Parameters:
subject -
groupId -
pc -
Returns:
all group histories

findPendingGroupOperationHistories

org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.GroupOperationHistory> findPendingGroupOperationHistories(org.rhq.core.domain.auth.Subject subject,
                                                                                                                          int groupId,
                                                                                                                          org.rhq.core.domain.util.PageControl pc)
Returns the list of pending operation histories for the group resource. This will return all items that are still INPROGRESS that were invoked on this group. This only returns the group history item - not the individual resource operation histories for the group member invocation results. See findPendingResourceOperationHistories(Subject, int, PageControl) for that.

Parameters:
subject -
groupId -
pc -
Returns:
all group histories

updateOperationHistory

org.rhq.core.domain.operation.OperationHistory updateOperationHistory(org.rhq.core.domain.auth.Subject subject,
                                                                      org.rhq.core.domain.operation.OperationHistory history)
This is called by the jobs so they can update the history. The job will pass in an updated history object, this method just updates the database with the new data.

Every call to this method will trigger at least one check against the AlertConditionCacheManager. The first is against the passed history element itself, which captures the creation events (history element will be in the INPROGRESS state), as well as updated to ResourceOperationHistory elements (completed, failed, etc).

Furthermore, since ResourceOperationHistory elements are reused for execution of group operations, this method also checks to see if it is part of a larger group operation. If it is, and if it is the last member of that group to finish, the group status will be updated. This will trigger a second check against the AlertConditionCacheManager using that corresponding group history element.

Parameters:
subject - the user that the job is executing under
history - the history with the data to be updated
Returns:
the updated history

checkForCompletedGroupOperation

void checkForCompletedGroupOperation(int historyId)
This is, for all intents and purposes, and internal method. It should be called just after updating any OperationHistory element. To date, this includes two places: a) post-processing hook to updateOperationHistory(Subject whoami, OperationHistory history) b) embedded inside the logic for checkForTimedOutOperations(Subject) This method will perform the following logic: 1) checks whether the entity corresponding to the passed id is part of a larger GroupOperationHistory 2) if #1 is true, it will further check whether that entity was the last element from the group to complete 3) if #2 is true, it will perform the necessary logic to moving the associated GroupOperationHistory entity to the appropriate termination state

Parameters:
historyId - the integer id of the OperationHistory entity that needs to be checked

findSupportedResourceTypeOperations

List<org.rhq.core.domain.operation.OperationDefinition> findSupportedResourceTypeOperations(org.rhq.core.domain.auth.Subject subject,
                                                                                            int resourceTypeId,
                                                                                            boolean eagerLoaded)
Returns the definitions of all the operations supported by the given resource type.

Parameters:
subject -
resourceTypeId -
eagerLoaded - if true the parametersConfigurationDefinition, resultsConfigurationDefinition, and resourceType fields are eagerly loaded, otherwise they are left as null references
Returns:
the operation definitions for the resource type

findSupportedGroupOperations

List<org.rhq.core.domain.operation.OperationDefinition> findSupportedGroupOperations(org.rhq.core.domain.auth.Subject subject,
                                                                                     int compatibleGroupId,
                                                                                     boolean eagerLoaded)
Returns the definitions of all the operations supported by the given group.

Parameters:
subject -
compatibleGroupId -
eagerLoaded - if true the parametersConfigurationDefinition, resultsConfigurationDefinition, and resourceType fields are eagerly loaded, otherwise they are left as null references
Returns:
the operation definitions for the group

getSupportedResourceOperation

org.rhq.core.domain.operation.OperationDefinition getSupportedResourceOperation(org.rhq.core.domain.auth.Subject subject,
                                                                                int resourceId,
                                                                                String operationName,
                                                                                boolean eagerLoaded)
Returns the definition of the named operation supported by the given resource. If the operation is not valid for the resource, an exception is thrown.

Parameters:
subject -
resourceId -
operationName -
eagerLoaded - if true the parametersConfigurationDefinition, resultsConfigurationDefinition, and resourceType fields are eagerly loaded, otherwise they are left as null references
Returns:
the named operation definition for the resource

getSupportedGroupOperation

org.rhq.core.domain.operation.OperationDefinition getSupportedGroupOperation(org.rhq.core.domain.auth.Subject subject,
                                                                             int compatibleGroupId,
                                                                             String operationName,
                                                                             boolean eagerLoaded)
Returns the definition of the named operation supported by the given group. If the operation is not valid for the group, an exception is thrown.

Parameters:
subject -
compatibleGroupId -
operationName -
eagerLoaded - if true the parametersConfigurationDefinition, resultsConfigurationDefinition, and resourceType fields are eagerly loaded, otherwise they are left as null references
Returns:
the named operation definition for the group

isResourceOperationSupported

boolean isResourceOperationSupported(org.rhq.core.domain.auth.Subject subject,
                                     int resourceId)
Determines if the given resource has at least one operation.

Parameters:
subject -
resourceId -
Returns:
true if the resource has at least one operation

isGroupOperationSupported

boolean isGroupOperationSupported(org.rhq.core.domain.auth.Subject subject,
                                  int resourceGroupId)
Determines if the given group has at least one operation.

Parameters:
subject -
resourceGroupId -
Returns:
true if the group has at least one operation

checkForTimedOutOperations

void checkForTimedOutOperations(org.rhq.core.domain.auth.Subject whoami)
Will check to see if any in progress operation jobs are taking too long to finish and if so marks their histories as failed. This method will be perodically called by the JON Server.

Calls to this method could trigger a number of checks against the AlertConditionCacheManager. The first set of checks would be against any and all resource operations that have timed out. Then, for any of these timeouts, since ResourceOperationHistory elements are reused for execution of group operations, this method also checks to see if it is part of a larger group operation. If it is, and if it is the last member of that group to finish, the group status will be updated. This will trigger another check against the AlertConditionCacheManager using that corresponding group history element.

Parameters:
whoami - only the overlord may execute this system operation

getLatestCompletedResourceOperation

@Nullable
org.rhq.core.domain.operation.ResourceOperationHistory getLatestCompletedResourceOperation(org.rhq.core.domain.auth.Subject subject,
                                                                                                    int resourceId)
Get the mostly recently run operation for the Resource with the given id, or null if the resource has had no operations performed against it yet (or if all previously performed operations have been deleted from the history). Returns the result of the operation as it is known on the server-side in the database.

Parameters:
subject - the user who wants to see the information
resourceId - a Resource id
Returns:
the most recent operation performed against the Resource with the given id, or null if the resource has had no operations performed against it yet.

getOldestInProgressResourceOperation

@Nullable
org.rhq.core.domain.operation.ResourceOperationHistory getOldestInProgressResourceOperation(org.rhq.core.domain.auth.Subject subject,
                                                                                                     int resourceId)
Get the oldest operation still in progress for the Resource with the given id, or null if the resource has no operations being performed against it. Returns the INPROCESS element with empty results.

Parameters:
subject - the user who wants to see the information
resourceId - a Resource id
Returns:
the oldest operation still in progress for the Resource with the given id, or null if the resource has no operations being performed against it.

getOperationDefinition

org.rhq.core.domain.operation.OperationDefinition getOperationDefinition(org.rhq.core.domain.auth.Subject subject,
                                                                         int operationId)
Get the OperationDefinition object that corresponds to this operationId

Parameters:
subject - the user who wants to see the information
operationId -
Returns:
the OperationDefinition object that corresponds to this operationId

getOperationDefinitionByResourceTypeAndName

org.rhq.core.domain.operation.OperationDefinition getOperationDefinitionByResourceTypeAndName(int resourceTypeId,
                                                                                              String operationName,
                                                                                              boolean eagerLoaded)
                                                                                              throws OperationDefinitionNotFoundException
Parameters:
resourceTypeId -
operationName -
eagerLoaded - if true the parametersConfigurationDefinition, resultsConfigurationDefinition, and resourceType fields are eagerly loaded, otherwise they are left as null references
Returns:
the operation definition
Throws:
OperationDefinitionNotFoundException

findRecentlyCompletedResourceOperations

org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.composite.ResourceOperationLastCompletedComposite> findRecentlyCompletedResourceOperations(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                                           Integer resourceId,
                                                                                                                                                           org.rhq.core.domain.util.PageControl pc)
Gets a list of all recently completed resource operations. This is used to support the dashboard operations portlet. WARNING: Do not send in a page control that asks for an unlimited page list - depending on the number of operations in the system's history, that kind of request could blow up.

Only resource operations are returned (group operations are ignored by this method). However, if a group operation was executed, all of the resource executions that occurred as part of it will be returned (that is, the resources in that group will have its resource operations returned.

Parameters:
subject - the user asking for the data; the returned list is limited to what this user can see
resourceId - if non-null, will only result recent completed operations for this resource
pc - limits the number of composite objects returned
Returns:
the list of recently completed resource operations

findRecentlyCompletedGroupOperations

org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.composite.GroupOperationLastCompletedComposite> findRecentlyCompletedGroupOperations(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                                     org.rhq.core.domain.util.PageControl pc)
Gets a list of all recently completed group operations. This is used to support the dashboard operations portlet. WARNING: Do not send in a page control that asks for an unlimited page list - depending on the number of operations in the system's history, that kind of request could blow up.

Parameters:
subject - the user asking for the data; the returned list is limited to what this user can see
pc - limits the number of composite objects returned
Returns:
the list of recently completed group operations

findCurrentlyScheduledResourceOperations

org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.composite.ResourceOperationScheduleComposite> findCurrentlyScheduledResourceOperations(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                                       org.rhq.core.domain.util.PageControl pc)
Gets a list of all currently scheduled resource operations (that is, scheduled but not yet invoked and/or completed).

Parameters:
subject - the user asking for the data; the returned list is limited to what this user can see
pc - limits the number of composite objects returned
Returns:
the list of scheduled resource operations

findCurrentlyScheduledGroupOperations

org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.composite.GroupOperationScheduleComposite> findCurrentlyScheduledGroupOperations(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                                 org.rhq.core.domain.util.PageControl pc)
Gets a list of all currently scheduled group operations (that is, scheduled but not yet invoked and/or completed).

Parameters:
subject - the user asking for the data; the returned list is limited to what this user can see
pc - limits the number of composite objects returned
Returns:
the list of scheduled group operations

cancelOperationHistory

void cancelOperationHistory(org.rhq.core.domain.auth.Subject subject,
                            int historyId,
                            boolean ignoreAgentErrors)
Cancels a currently in-progress operation. Doing this will attempt to stop the invocation if it is currently running on the agent.

Note that this method will handle canceling a resource or group history - depending on what the given historyId refers to. If it refers to a group history, it will cancel all the resource invocations for that group invocation.

If the cancel request succeeds, the history element will be checked against the AlertConditionCacheManager.

Parameters:
subject - the user that wants to cancel the operation
historyId - the ID of the history item identifying the in-progress operation
ignoreAgentErrors - if true this will still flag the history items in the database as canceled, even if the method failed to notify the agent(s) that the operation should be canceled. If false, this method will not update the history status unless it could successfully tell the agent(s) to cancel the operation.

deleteOperationHistory

void deleteOperationHistory(org.rhq.core.domain.auth.Subject subject,
                            int historyId,
                            boolean purgeInProgress)
Purges the history from the database. Doing this loses all audit trails of the invoked operation. This can handle deleting a group or resource history.

Note that this method will handle deleting a resource or group history - depending on what the given historyId refers to.

Parameters:
subject - the user that wants to delete the history
historyId - the ID of the history to be deleted
purgeInProgress - if true, even if the operation is in progress, the history entity will be deleted. You normally do not want to purge operation histories until they are completed, so you normally pass in false, but a user might want to force it to be purged, in which case the UI will want to pass in true

findCompletedResourceOperationHistories

org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.ResourceOperationHistory> findCompletedResourceOperationHistories(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                  int resourceId,
                                                                                                                                  Long startDate,
                                                                                                                                  Long endDate,
                                                                                                                                  org.rhq.core.domain.util.PageControl pc)
Returns the list of completed operation histories for the given resource. This will return all items that are no longer INPROGRESS that were invoked as part of a group operation to which this resource belongs or on the resource directly.

Parameters:
subject -
resourceId -
startDate - filter used to show only results occurring after this epoch millis parameter, nullable
endDate - filter used to show only results occurring before this epoch millis parameter, nullable
pc -
Returns:
all operation histories for the given resource

findPendingResourceOperationHistories

org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.ResourceOperationHistory> findPendingResourceOperationHistories(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                int resourceId,
                                                                                                                                org.rhq.core.domain.util.PageControl pc)
Returns the list of pending operation histories for the given resource. This will return all items that are still INPROGRESS that were invoked as part of a group operation to which this resource belongs or on the resource directly.

Parameters:
subject -
resourceId -
pc -
Returns:
all operation histories for the given resource

getOperationHistoryByHistoryId

org.rhq.core.domain.operation.OperationHistory getOperationHistoryByHistoryId(org.rhq.core.domain.auth.Subject subject,
                                                                              int historyId)
TODO


getOperationHistoryByJobId

org.rhq.core.domain.operation.OperationHistory getOperationHistoryByJobId(org.rhq.core.domain.auth.Subject subject,
                                                                          String historyJobId)
TODO


findScheduledResourceOperations

List<org.rhq.core.domain.operation.bean.ResourceOperationSchedule> findScheduledResourceOperations(org.rhq.core.domain.auth.Subject subject,
                                                                                                   int resourceId)
                                                                                                   throws Exception
Returns the list of scheduled operations for the given resource. This only includes scheduled jobs on the individual resource - it will not include schedules from groups, even if the resource is a member of a group that has scheduled jobs.

Parameters:
subject -
resourceId -
Returns:
resource scheduled operations
Throws:
Exception - TODO

findSupportedResourceOperations

List<org.rhq.core.domain.operation.OperationDefinition> findSupportedResourceOperations(org.rhq.core.domain.auth.Subject subject,
                                                                                        int resourceId,
                                                                                        boolean eagerLoaded)
Returns the definitions of all the operations supported by the given resource.

Parameters:
subject -
resourceId -
eagerLoaded - if true the parametersConfigurationDefinition, resultsConfigurationDefinition, and resourceType fields are eagerly loaded, otherwise they are left as null references
Returns:
the operation definitions for the resource

scheduleGroupOperation

org.rhq.core.domain.operation.bean.GroupOperationSchedule scheduleGroupOperation(org.rhq.core.domain.auth.Subject subject,
                                                                                 int groupId,
                                                                                 int[] executionOrderResourceIds,
                                                                                 boolean haltOnFailure,
                                                                                 String operationName,
                                                                                 org.rhq.core.domain.configuration.Configuration parameters,
                                                                                 long delay,
                                                                                 long repeatInterval,
                                                                                 int repeatCount,
                                                                                 int timeout,
                                                                                 String description)
                                                                                 throws ScheduleException
#see {@link OperationManagerRemote#scheduleGroupOperation

Throws:
ScheduleException

scheduleResourceOperation

org.rhq.core.domain.operation.bean.ResourceOperationSchedule scheduleResourceOperation(org.rhq.core.domain.auth.Subject subject,
                                                                                       int resourceId,
                                                                                       String operationName,
                                                                                       long delay,
                                                                                       long repeatInterval,
                                                                                       int repeatCount,
                                                                                       int timeout,
                                                                                       org.rhq.core.domain.configuration.Configuration parameters,
                                                                                       String description)
                                                                                       throws ScheduleException
Schedules an operation for execution on the given resource.

Parameters:
subject - The logged in user's subject.
resourceId - the resource that is the target of the operation
operationName - the actual operation to invoke
delay - the number of milliseconds to delay this operation, 0 for immediate start.
repeatInterval - the number of milliseconds after completion to repeat this operation. 0 for no repeat.
repeatCount - the number of times to repeat this operation. -1 infinite, 0 for no repeat.
timeout - the number of seconds before this operation will fail due to timeout. 0 for no timeout.
parameters - the names parameters for the operation.
description - user-entered description of the job to be scheduled
Returns:
the information on the new schedule
Throws:
ScheduleException - TODO

unscheduleResourceOperation

void unscheduleResourceOperation(org.rhq.core.domain.auth.Subject subject,
                                 String jobId,
                                 int resourceId)
                                 throws UnscheduleException
Unschedules the resource operation identified with the given job ID.

Parameters:
subject - the user who is asking to unschedule the operation
jobId - identifies the operation to unschedule
resourceId - the ID of the resource whose operation is getting unscheduled
Throws:
UnscheduleException - TODO

unscheduleGroupOperation

void unscheduleGroupOperation(org.rhq.core.domain.auth.Subject subject,
                              String jobId,
                              int resourceGroupId)
                              throws UnscheduleException
see OperationManagerRemote.unscheduleGroupOperation(org.rhq.core.domain.auth.Subject, String, int)

Throws:
UnscheduleException

findOperationDefinitionsByCriteria

List<org.rhq.core.domain.operation.OperationDefinition> findOperationDefinitionsByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                           org.rhq.core.domain.criteria.OperationDefinitionCriteria criteria)

findResourceOperationHistoriesByCriteria

org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.ResourceOperationHistory> findResourceOperationHistoriesByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                                                                   org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria criteria)

findGroupOperationHistoriesByCriteria

org.rhq.core.domain.util.PageList<org.rhq.core.domain.operation.GroupOperationHistory> findGroupOperationHistoriesByCriteria(org.rhq.core.domain.auth.Subject subject,
                                                                                                                             org.rhq.core.domain.criteria.GroupOperationHistoryCriteria criteria)


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