org.rhq.enterprise.server.operation
Interface OperationManagerRemote

All Known Subinterfaces:
WebservicesRemote

public interface OperationManagerRemote


Method Summary
 void cancelOperationHistory(Subject subject, int operationHistoryId, boolean ignoreAgentErrors)
          Cancels a currently in-progress operation.
 void deleteOperationHistory(Subject subject, int operationHistoryId, boolean purgeInProgress)
          Purges the history from the database.
 PageList<GroupOperationHistory> findGroupOperationHistoriesByCriteria(Subject subject, GroupOperationHistoryCriteria criteria)
           
 List<OperationDefinition> findOperationDefinitionsByCriteria(Subject subject, OperationDefinitionCriteria criteria)
           
 PageList<ResourceOperationHistory> findResourceOperationHistoriesByCriteria(Subject subject, ResourceOperationHistoryCriteria criteria)
           
 List<org.rhq.enterprise.server.operation.GroupOperationSchedule> findScheduledGroupOperations(Subject subject, int groupId)
           
 List<org.rhq.enterprise.server.operation.ResourceOperationSchedule> findScheduledResourceOperations(Subject subject, int resourceId)
          Returns the list of scheduled operations for the given resource.
 org.rhq.enterprise.server.operation.GroupOperationSchedule scheduleGroupOperation(Subject subject, int groupId, int[] executionOrderResourceIds, boolean haltOnFailure, String operationName, Configuration parameters, long delay, long repeatInterval, int repeatCount, int timeout, String description)
           
 org.rhq.enterprise.server.operation.ResourceOperationSchedule scheduleResourceOperation(Subject subject, int resourceId, String operationName, long delay, long repeatInterval, int repeatCount, int timeout, Configuration parameters, String description)
          Schedules an operation for execution on the given resource.
 void unscheduleGroupOperation(Subject subject, String jobId, int resourceGroupId)
          Unschedules the group operation identified with the given job ID.
 void unscheduleResourceOperation(Subject subject, String jobId, int resourceId)
          Unschedules the resource operation identified with the given job ID.
 

Method Detail

cancelOperationHistory

void cancelOperationHistory(Subject subject,
                            int operationHistoryId,
                            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 logged in user's subject.
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(Subject subject,
                            int operationHistoryId,
                            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 logged in user's subject.
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

scheduleResourceOperation

org.rhq.enterprise.server.operation.ResourceOperationSchedule scheduleResourceOperation(Subject subject,
                                                                                        int resourceId,
                                                                                        String operationName,
                                                                                        long delay,
                                                                                        long repeatInterval,
                                                                                        int repeatCount,
                                                                                        int timeout,
                                                                                        Configuration parameters,
                                                                                        String description)
                                                                                        throws org.rhq.enterprise.server.exception.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:
org.rhq.enterprise.server.exception.ScheduleException - TODO

unscheduleResourceOperation

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

Parameters:
subject - The logged in user's subject.
jobId - identifies the operation to unschedule
resourceId - the ID of the resource whose operation is getting unscheduled
Throws:
org.rhq.enterprise.server.exception.UnscheduleException - TODO
Exception

scheduleGroupOperation

org.rhq.enterprise.server.operation.GroupOperationSchedule scheduleGroupOperation(Subject subject,
                                                                                  int groupId,
                                                                                  int[] executionOrderResourceIds,
                                                                                  boolean haltOnFailure,
                                                                                  String operationName,
                                                                                  Configuration parameters,
                                                                                  long delay,
                                                                                  long repeatInterval,
                                                                                  int repeatCount,
                                                                                  int timeout,
                                                                                  String description)
                                                                                  throws org.rhq.enterprise.server.exception.ScheduleException
Parameters:
subject -
groupId -
executionOrderResourceIds -
haltOnFailure -
operationName -
parameters -
delay -
repeatInterval -
repeatCount -
timeout -
description -
Returns:
Throws:
org.rhq.enterprise.server.exception.ScheduleException

unscheduleGroupOperation

void unscheduleGroupOperation(Subject subject,
                              String jobId,
                              int resourceGroupId)
                              throws org.rhq.enterprise.server.exception.UnscheduleException
Unschedules the group operation identified with the given job ID.

Parameters:
subject - the user who is asking to unschedule the operation
jobId - identifies the operation to unschedule
resourceGroupId - the ID of the group whose operation is getting unscheduled
Throws:
org.rhq.enterprise.server.exception.UnscheduleException - TODO

findScheduledResourceOperations

List<org.rhq.enterprise.server.operation.ResourceOperationSchedule> findScheduledResourceOperations(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:
user - The logged in user's subject.
resourceId -
Returns:
resource scheduled operations
Throws:
Exception - TODO
Exception

findScheduledGroupOperations

List<org.rhq.enterprise.server.operation.GroupOperationSchedule> findScheduledGroupOperations(Subject subject,
                                                                                              int groupId)
                                                                                              throws Exception
Throws:
Exception

findOperationDefinitionsByCriteria

List<OperationDefinition> findOperationDefinitionsByCriteria(Subject subject,
                                                             OperationDefinitionCriteria criteria)

findResourceOperationHistoriesByCriteria

PageList<ResourceOperationHistory> findResourceOperationHistoriesByCriteria(Subject subject,
                                                                            ResourceOperationHistoryCriteria criteria)

findGroupOperationHistoriesByCriteria

PageList<GroupOperationHistory> findGroupOperationHistoriesByCriteria(Subject subject,
                                                                      GroupOperationHistoryCriteria criteria)


Copyright © 2008-2009 RHQ Project Advisory Board (Red Hat, Inc.). All Rights Reserved.