Package org.apache.batchee.container.services.persistence

## Class MemoryPersistenceManagerService

- java.lang.Object
- - org.apache.batchee.container.services.persistence.MemoryPersistenceManagerService

- All Implemented Interfaces:
    `BatchService`, `PersistenceManagerService`

      public class MemoryPersistenceManagerService
      extends Object
      implements PersistenceManagerService

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `protected static interface` | `MemoryPersistenceManagerService.Structures` |

    - ### Nested classes/interfaces inherited from interface org.apache.batchee.spi.PersistenceManagerService

      `PersistenceManagerService.TimestampType`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `MemoryPersistenceManagerService()` |

  - ### Method Summary

    All Methods Instance Methods Concrete 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 rootJobExecId, 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
    `void` | `init​(Properties batchConfig)` |
    `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 timestampType)` |
    `void` | `markJobStarted​(long key, Timestamp startTS)` |
    `protected org.apache.batchee.container.services.persistence.MemoryPersistenceManagerService.Data` | `newData()` |
    `void` | `setCheckpointData​(CheckpointDataKey key, CheckpointData value)` |
    `String` | `toString()` |
    `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 class java.lang.Object

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

- - ### Constructor Detail

    - #### MemoryPersistenceManagerService

          public MemoryPersistenceManagerService()

  - ### Method Detail

    - #### newData

          protected org.apache.batchee.container.services.persistence.MemoryPersistenceManagerService.Data newData()

    - #### init

          public void init​(Properties batchConfig)

      Specified by:
        `init` in interface `BatchService`

    - #### jobOperatorGetJobInstanceCount

          public int jobOperatorGetJobInstanceCount​(String jobName)

      Description copied from interface: `PersistenceManagerService`
      JOB OPERATOR ONLY METHODS
      Specified by:
        `jobOperatorGetJobInstanceCount` in interface `PersistenceManagerService`

    - #### getJobNames

          public Set<String> getJobNames()

      Specified by:
        `getJobNames` in interface `PersistenceManagerService`

    - #### jobOperatorGetJobInstanceIds

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

      Specified by:
        `jobOperatorGetJobInstanceIds` in interface `PersistenceManagerService`

    - #### jobOperatorQueryJobExecutionTimestamp

          public Timestamp jobOperatorQueryJobExecutionTimestamp​(long key,
                                                                 PersistenceManagerService.TimestampType timestampType)

      Specified by:
        `jobOperatorQueryJobExecutionTimestamp` in interface `PersistenceManagerService`

    - #### jobOperatorQueryJobExecutionBatchStatus

          public String jobOperatorQueryJobExecutionBatchStatus​(long key)

      Specified by:
        `jobOperatorQueryJobExecutionBatchStatus` in interface `PersistenceManagerService`

    - #### jobOperatorQueryJobExecutionExitStatus

          public String jobOperatorQueryJobExecutionExitStatus​(long key)

      Specified by:
        `jobOperatorQueryJobExecutionExitStatus` in interface `PersistenceManagerService`

    - #### getStepExecutionsForJobExecution

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

      Specified by:
        `getStepExecutionsForJobExecution` in interface `PersistenceManagerService`

    - #### updateBatchStatusOnly

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

      Specified by:
        `updateBatchStatusOnly` in interface `PersistenceManagerService`

    - #### markJobStarted

          public void markJobStarted​(long key,
                                     Timestamp startTS)

      Specified by:
        `markJobStarted` in interface `PersistenceManagerService`

    - #### updateWithFinalExecutionStatusesAndTimestamps

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

      Specified by:
        `updateWithFinalExecutionStatusesAndTimestamps` in interface `PersistenceManagerService`

    - #### jobOperatorGetJobExecution

          public InternalJobExecution jobOperatorGetJobExecution​(long jobExecutionId)

      Specified by:
        `jobOperatorGetJobExecution` in interface `PersistenceManagerService`

    - #### getParameters

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

      Specified by:
        `getParameters` in interface `PersistenceManagerService`
      Throws:
        `javax.batch.operations.NoSuchJobExecutionException`

    - #### jobOperatorGetJobExecutions

          public List<InternalJobExecution> jobOperatorGetJobExecutions​(long jobInstanceId)

      Specified by:
        `jobOperatorGetJobExecutions` in interface `PersistenceManagerService`

    - #### jobOperatorGetRunningExecutions

          public Set<Long> jobOperatorGetRunningExecutions​(String jobName)

      Specified by:
        `jobOperatorGetRunningExecutions` in interface `PersistenceManagerService`

    - #### getJobStatusFromExecution

          public JobStatus getJobStatusFromExecution​(long executionId)

      Specified by:
        `getJobStatusFromExecution` in interface `PersistenceManagerService`

    - #### getJobInstanceIdByExecutionId

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

      Specified by:
        `getJobInstanceIdByExecutionId` in interface `PersistenceManagerService`
      Throws:
        `javax.batch.operations.NoSuchJobExecutionException`

    - #### createJobInstance

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

      Description copied from interface: `PersistenceManagerService`
      Creates a JobIntance
      Specified by:
        `createJobInstance` in interface `PersistenceManagerService`
      Parameters:
        `name` - the job id from job.xml
        `jobXml` - the resolved job xml
      Returns:
        the job instance

    - #### createJobExecution

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

      Description copied from interface: `PersistenceManagerService`
      Create a JobExecution
      Specified by:
        `createJobExecution` in interface `PersistenceManagerService`
      Parameters:
        `jobInstance` - the parent job instance
        `jobParameters` - the parent job instance parameters
        `batchStatus` - the current BatchStatus
      Returns:
        the RuntimeJobExecution class for this JobExecution

    - #### createStepExecution

          public StepExecutionImpl createStepExecution​(long rootJobExecId,
                                                       StepContextImpl stepContext)

      Description copied from interface: `PersistenceManagerService`
      Create a StepExecution
      Specified by:
        `createStepExecution` in interface `PersistenceManagerService`
      Parameters:
        `rootJobExecId` - the parent JobExecution id
        `stepContext` - the step context for this step execution
      Returns:
        the StepExecution

    - #### updateStepExecution

          public void updateStepExecution​(long jobExecId,
                                          StepContextImpl stepContext)

      Description copied from interface: `PersistenceManagerService`
      Update a StepExecution
      Specified by:
        `updateStepExecution` in interface `PersistenceManagerService`
      Parameters:
        `jobExecId` - the parent JobExecution id
        `stepContext` - the step context for this step execution

    - #### createJobStatus

          public JobStatus createJobStatus​(long jobInstanceId)

      Description copied from interface: `PersistenceManagerService`
      Create a JobStatus
      Specified by:
        `createJobStatus` in interface `PersistenceManagerService`
      Parameters:
        `jobInstanceId` - the parent job instance id
      Returns:
        the JobStatus

    - #### getJobStatus

          public JobStatus getJobStatus​(long instanceId)

      Description copied from interface: `PersistenceManagerService`
      Get a JobStatus
      Specified by:
        `getJobStatus` in interface `PersistenceManagerService`
      Parameters:
        `instanceId` - the parent job instance id
      Returns:
        the JobStatus

    - #### updateJobStatus

          public void updateJobStatus​(long instanceId,
                                      JobStatus jobStatus)

      Description copied from interface: `PersistenceManagerService`
      Update a JobStatus
      Specified by:
        `updateJobStatus` in interface `PersistenceManagerService`
      Parameters:
        `instanceId` - the parent job instance id
        `jobStatus` - the job status to be updated

    - #### createStepStatus

          public StepStatus createStepStatus​(long stepExecId)

      Description copied from interface: `PersistenceManagerService`
      Create a StepStatus
      Specified by:
        `createStepStatus` in interface `PersistenceManagerService`
      Parameters:
        `stepExecId` - the parent step execution id
      Returns:
        the StepStatus

    - #### getStepStatus

          public StepStatus getStepStatus​(long instanceId,
                                          String stepName)

      Description copied from interface: `PersistenceManagerService`
      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.

      Specified by:
        `getStepStatus` in interface `PersistenceManagerService`
      Parameters:
        `instanceId` - the parent job instance id
        `stepName` - the step name
      Returns:
        the StepStatus

    - #### updateStepStatus

          public void updateStepStatus​(long stepExecutionId,
                                       StepStatus stepStatus)

      Description copied from interface: `PersistenceManagerService`
      Update a StepStatus
      Specified by:
        `updateStepStatus` in interface `PersistenceManagerService`
      Parameters:
        `stepExecutionId` - the parent step execution id
        `stepStatus` - the step status to be updated

    - #### setCheckpointData

          public void setCheckpointData​(CheckpointDataKey key,
                                        CheckpointData value)

      Specified by:
        `setCheckpointData` in interface `PersistenceManagerService`

    - #### getCheckpointData

          public CheckpointData getCheckpointData​(CheckpointDataKey key)

      Specified by:
        `getCheckpointData` in interface `PersistenceManagerService`

    - #### getMostRecentExecutionId

          public long getMostRecentExecutionId​(long jobInstanceId)

      Specified by:
        `getMostRecentExecutionId` in interface `PersistenceManagerService`

    - #### createSubJobInstance

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

      Specified by:
        `createSubJobInstance` in interface `PersistenceManagerService`

    - #### createFlowInSplitExecution

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

      Specified by:
        `createFlowInSplitExecution` in interface `PersistenceManagerService`

    - #### getStepExecutionByStepExecutionId

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

      Specified by:
        `getStepExecutionByStepExecutionId` in interface `PersistenceManagerService`

    - #### cleanUp

          public void cleanUp​(long instanceId)

      Specified by:
        `cleanUp` in interface `PersistenceManagerService`

    - #### cleanUp

          public void cleanUp​(Date until)

      Specified by:
        `cleanUp` in interface `PersistenceManagerService`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`