|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ScheduleQueue
Manages the drift detection schedules that are processed by the drift detector. The
queue has a concept of the currently "active" schedule. This is identified simply as
the schedule returned from getNextSchedule() which is the previous head of the
queue. A reference to the active schedule needs to be maintained because at any point in
time the server can send a request to update the drift definition that is attached to
a schedule. That schedule will either be on the queue waiting to be processed or in the
"active" state meaning it is currently being processed by the drift detector.
| Method Summary | |
|---|---|
boolean |
addSchedule(DriftDetectionSchedule schedule)
Adds a schedule to the queue for processing by the drift detector |
void |
clear()
Removes all elements from the queue and deactivates the active schedule. |
boolean |
contains(int resourceId,
org.rhq.core.domain.drift.DriftDefinition driftDef)
Checks the queue for a schedule with specified resource id and drift definition whose name matches the specified definition. |
boolean |
contains(int resourceId,
org.rhq.core.domain.drift.DriftDefinition driftDef,
org.rhq.core.domain.drift.DriftDefinitionComparator comparator)
|
void |
deactivateSchedule(boolean updateSchedule)
This method does two things. |
DriftDetectionSchedule |
find(int resourceId,
String defName)
Searches the queue for a schedule with a matching resource id and drift definition name. |
DriftDetectionSchedule |
getNextSchedule()
Removes the head of the queue and returns a copy of the schedule that was removed. |
DriftDetectionSchedule |
remove(int resourceId,
org.rhq.core.domain.drift.DriftDefinition driftDef)
Removes the schedule identified by the resource id and the drift definition. |
DriftDetectionSchedule |
remove(int resourceId,
String defName)
Removes the schedule identified by the resource id and drift definition name. |
DriftDetectionSchedule |
removeAndExecute(int resourceId,
org.rhq.core.domain.drift.DriftDefinition driftDef,
Runnable task)
Removes the schedule identified by the resource id and the drift definition name. |
DriftDetectionSchedule |
removeAndExecute(int resourceId,
String configName,
Runnable task)
Removes the schedule |
DriftDetectionSchedule[] |
toArray()
|
DriftDetectionSchedule |
update(int resourceId,
org.rhq.core.domain.drift.DriftDefinition driftDef)
This method attempts to update the schedule identified by the resource id the and the drift definition. |
| Method Detail |
|---|
DriftDetectionSchedule[] toArray()
DriftDetectionSchedule getNextSchedule()
IllegalStateException - if there is already an active schedule. The active
schedule must be deactivated before getting the next schedule.DriftDetectionSchedulevoid deactivateSchedule(boolean updateSchedule)
boolean addSchedule(DriftDetectionSchedule schedule)
schedule - A DriftDetectionSchedule object
DriftDetectionSchedule find(int resourceId,
String defName)
resourceId - The resource id of the schedule being soughtdefName - The name of the drift definition in the schedule being sought
boolean contains(int resourceId,
org.rhq.core.domain.drift.DriftDefinition driftDef)
resourceId - The resource id of the scheduledriftDef - The drift definition of the schedule
boolean contains(int resourceId,
org.rhq.core.domain.drift.DriftDefinition driftDef,
org.rhq.core.domain.drift.DriftDefinitionComparator comparator)
DriftDetectionSchedule update(int resourceId,
org.rhq.core.domain.drift.DriftDefinition driftDef)
#deactivateSchedule() is called. If the schedule
is on the queue, it is removed, updated, and then added back onto the queue.
resourceId - The resource iddriftDef - A DriftDefinition belonging the resource with the specified id
DriftDetectionSchedule remove(int resourceId,
org.rhq.core.domain.drift.DriftDefinition driftDef)
resourceId - The resource iddriftDef - A DriftDefinition belonging the resource with the specified id
DriftDetectionSchedule that is removed or null if no matching
schedule is found.
DriftDetectionSchedule remove(int resourceId,
String defName)
resourceId - The resource iddefName - The drift definition name
DriftDetectionSchedule that is removed or null if no matching
schedule is found.
DriftDetectionSchedule removeAndExecute(int resourceId,
org.rhq.core.domain.drift.DriftDefinition driftDef,
Runnable task)
task is executed immediately after the
schedule is removed from the queue. If the schedule is active, then task
will be executed when the schedule is deactivated. If the schedule is not in the
queue, that is it is neither the active schedule nor waiting in the queue, then
taskis never invoked and is discarded.
task will only be invoked once regardless of whether or the schedule is
active or waiting in the queue.
DriftDetector. The task may very well involve some clean up work that
could interfere with DriftDetector. This approach ensures that the schedule
is not in used before task is executed.
resourceId - The resource iddriftDef - A DriftDefinition belonging the resource with the specified idtask - A callback to perform any post-processing when the schedule is removed
from the queue
DriftDetectionSchedule that is removed or null if no matching
schedule is found.
DriftDetectionSchedule removeAndExecute(int resourceId,
String configName,
Runnable task)
resourceId - configName - task -
void clear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||