Package co.ecg.alpaca.toolkit.task
Class IterableProcess<T extends IterableProcess<T,E>,E extends Enum<E>>
java.lang.Object
co.ecg.alpaca.toolkit.task.GenericProcess
co.ecg.alpaca.toolkit.task.IterableProcess<T,E>
- All Implemented Interfaces:
Loggable
- Direct Known Subclasses:
BroadWorksProcess
public abstract class IterableProcess<T extends IterableProcess<T,E>,E extends Enum<E>>
extends GenericProcess
An abstract iterable process in which the process execution can occur through steps defined in an enumeration.
- Author:
- Matthew Keathley on 5/23/16.
-
Field Summary
FieldsFields inherited from class co.ecg.alpaca.toolkit.task.GenericProcess
log
-
Constructor Summary
ConstructorsConstructorDescriptionIterableProcess
(GenericProcess parentProcess, Class<E> stepClazz) Creates an iterable process with the provided BroadWorksServer and step class enum.IterableProcess
(String processId, Class<E> stepClazz) Creates an iterable process with the provided BroadWorksServer and step class enum. -
Method Summary
Modifier and TypeMethodDescriptionfinal T
Adds the provided step(s) to the step list.Adds the provided step with additional data.all()
Perform All Stepsfinal T
Perform all Steps except the listed stepsint
Returns the current step count.boolean
Returns true IFF the process is allowed to return before completingfinal T
Adds the provided step(s) to the step list after clearing the list.void
Set call back to occur on step changefinal T
removeStep
(E... step) Removes the provided step(s) to the step list.setConcurrent
(boolean concurrent) Sets if the operation should return before the underyling threads have completedprotected final void
step()
Increments the step count.protected final boolean
Checks if any of the steps in the parameter list have been added to the step list.Methods inherited from class co.ecg.alpaca.toolkit.task.GenericProcess
addError, addError, addWarning, addWarning, checkValidity, errorCount, exception, exception, fail, getErrors, getLogIdentifier, getParentProcess, getProcessContext, getProcessId, getReport, getReportList, getReportList, getWarnings, hasErrors, hasWarnings, isDescendantOf, isError, isError, isError, isErrorsAsWarnings, printReport, setErrorsAsWarnings, setExceptionOnErrors, setParentProcess, setProcessId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface co.ecg.alpaca.toolkit.task.Loggable
getProcessLogger, logger
-
Field Details
-
stepList
-
-
Constructor Details
-
IterableProcess
Creates an iterable process with the provided BroadWorksServer and step class enum.- Parameters:
parentProcess
- The parent process.stepClazz
- The class of the step enumeration list.
-
IterableProcess
Creates an iterable process with the provided BroadWorksServer and step class enum.- Parameters:
processId
- The process ID for this iterable process.stepClazz
- The class of the step enumeration list.
-
-
Method Details
-
step
protected final void step()Increments the step count. Used for finishing the iterable process. -
step
Checks if any of the steps in the parameter list have been added to the step list.- Parameters:
step
- The steps to check for existence in the step list.- Returns:
- True IFF the step list contains a provided step.
-
all
Perform All Steps- Returns:
- IterableProcess
-
allBut
Perform all Steps except the listed steps- Returns:
- IterableProcess
-
only
Adds the provided step(s) to the step list after clearing the list.- Returns:
- IterableProcess
-
addStep
Adds the provided step(s) to the step list.- Returns:
- IterableProcess
-
addStep
Adds the provided step with additional data.- Returns:
- IterableProcess
-
isConcurrent
public boolean isConcurrent()Returns true IFF the process is allowed to return before completing- Returns:
- A boolean value of isConcurrent
-
setConcurrent
Sets if the operation should return before the underyling threads have completed- Parameters:
concurrent
- The desired concurrency value- Returns:
- IterableProcess
-
removeStep
Removes the provided step(s) to the step list.- Returns:
- IterableProcess
-
getStepCount
public int getStepCount()Returns the current step count.- Returns:
- The step count as an int.
-
onStep
Set call back to occur on step change
-