Package org.apache.batchee.spi

## Interface PersistenceManagerService

- All Superinterfaces:
    `BatchService`
  All Known Implementing Classes:
    `JDBCPersistenceManagerService`, `JPAPersistenceManagerService`, `MemoryPersistenceManagerService`

      public interface PersistenceManagerService
      extends BatchService

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `PersistenceManagerService.TimestampType` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `cleanUp​(long instanceId)` |
    `void` | `cleanUp​(Date until)` |
    `RuntimeFlowInSplitExecution` | `createFlowInSplitExecution​(javax.batch.runtime.JobInstance jobInstance, javax.batch.runtime.BatchStatus batchStatus)` |
    `RuntimeJobExecution` | `createJobExecution​(javax.batch.runtime.JobInstance jobInstance, Properties jobParameters, javax.batch.runtime.BatchStatus batchStatus)` | Create a JobExecution
    `javax.batch.runtime.JobInstance` | `createJobInstance​(String name, String jobXml)` | Creates a JobIntance
    `JobStatus` | `createJobStatus​(long jobInstanceId)` | Create a JobStatus
    `StepExecutionImpl` | `createStepExecution​(long jobExecId, StepContextImpl stepContext)` | Create a StepExecution
    `StepStatus` | `createStepStatus​(long stepExecId)` | Create a StepStatus
    `javax.batch.runtime.JobInstance` | `createSubJobInstance​(String name)` |
    `CheckpointData` | `getCheckpointData​(CheckpointDataKey key)` |
    `long` | `getJobInstanceIdByExecutionId​(long executionId)` |
    `Set<String>` | `getJobNames()` |
    `JobStatus` | `getJobStatus​(long instanceId)` | Get a JobStatus
    `JobStatus` | `getJobStatusFromExecution​(long executionId)` |
    `long` | `getMostRecentExecutionId​(long jobInstanceId)` |
    `Properties` | `getParameters​(long executionId)` |
    `javax.batch.runtime.StepExecution` | `getStepExecutionByStepExecutionId​(long stepExecId)` |
    `List<javax.batch.runtime.StepExecution>` | `getStepExecutionsForJobExecution​(long execid)` |
    `StepStatus` | `getStepStatus​(long instanceId, String stepName)` | Get a StepStatus
    `InternalJobExecution` | `jobOperatorGetJobExecution​(long jobExecutionId)` |
    `List<InternalJobExecution>` | `jobOperatorGetJobExecutions​(long jobInstanceId)` |
    `int` | `jobOperatorGetJobInstanceCount​(String jobName)` | JOB OPERATOR ONLY METHODS
    `List<Long>` | `jobOperatorGetJobInstanceIds​(String jobName, int start, int count)` |
    `Set<Long>` | `jobOperatorGetRunningExecutions​(String jobName)` |
    `String` | `jobOperatorQueryJobExecutionBatchStatus​(long key)` |
    `String` | `jobOperatorQueryJobExecutionExitStatus​(long key)` |
    `Timestamp` | `jobOperatorQueryJobExecutionTimestamp​(long key, PersistenceManagerService.TimestampType timetype)` |
    `void` | `markJobStarted​(long key, Timestamp startTS)` |
    `void` | `setCheckpointData​(CheckpointDataKey key, CheckpointData value)` |
    `void` | `updateBatchStatusOnly​(long executionId, javax.batch.runtime.BatchStatus batchStatus, Timestamp timestamp)` |
    `void` | `updateJobStatus​(long instanceId, JobStatus jobStatus)` | Update a JobStatus
    `void` | `updateStepExecution​(long jobExecId, StepContextImpl stepContext)` | Update a StepExecution
    `void` | `updateStepStatus​(long stepExecutionId, StepStatus stepStatus)` | Update a StepStatus
    `void` | `updateWithFinalExecutionStatusesAndTimestamps​(long key, javax.batch.runtime.BatchStatus batchStatus, String exitStatus, Timestamp updatets)` |

    - ### Methods inherited from interface org.apache.batchee.spi.BatchService

      `init`

- - ### Method Detail

    - #### jobOperatorGetJobInstanceCount

          int jobOperatorGetJobInstanceCount​(String jobName)

      JOB OPERATOR ONLY METHODS

    - #### getJobNames

          Set<String> getJobNames()

    - #### jobOperatorGetJobInstanceIds

          List<Long> jobOperatorGetJobInstanceIds​(String jobName,
                                                  int start,
                                                  int count)

    - #### jobOperatorQueryJobExecutionTimestamp

          Timestamp jobOperatorQueryJobExecutionTimestamp​(long key,
                                                          PersistenceManagerService.TimestampType timetype)

    - #### jobOperatorQueryJobExecutionBatchStatus

          String jobOperatorQueryJobExecutionBatchStatus​(long key)

    - #### jobOperatorQueryJobExecutionExitStatus

          String jobOperatorQueryJobExecutionExitStatus​(long key)

    - #### getStepExecutionsForJobExecution

          List<javax.batch.runtime.StepExecution> getStepExecutionsForJobExecution​(long execid)

    - #### updateBatchStatusOnly

          void updateBatchStatusOnly​(long executionId,
                                     javax.batch.runtime.BatchStatus batchStatus,
                                     Timestamp timestamp)

    - #### markJobStarted

          void markJobStarted​(long key,
                              Timestamp startTS)

    - #### updateWithFinalExecutionStatusesAndTimestamps

          void updateWithFinalExecutionStatusesAndTimestamps​(long key,
                                                             javax.batch.runtime.BatchStatus batchStatus,
                                                             String exitStatus,
                                                             Timestamp updatets)

    - #### jobOperatorGetJobExecution

          InternalJobExecution jobOperatorGetJobExecution​(long jobExecutionId)

    - #### getParameters

          Properties getParameters​(long executionId)
                            throws javax.batch.operations.NoSuchJobExecutionException

      Throws:
        `javax.batch.operations.NoSuchJobExecutionException`

    - #### jobOperatorGetJobExecutions

          List<InternalJobExecution> jobOperatorGetJobExecutions​(long jobInstanceId)

    - #### jobOperatorGetRunningExecutions

          Set<Long> jobOperatorGetRunningExecutions​(String jobName)

    - #### getJobStatusFromExecution

          JobStatus getJobStatusFromExecution​(long executionId)

    - #### getJobInstanceIdByExecutionId

          long getJobInstanceIdByExecutionId​(long executionId)
                                      throws javax.batch.operations.NoSuchJobExecutionException

      Throws:
        `javax.batch.operations.NoSuchJobExecutionException`

    - #### createJobInstance

          javax.batch.runtime.JobInstance createJobInstance​(String name,
                                                            String jobXml)

      Creates a JobIntance
      Parameters:
        `name` - the job id from job.xml
        `jobXml` - the resolved job xml
      Returns:
        the job instance

    - #### createJobExecution

          RuntimeJobExecution createJobExecution​(javax.batch.runtime.JobInstance jobInstance,
                                                 Properties jobParameters,
                                                 javax.batch.runtime.BatchStatus batchStatus)

      Create a JobExecution
      Parameters:
        `jobInstance` - the parent job instance
        `jobParameters` - the parent job instance parameters
        `batchStatus` - the current BatchStatus
      Returns:
        the RuntimeJobExecution class for this JobExecution

    - #### createStepExecution

          StepExecutionImpl createStepExecution​(long jobExecId,
                                                StepContextImpl stepContext)

      Create a StepExecution
      Parameters:
        `jobExecId` - the parent JobExecution id
        `stepContext` - the step context for this step execution
      Returns:
        the StepExecution

    - #### updateStepExecution

          void updateStepExecution​(long jobExecId,
                                   StepContextImpl stepContext)

      Update a StepExecution
      Parameters:
        `jobExecId` - the parent JobExecution id
        `stepContext` - the step context for this step execution

    - #### createJobStatus

          JobStatus createJobStatus​(long jobInstanceId)

      Create a JobStatus
      Parameters:
        `jobInstanceId` - the parent job instance id
      Returns:
        the JobStatus

    - #### getJobStatus

          JobStatus getJobStatus​(long instanceId)

      Get a JobStatus
      Parameters:
        `instanceId` - the parent job instance id
      Returns:
        the JobStatus

    - #### updateJobStatus

          void updateJobStatus​(long instanceId,
                               JobStatus jobStatus)

      Update a JobStatus
      Parameters:
        `instanceId` - the parent job instance id
        `jobStatus` - the job status to be updated

    - #### createStepStatus

          StepStatus createStepStatus​(long stepExecId)

      Create a StepStatus
      Parameters:
        `stepExecId` - the parent step execution id
      Returns:
        the StepStatus

    - #### getStepStatus

          StepStatus getStepStatus​(long instanceId,
                                   String stepName)

      Get a StepStatus

      The parent job instance id and this step name from the job xml are used to determine if the current step execution have previously run.

      Parameters:
        `instanceId` - the parent job instance id
        `stepName` - the step name
      Returns:
        the StepStatus

    - #### updateStepStatus

          void updateStepStatus​(long stepExecutionId,
                                StepStatus stepStatus)

      Update a StepStatus
      Parameters:
        `stepExecutionId` - the parent step execution id
        `stepStatus` - the step status to be updated

    - #### setCheckpointData

          void setCheckpointData​(CheckpointDataKey key,
                                 CheckpointData value)

    - #### getCheckpointData

          CheckpointData getCheckpointData​(CheckpointDataKey key)

    - #### getMostRecentExecutionId

          long getMostRecentExecutionId​(long jobInstanceId)

    - #### createSubJobInstance

          javax.batch.runtime.JobInstance createSubJobInstance​(String name)

    - #### createFlowInSplitExecution

          RuntimeFlowInSplitExecution createFlowInSplitExecution​(javax.batch.runtime.JobInstance jobInstance,
                                                                 javax.batch.runtime.BatchStatus batchStatus)

    - #### getStepExecutionByStepExecutionId

          javax.batch.runtime.StepExecution getStepExecutionByStepExecutionId​(long stepExecId)

    - #### cleanUp

          void cleanUp​(long instanceId)

    - #### cleanUp

          void cleanUp​(Date until)