Class IterableProcess<T extends IterableProcess<T,​E>,​E extends java.lang.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 java.lang.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 Details

    • stepList

      protected java.util.HashMap<E extends java.lang.Enum<E>,​java.lang.Object[]> stepList
  • Constructor Details

    • IterableProcess

      public IterableProcess​(GenericProcess parentProcess, java.lang.Class<E> stepClazz)
      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

      public IterableProcess​(java.lang.String processId, java.lang.Class<E> stepClazz)
      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

      @SafeVarargs protected final boolean step​(E... 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

      public T all()
      Perform All Steps
      Returns:
      IterableProcess
    • allBut

      @SafeVarargs public final T allBut​(E... step)
      Perform all Steps except the listed steps
      Returns:
      IterableProcess
    • only

      @SafeVarargs public final T only​(E... step)
      Adds the provided step(s) to the step list after clearing the list.
      Returns:
      IterableProcess
    • addStep

      @SafeVarargs public final T addStep​(E... step)
      Adds the provided step(s) to the step list.
      Returns:
      IterableProcess
    • addStep

      public T addStep​(E step, java.lang.Object[] data)
      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

      public T setConcurrent​(boolean concurrent)
      Sets if the operation should return before the underyling threads have completed
      Parameters:
      concurrent - The desired concurrency value
      Returns:
      IterableProcess
    • removeStep

      @SafeVarargs public final T removeStep​(E... step)
      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

      public void onStep​(java.util.function.Consumer<java.lang.Integer> onStepConsumer)
      Set call back to occur on step change