Class CachedJobExecutionProvider

  • All Implemented Interfaces:
    JobExecutionProvider, java.util.function.Consumer<org.springframework.batch.core.JobExecution>

    @Component
    public class CachedJobExecutionProvider
    extends java.lang.Object
    implements java.util.function.Consumer<org.springframework.batch.core.JobExecution>, JobExecutionProvider
    Provides information for recent JobExecutions and is faster than AllJobExecutionProvider if a large number of executions exists.
    • Constructor Summary

      Constructors 
      Constructor Description
      CachedJobExecutionProvider​(com.github.chrisgleissner.springbatchrest.util.adhoc.property.JobExecutionAspect executionAspect, AllJobExecutionProvider allJobExecutionProvider, int maxNumberOfExecutionsPerJob)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(org.springframework.batch.core.JobExecution je)  
      java.util.Collection<org.springframework.batch.core.JobExecution> getJobExecutions​(java.util.Optional<java.lang.String> jobNameRegexp, java.util.Optional<java.lang.String> exitCode, int maxNumberOfExecutionsPerJobName)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.Consumer

        andThen
      • Methods inherited from interface com.github.chrisgleissner.springbatchrest.api.jobexecution.provider.JobExecutionProvider

        limit
    • Constructor Detail

      • CachedJobExecutionProvider

        public CachedJobExecutionProvider​(com.github.chrisgleissner.springbatchrest.util.adhoc.property.JobExecutionAspect executionAspect,
                                          AllJobExecutionProvider allJobExecutionProvider,
                                          @Value("${com.github.chrisgleissner.springbatchrest.maxNumberOfExecutionsPerJob:100}")
                                          int maxNumberOfExecutionsPerJob)
    • Method Detail

      • getJobExecutions

        public java.util.Collection<org.springframework.batch.core.JobExecution> getJobExecutions​(java.util.Optional<java.lang.String> jobNameRegexp,
                                                                                                  java.util.Optional<java.lang.String> exitCode,
                                                                                                  int maxNumberOfExecutionsPerJobName)
        Specified by:
        getJobExecutions in interface JobExecutionProvider
      • accept

        public void accept​(org.springframework.batch.core.JobExecution je)
        Specified by:
        accept in interface java.util.function.Consumer<org.springframework.batch.core.JobExecution>