org.springframework.batch.core.repository.dao

## Class MapJobInstanceDao

- java.lang.Object
- - org.springframework.batch.core.repository.dao.MapJobInstanceDao

- All Implemented Interfaces:
    JobInstanceDao

  Deprecated.
  as of v4.3 in favor of using the `JdbcJobInstanceDao` with an in-memory database. Scheduled for removal in v5.0.

      @Deprecated
      public class MapJobInstanceDao
      extends java.lang.Object
      implements JobInstanceDao

  In-memory implementation of `JobInstanceDao`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MapJobInstanceDao()` Deprecated.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Deprecated.
    `JobInstance` | `createJobInstance(java.lang.String jobName, JobParameters jobParameters)` Deprecated. Create a JobInstance with given name and parameters.
    `java.util.List<JobInstance>` | `findJobInstancesByName(java.lang.String jobName, int start, int count)` Deprecated. Fetch the last job instances with the provided name, sorted backwards by primary key, using a 'like' criteria
    `JobInstance` | `getJobInstance(JobExecution jobExecution)` Deprecated. Fetch the JobInstance for the provided JobExecution.
    `JobInstance` | `getJobInstance(java.lang.Long instanceId)` Deprecated. Fetch the job instance with the provided identifier.
    `JobInstance` | `getJobInstance(java.lang.String jobName, JobParameters jobParameters)` Deprecated. Find the job instance that matches the given name and parameters.
    `int` | `getJobInstanceCount(java.lang.String jobName)` Deprecated. Query the repository for the number of unique `JobInstance`s associated with the supplied job name.
    `java.util.List<JobInstance>` | `getJobInstances(java.lang.String jobName, int start, int count)` Deprecated. Fetch the last job instances with the provided name, sorted backwards by primary key.
    `java.util.List<java.lang.String>` | `getJobNames()` Deprecated. Retrieve the names of all job instances sorted alphabetically - i.e.
    `JobInstance` | `getLastJobInstance(java.lang.String jobName)` Deprecated. Fetch the last job instance by Id for the given job.

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

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

- - ### Constructor Detail

    - #### MapJobInstanceDao

          public MapJobInstanceDao()

      Deprecated.

  - ### Method Detail

    - #### clear

          public void clear()

      Deprecated.

    - #### createJobInstance

          public JobInstance createJobInstance(java.lang.String jobName,
                                               JobParameters jobParameters)

      Deprecated.
      Description copied from interface: `JobInstanceDao`
      Create a JobInstance with given name and parameters. PreConditions: JobInstance for given name and parameters must not already exist PostConditions: A valid job instance will be returned which has been persisted and contains an unique Id.
      Specified by:
        `createJobInstance` in interface `JobInstanceDao`
      Parameters:
        `jobName` - `String` containing the name of the job.
        `jobParameters` - `JobParameters` containing the parameters for the JobInstance.
      Returns:
        JobInstance `JobInstance` instance that was created.

    - #### getJobInstance

          @Nullable
          public JobInstance getJobInstance(java.lang.String jobName,
                                                      JobParameters jobParameters)

      Deprecated.
      Description copied from interface: `JobInstanceDao`
      Find the job instance that matches the given name and parameters. If no matching job instances are found, then returns null.
      Specified by:
        `getJobInstance` in interface `JobInstanceDao`
      Parameters:
        `jobName` - the name of the job
        `jobParameters` - the parameters with which the job was executed
      Returns:
        `JobInstance` object matching the job name and `JobParameters` or `null`

    - #### getJobInstance

          @Nullable
          public JobInstance getJobInstance(@Nullable
                                                      java.lang.Long instanceId)

      Deprecated.
      Description copied from interface: `JobInstanceDao`
      Fetch the job instance with the provided identifier.
      Specified by:
        `getJobInstance` in interface `JobInstanceDao`
      Parameters:
        `instanceId` - the job identifier
      Returns:
        the job instance with this identifier or `null` if it doesn't exist

    - #### getJobNames

          public java.util.List<java.lang.String> getJobNames()

      Deprecated.
      Description copied from interface: `JobInstanceDao`
      Retrieve the names of all job instances sorted alphabetically - i.e. jobs that have ever been executed.
      Specified by:
        `getJobNames` in interface `JobInstanceDao`
      Returns:
        the names of all job instances

    - #### getJobInstances

          public java.util.List<JobInstance> getJobInstances(java.lang.String jobName,
                                                             int start,
                                                             int count)

      Deprecated.
      Description copied from interface: `JobInstanceDao`
      Fetch the last job instances with the provided name, sorted backwards by primary key. if using the JdbcJobInstance, you can provide the jobName with a wildcard (e.g. *Job) to return 'like' job names. (e.g. *Job will return 'someJob' and 'otherJob')
      Specified by:
        `getJobInstances` in interface `JobInstanceDao`
      Parameters:
        `jobName` - the job name
        `start` - the start index of the instances to return
        `count` - the maximum number of objects to return
      Returns:
        the job instances with this name or empty if none

    - #### getLastJobInstance

          @Nullable
          public JobInstance getLastJobInstance(java.lang.String jobName)

      Deprecated.
      Description copied from interface: `JobInstanceDao`
      Fetch the last job instance by Id for the given job.
      Specified by:
        `getLastJobInstance` in interface `JobInstanceDao`
      Parameters:
        `jobName` - name of the job
      Returns:
        the last job instance by Id if any or null otherwise

    - #### getJobInstance

          @Nullable
          public JobInstance getJobInstance(JobExecution jobExecution)

      Deprecated.
      Description copied from interface: `JobInstanceDao`
      Fetch the JobInstance for the provided JobExecution.
      Specified by:
        `getJobInstance` in interface `JobInstanceDao`
      Parameters:
        `jobExecution` - the JobExecution
      Returns:
        the JobInstance for the provided execution or `null` if it doesn't exist.

    - #### getJobInstanceCount

          public int getJobInstanceCount(@Nullable
                                         java.lang.String jobName)
                                  throws NoSuchJobException

      Deprecated.
      Description copied from interface: `JobInstanceDao`
      Query the repository for the number of unique `JobInstance`s associated with the supplied job name.
      Specified by:
        `getJobInstanceCount` in interface `JobInstanceDao`
      Parameters:
        `jobName` - the name of the job to query for
      Returns:
        the number of `JobInstance`s that exist within the associated job repository
      Throws:
        `NoSuchJobException` - thrown if no Job has the jobName specified.

    - #### findJobInstancesByName

          public java.util.List<JobInstance> findJobInstancesByName(java.lang.String jobName,
                                                                    int start,
                                                                    int count)

      Deprecated.
      Description copied from interface: `JobInstanceDao`
      Fetch the last job instances with the provided name, sorted backwards by primary key, using a 'like' criteria
      Specified by:
        `findJobInstancesByName` in interface `JobInstanceDao`
      Parameters:
        `jobName` - `String` containing the name of the job.
        `start` - int containing the offset of where list of job instances results should begin.
        `count` - int containing the number of job instances to return.
      Returns:
        a list of `JobInstance` for the job name requested.