|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.core.pc.drift.ScheduleQueueImpl
public class ScheduleQueueImpl
| Constructor Summary | |
|---|---|
ScheduleQueueImpl()
|
|
| 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 defName,
Runnable task)
Removes the schedule |
DriftDetectionSchedule[] |
toArray()
|
String |
toString()
Generates a string representation of the schedules in the queue. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ScheduleQueueImpl()
| Method Detail |
|---|
public DriftDetectionSchedule getNextSchedule()
ScheduleQueue
getNextSchedule in interface ScheduleQueueDriftDetectionSchedulepublic void deactivateSchedule(boolean updateSchedule)
ScheduleQueue
deactivateSchedule in interface ScheduleQueuepublic boolean addSchedule(DriftDetectionSchedule schedule)
ScheduleQueue
addSchedule in interface ScheduleQueueschedule - A DriftDetectionSchedule object
public boolean contains(int resourceId,
org.rhq.core.domain.drift.DriftDefinition driftDef)
ScheduleQueue
contains in interface ScheduleQueueresourceId - The resource id of the scheduledriftDef - The drift definition of the schedule
public boolean contains(int resourceId,
org.rhq.core.domain.drift.DriftDefinition driftDef,
org.rhq.core.domain.drift.DriftDefinitionComparator comparator)
contains in interface ScheduleQueue
public DriftDetectionSchedule find(int resourceId,
String defName)
ScheduleQueue
find in interface ScheduleQueueresourceId - The resource id of the schedule being soughtdefName - The name of the drift definition in the schedule being sought
public DriftDetectionSchedule remove(int resourceId,
org.rhq.core.domain.drift.DriftDefinition driftDef)
ScheduleQueue
remove in interface ScheduleQueueresourceId - The resource iddriftDef - A DriftDefinition belonging the resource with the specified id
DriftDetectionSchedule that is removed or null if no matching
schedule is found.
public DriftDetectionSchedule remove(int resourceId,
String defName)
ScheduleQueue
remove in interface ScheduleQueueresourceId - The resource iddefName - The drift definition name
DriftDetectionSchedule that is removed or null if no matching
schedule is found.
public DriftDetectionSchedule removeAndExecute(int resourceId,
org.rhq.core.domain.drift.DriftDefinition driftDef,
Runnable task)
ScheduleQueuetask 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.
removeAndExecute in interface ScheduleQueueresourceId - 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.
public DriftDetectionSchedule removeAndExecute(int resourceId,
String defName,
Runnable task)
ScheduleQueue
removeAndExecute in interface ScheduleQueue
public DriftDetectionSchedule update(int resourceId,
org.rhq.core.domain.drift.DriftDefinition driftDef)
ScheduleQueue#deactivateSchedule() is called. If the schedule
is on the queue, it is removed, updated, and then added back onto the queue.
update in interface ScheduleQueueresourceId - The resource iddriftDef - A DriftDefinition belonging the resource with the specified id
public void clear()
ScheduleQueue
clear in interface ScheduleQueuepublic String toString()
toString in class Objectpublic DriftDetectionSchedule[] toArray()
toArray in interface ScheduleQueue
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||