Class BackgroundJobServerConfiguration


  • public class BackgroundJobServerConfiguration
    extends java.lang.Object
    This class allows to configure the BackgroundJobServer
    • Field Detail

      • DEFAULT_POLL_INTERVAL_IN_SECONDS

        public static final int DEFAULT_POLL_INTERVAL_IN_SECONDS
        See Also:
        Constant Field Values
      • DEFAULT_DELETE_SUCCEEDED_JOBS_DURATION

        public static final java.time.Duration DEFAULT_DELETE_SUCCEEDED_JOBS_DURATION
      • DEFAULT_PERMANENTLY_DELETE_JOBS_DURATION

        public static final java.time.Duration DEFAULT_PERMANENTLY_DELETE_JOBS_DURATION
    • Method Detail

      • usingStandardBackgroundJobServerConfiguration

        public static BackgroundJobServerConfiguration usingStandardBackgroundJobServerConfiguration()
        This returns the default configuration with the BackgroundJobServer with a poll interval of 15 seconds and a worker count based on the CPU
        Returns:
        the default JobRunrDashboard configuration
      • andPollIntervalInSeconds

        public BackgroundJobServerConfiguration andPollIntervalInSeconds​(int pollIntervalInSeconds)
        Allows to set the pollIntervalInSeconds for the BackgroundJobServer
        Parameters:
        pollIntervalInSeconds - the pollIntervalInSeconds
        Returns:
        the same configuration instance which provides a fluent api
      • andWorkerCount

        public BackgroundJobServerConfiguration andWorkerCount​(int workerCount)
        Allows to set the workerCount for the BackgroundJobServer which defines the maximum number of jobs that will be run in parallel
        Parameters:
        workerCount - the workerCount for the BackgroundJobServer
        Returns:
        the same configuration instance which provides a fluent api
      • andDeleteSucceededJobsAfter

        public BackgroundJobServerConfiguration andDeleteSucceededJobsAfter​(java.time.Duration duration)
        Allows to set the duration to wait before deleting succeeded jobs
        Parameters:
        duration - the duration to wait before deleting successful jobs
        Returns:
        the same configuration instance which provides a fluent api
      • andPermanentlyDeleteDeletedJobsAfter

        public BackgroundJobServerConfiguration andPermanentlyDeleteDeletedJobsAfter​(java.time.Duration duration)
        Allows to set the the duration to wait before permanently deleting succeeded jobs
        Parameters:
        duration - the duration to wait before permanently deleting successful jobs
        Returns:
        the same configuration instance which provides a fluent api