Class BautaManager

  • All Implemented Interfaces:
    org.springframework.batch.core.JobExecutionListener, org.springframework.batch.core.StepExecutionListener, org.springframework.batch.core.StepListener

    public class BautaManager
    extends java.lang.Object
    implements org.springframework.batch.core.StepExecutionListener, org.springframework.batch.core.JobExecutionListener
    • Constructor Detail

      • BautaManager

        public BautaManager​(BautaConfig bautaConfig,
                            org.springframework.batch.core.launch.JobOperator jobOperator,
                            org.springframework.batch.core.repository.JobRepository jobRepository,
                            org.springframework.batch.core.explore.JobExplorer jobExplorer,
                            org.springframework.batch.core.configuration.JobRegistry jobRegistry)
    • Method Detail

      • init

        @PostConstruct
        public void init()
      • initializeScheduling

        public void initializeScheduling​(boolean refresh)
      • startJob

        public java.lang.Long startJob​(java.lang.String jobName,
                                       java.lang.String jobParams)
                                throws org.springframework.batch.core.JobParametersInvalidException,
                                       org.springframework.batch.core.launch.JobInstanceAlreadyExistsException,
                                       org.springframework.batch.core.launch.NoSuchJobException
        Throws:
        org.springframework.batch.core.JobParametersInvalidException
        org.springframework.batch.core.launch.JobInstanceAlreadyExistsException
        org.springframework.batch.core.launch.NoSuchJobException
      • startJob

        public java.lang.Long startJob​(java.lang.String jobName,
                                       java.util.Map<java.lang.String,​java.lang.String> params)
                                throws org.springframework.batch.core.JobParametersInvalidException,
                                       org.springframework.batch.core.launch.JobInstanceAlreadyExistsException,
                                       org.springframework.batch.core.launch.NoSuchJobException
        Throws:
        org.springframework.batch.core.JobParametersInvalidException
        org.springframework.batch.core.launch.JobInstanceAlreadyExistsException
        org.springframework.batch.core.launch.NoSuchJobException
      • stopJob

        public void stopJob​(java.lang.String jobName)
      • restartJob

        public void restartJob​(long executionId)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • abandonJob

        public void abandonJob​(long executionId)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • listJobSummaries

        public java.util.Collection<java.lang.String> listJobSummaries()
                                                                throws org.springframework.batch.core.launch.NoSuchJobException,
                                                                       org.springframework.batch.core.launch.NoSuchJobInstanceException,
                                                                       org.springframework.batch.core.launch.NoSuchJobExecutionException
        Throws:
        org.springframework.batch.core.launch.NoSuchJobException
        org.springframework.batch.core.launch.NoSuchJobInstanceException
        org.springframework.batch.core.launch.NoSuchJobExecutionException
      • listJobNames

        public java.util.SortedSet<java.lang.String> listJobNames()
      • beforeJob

        public void beforeJob​(org.springframework.batch.core.JobExecution jobExecution)
        Specified by:
        beforeJob in interface org.springframework.batch.core.JobExecutionListener
      • afterJob

        public void afterJob​(org.springframework.batch.core.JobExecution jobExecution)
        Specified by:
        afterJob in interface org.springframework.batch.core.JobExecutionListener
      • beforeStep

        public void beforeStep​(org.springframework.batch.core.StepExecution stepExecution)
        Specified by:
        beforeStep in interface org.springframework.batch.core.StepExecutionListener
      • afterStep

        public org.springframework.batch.core.ExitStatus afterStep​(org.springframework.batch.core.StepExecution stepExecution)
        Specified by:
        afterStep in interface org.springframework.batch.core.StepExecutionListener
      • jobDetails

        public java.util.List<JobInstanceInfo> jobDetails()
                                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • jobDetails

        public JobInstanceInfo jobDetails​(java.lang.String jobName)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • jobHistory

        public java.util.List<JobInstanceInfo> jobHistory​(java.lang.String jobName)
                                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • registerJobChangeListener

        public void registerJobChangeListener​(JobEventListener jobEventListener)
      • unregisterJobChangeListener

        public void unregisterJobChangeListener​(JobEventListener jobEventListener)
      • isRebuildSupported

        public boolean isRebuildSupported()
      • rebuildServer

        public int rebuildServer()
                          throws java.lang.Exception
        Executes an external command that typically
        • Stops the application
        • fetches the lastest version of the application from VCS
        • Rebuilds the application
        • Starts the application again
        Returns:
        The exit code of the rebuild command
        Throws:
        java.lang.Exception
      • isRefreshSupported

        public boolean isRefreshSupported()
      • refreshServer

        public int refreshServer()
                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getServerInfo

        public java.util.List<java.lang.String> getServerInfo()
      • getShortServerInfo

        public java.lang.String getShortServerInfo()
      • isSchedulingEnabled

        public boolean isSchedulingEnabled()
      • setSchedulingEnabled

        public boolean setSchedulingEnabled​(boolean enabled)