Interface CronJobService

    • Method Detail

      • performCronJob

        void performCronJob​(CronJobModel model,
                            boolean synchronous)
        Performs given Cronjob by starting its Job. If synchronous is true, the Job will be performed synchronous, which means that this method will return the control to its caller as recently as this Job is performed. Synchronous execution is especially useful for short Jobs or testing purpose (JUnit tests for example).
        If synchronous is false, the Job will be performed asynchronous by executing the Job in a separate Thread. This method ignores a nodeId CronJobModel.getNodeID() and does not start a Job on the cluster node.
        Parameters:
        model - which will be used
        synchronous - true if the Job should be performed synchronously, false if the Job should be performed asynchronously
      • getCronJob

        CronJobModel getCronJob​(java.lang.String code)
        Gets the cronjob identified unique by given code.
        Parameters:
        code - code for which a cronjob is needed
        Returns:
        cronjob identified unique by given code
        Throws:
        UnknownIdentifierException - in case no cronjob is found
        AmbiguousIdentifierException - in case more than one cronjob is found
      • getJob

        JobModel getJob​(java.lang.String code)
        Gets the job identified unique by given code.
        Parameters:
        code - code for which a job is needed
        Returns:
        job identified unique by given code
        Throws:
        UnknownIdentifierException - in case no job is found
        AmbiguousIdentifierException - in case more than one job is found
      • isSuccessful

        boolean isSuccessful​(CronJobModel cronJob)
        Checks whether the cronjob was executed successfully. Can only be used if cronjob has finished execution ( isFinished(CronJobModel) returns true).
        Parameters:
        cronJob - cronjob to check for
        Returns:
        true if cronjob has finished successfully
        Throws:
        java.lang.IllegalStateException - in case cronjob is still running
      • isError

        boolean isError​(CronJobModel cronJob)
        Checks whether the cronjob was executed not successfully. Can only be used if cronjob has finished execution ( isFinished(CronJobModel) returns true).
        Parameters:
        cronJob - cronjob to check for
        Returns:
        true if cronjob has finished not successfully
        Throws:
        java.lang.IllegalStateException - in case cronjob is still running
      • isPaused

        boolean isPaused​(CronJobModel cronJob)
        Checks whether the cronjob is paused.
        Parameters:
        cronJob - cronjob to check for
        Returns:
        true if cronjob is paused
      • isRunning

        boolean isRunning​(CronJobModel cronJob)
        Checks whether the cronjob has not finished or paused execution yet and is still running regardless if has it been restarted or not.
        Parameters:
        cronJob - cronjob to check for
        Returns:
        true if cronjob is still running
      • isFinished

        boolean isFinished​(CronJobModel cronJob)
        Checks whether the cronjob has finished execution and is not running or paused anymore.
        Parameters:
        cronJob - cronjob to check for
        Returns:
        true if cronjob has finished execution
      • getRunningOrRestartedCronJobs

        java.util.List<CronJobModel> getRunningOrRestartedCronJobs()
        Returns list of CronJobModel instances running on the platform regardless the cluster node.
      • isPerformable

        boolean isPerformable​(CronJobModel cronJob)
        Checks if the cronjob model is performable.
        Parameters:
        cronJob - which will be used
      • isAbortable

        boolean isAbortable​(CronJobModel cronJob)
        Checks if the cronjob model is abortable.
        Parameters:
        cronJob - which will be used