Package org.apache.batchee.container.impl.controller

## Class BaseStepController

- java.lang.Object
- - org.apache.batchee.container.impl.controller.BaseStepController

- All Implemented Interfaces:
    `Controller`, `ExecutionElementController`
  Direct Known Subclasses:
    `PartitionedStepController`, `SingleThreadedStepController`

      public abstract class BaseStepController
      extends Object
      implements ExecutionElementController

  Change the name of this class to something else!! Or change BaseStepController.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected BlockingQueue<PartitionDataWrapper>` | `analyzerStatusQueue` |
    `protected RuntimeJobExecution` | `jobExecutionImpl` |
    `protected javax.batch.runtime.JobInstance` | `jobInstance` |
    `protected BatchKernelService` | `kernelService` |
    `protected PersistenceManagerService` | `persistenceManagerService` |
    `protected boolean` | `restartAfterCompletion` |
    `protected long` | `rootJobExecutionId` |
    `protected Step` | `step` |
    `protected StepContextImpl` | `stepContext` |
    `protected String` | `stepName` |
    `protected StepStatus` | `stepStatus` |
    `protected TransactionManagerAdapter` | `transactionManager` |

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `BaseStepController​(RuntimeJobExecution jobExecution, Step step, StepContextImpl stepContext, long rootJobExecutionId, BlockingQueue<PartitionDataWrapper> analyzerStatusQueue, ServicesManager servicesManager)` |
    `protected` | `BaseStepController​(RuntimeJobExecution jobExecution, Step step, StepContextImpl stepContext, long rootJobExecutionId, ServicesManager servicesManager)` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ExecutionStatus` | `execute()` |
    `List<Long>` | `getLastRunStepExecutions()` |
    `protected abstract void` | `invokeCoreStep()` |
    `protected abstract void` | `invokePostStepArtifacts()` |
    `protected abstract void` | `invokePreStepArtifacts()` |
    `protected boolean` | `isRestartExecution()` |
    `protected void` | `markJobAndStepFailed()` |
    `protected void` | `persistExitStatusAndEndTimestamp()` |
    `protected void` | `persistUserData()` |
    `protected PersistentDataWrapper` | `resolveUserData()` |
    `protected abstract void` | `sendStatusFromPartitionToAnalyzerIfPresent()` |
    `void` | `setParentStepContext​(StepContextImpl parentStepContext)` |
    `void` | `setStepContext​(StepContextImpl stepContext)` |
    `protected abstract void` | `setupStepArtifacts()` |
    `protected boolean` | `shouldStepBeExecuted()` |
    `protected void` | `statusStarting()` |
    `protected void` | `storeUserData​(PersistentDataWrapper userData)` |
    `String` | `toString()` |
    `protected void` | `updateBatchStatus​(javax.batch.runtime.BatchStatus updatedBatchStatus)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.batchee.container.Controller

      `stop`

- - ### Field Detail

    - #### jobExecutionImpl

          protected RuntimeJobExecution jobExecutionImpl

    - #### jobInstance

          protected javax.batch.runtime.JobInstance jobInstance

    - #### stepContext

          protected StepContextImpl stepContext

    - #### step

          protected Step step

    - #### stepName

          protected String stepName

    - #### stepStatus

          protected StepStatus stepStatus

    - #### analyzerStatusQueue

          protected BlockingQueue<PartitionDataWrapper> analyzerStatusQueue

    - #### rootJobExecutionId

          protected long rootJobExecutionId

    - #### restartAfterCompletion

          protected boolean restartAfterCompletion

    - #### kernelService

          protected final BatchKernelService kernelService

    - #### persistenceManagerService

          protected final PersistenceManagerService persistenceManagerService

    - #### transactionManager

          protected TransactionManagerAdapter transactionManager

  - ### Constructor Detail

    - #### BaseStepController

          protected BaseStepController​(RuntimeJobExecution jobExecution,
                                       Step step,
                                       StepContextImpl stepContext,
                                       long rootJobExecutionId,
                                       ServicesManager servicesManager)

    - #### BaseStepController

          protected BaseStepController​(RuntimeJobExecution jobExecution,
                                       Step step,
                                       StepContextImpl stepContext,
                                       long rootJobExecutionId,
                                       BlockingQueue<PartitionDataWrapper> analyzerStatusQueue,
                                       ServicesManager servicesManager)

  - ### Method Detail

    - #### invokeCoreStep

          protected abstract void invokeCoreStep()
                                          throws javax.batch.operations.JobRestartException,
                                                 javax.batch.operations.JobStartException,
                                                 javax.batch.operations.JobExecutionAlreadyCompleteException,
                                                 javax.batch.operations.JobExecutionNotMostRecentException

      Throws:
        `javax.batch.operations.JobRestartException`
        `javax.batch.operations.JobStartException`
        `javax.batch.operations.JobExecutionAlreadyCompleteException`
        `javax.batch.operations.JobExecutionNotMostRecentException`

    - #### setupStepArtifacts

          protected abstract void setupStepArtifacts()

    - #### invokePreStepArtifacts

          protected abstract void invokePreStepArtifacts()

    - #### invokePostStepArtifacts

          protected abstract void invokePostStepArtifacts()

    - #### sendStatusFromPartitionToAnalyzerIfPresent

          protected abstract void sendStatusFromPartitionToAnalyzerIfPresent()

    - #### execute

          public ExecutionStatus execute()

      Specified by:
        `execute` in interface `ExecutionElementController`

    - #### markJobAndStepFailed

          protected void markJobAndStepFailed()

    - #### updateBatchStatus

          protected void updateBatchStatus​(javax.batch.runtime.BatchStatus updatedBatchStatus)

    - #### shouldStepBeExecuted

          protected boolean shouldStepBeExecuted()

    - #### isRestartExecution

          protected boolean isRestartExecution()

    - #### statusStarting

          protected void statusStarting()

    - #### persistUserData

          protected void persistUserData()

    - #### resolveUserData

          protected PersistentDataWrapper resolveUserData()

    - #### storeUserData

          protected void storeUserData​(PersistentDataWrapper userData)

    - #### persistExitStatusAndEndTimestamp

          protected void persistExitStatusAndEndTimestamp()

    - #### setStepContext

          public void setStepContext​(StepContextImpl stepContext)

    - #### getLastRunStepExecutions

          public List<Long> getLastRunStepExecutions()

      Specified by:
        `getLastRunStepExecutions` in interface `Controller`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### setParentStepContext

          public void setParentStepContext​(StepContextImpl parentStepContext)