Package se.ikama.bauta.core
Class BautaManager
- java.lang.Object
-
- se.ikama.bauta.core.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
-
-
Field Summary
Fields Modifier and Type Field Description JobMetadataReaderjobMetadataReader
-
Constructor Summary
Constructors Constructor Description 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabandonJob(long executionId)voidafterJob(org.springframework.batch.core.JobExecution jobExecution)org.springframework.batch.core.ExitStatusafterStep(org.springframework.batch.core.StepExecution stepExecution)voidbeforeJob(org.springframework.batch.core.JobExecution jobExecution)voidbeforeStep(org.springframework.batch.core.StepExecution stepExecution)java.util.List<java.lang.String>getServerInfo()java.lang.StringgetShortServerInfo()voidinit()voidinitializeScheduling(boolean refresh)booleanisRebuildSupported()booleanisRefreshSupported()booleanisSchedulingEnabled()java.util.List<JobInstanceInfo>jobDetails()JobInstanceInfojobDetails(java.lang.String jobName)java.util.List<JobInstanceInfo>jobHistory(java.lang.String jobName)java.util.SortedSet<java.lang.String>listJobNames()java.util.Collection<java.lang.String>listJobSummaries()intrebuildServer()Executes an external command that typically Stops the application fetches the lastest version of the application from VCS Rebuilds the application Starts the application againintrefreshServer()voidregisterJobChangeListener(JobEventListener jobEventListener)voidrestartJob(long executionId)booleansetSchedulingEnabled(boolean enabled)java.lang.LongstartJob(java.lang.String jobName, java.lang.String jobParams)java.lang.LongstartJob(java.lang.String jobName, java.util.Map<java.lang.String,java.lang.String> params)voidstopJob(java.lang.String jobName)voidunregisterJobChangeListener(JobEventListener jobEventListener)
-
-
-
Field Detail
-
jobMetadataReader
@Autowired public JobMetadataReader jobMetadataReader
-
-
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.JobParametersInvalidExceptionorg.springframework.batch.core.launch.JobInstanceAlreadyExistsExceptionorg.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.JobParametersInvalidExceptionorg.springframework.batch.core.launch.JobInstanceAlreadyExistsExceptionorg.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.NoSuchJobExceptionorg.springframework.batch.core.launch.NoSuchJobInstanceExceptionorg.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:
beforeJobin interfaceorg.springframework.batch.core.JobExecutionListener
-
afterJob
public void afterJob(org.springframework.batch.core.JobExecution jobExecution)
- Specified by:
afterJobin interfaceorg.springframework.batch.core.JobExecutionListener
-
beforeStep
public void beforeStep(org.springframework.batch.core.StepExecution stepExecution)
- Specified by:
beforeStepin interfaceorg.springframework.batch.core.StepExecutionListener
-
afterStep
public org.springframework.batch.core.ExitStatus afterStep(org.springframework.batch.core.StepExecution stepExecution)
- Specified by:
afterStepin interfaceorg.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.ExceptionExecutes 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)
-
-