Class AtScheduler

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class AtScheduler
    extends ScriptingScheduler
    • Field Detail

      • LOGGER

        private static final org.slf4j.Logger LOGGER
      • QNAMES

        private static final java.lang.String[] QNAMES
      • nextUniqueID

        private long nextUniqueID
    • Method Detail

      • checkQueue

        private void checkQueue​(java.lang.String queueName)
                         throws XenonException
        Checks if the provided queue name is valid, and throws an exception otherwise. Checks against a predefined list of queue names that at uses: a-z, A-Z, and =.
        Parameters:
        queueName - the queue name to check for validity
        Throws:
        NoSuchQueueException - if the queue name is not valid
        XenonException
      • checkQueueNames

        protected void checkQueueNames​(java.lang.String[] givenQueueNames)
                                throws XenonException
        Checks if the queue names given are valid, and throw an exception otherwise. Checks against the list of queues when the scheduler was created.
        Overrides:
        checkQueueNames in class ScriptingScheduler
        Parameters:
        givenQueueNames - the queue names to check for validity
        Throws:
        NoSuchQueueException - if one or more of the queue names is not known in the scheduler
        NoSuchQueueException - if one or more of the queue names is not known in the scheduler
        XenonException
      • getJobInfo

        private java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>> getJobInfo​(java.lang.String[] queueNames)
                                                                                                                 throws XenonException
        Throws:
        XenonException
      • getJobs

        public java.lang.String[] getJobs​(java.lang.String... queueNames)
                                   throws XenonException
        Description copied from class: Scheduler
        Get all job identifier of jobs currently in (one ore more) queues. If no queue names are specified, the job identifiers for all queues are returned. Note that job identifiers of jobs submitted by other users or other schedulers may also be returned.
        Specified by:
        getJobs in class Scheduler
        Parameters:
        queueNames - the names of the queues.
        Returns:
        an array containing the resulting job identifiers .
        Throws:
        NotConnectedException - If scheduler is closed.
        NoSuchQueueException - If the queue does not exist in the scheduler.
        XenonException - If the Scheduler failed to get jobs.
      • getQueueStatuses

        public QueueStatus[] getQueueStatuses​(java.lang.String... queueNames)
                                       throws XenonException
        Description copied from class: Scheduler
        Get the status of all queues. Note that this method will only throw an exception when this exception will influence all status requests. For example, if the scheduler is no longer connected. Exceptions that only refer to a single queue are returned in the QueueStatus returned for that queue.
        Specified by:
        getQueueStatuses in class Scheduler
        Parameters:
        queueNames - the names of the queues.
        Returns:
        an array containing the resulting QueueStatus.
        Throws:
        XenonException - If the Scheduler failed to get the statuses.
      • getUniqueID

        private java.lang.String getUniqueID()
      • getJobStatus

        public JobStatus getJobStatus​(java.lang.String jobIdentifier)
                               throws XenonException
        Description copied from class: Scheduler
        Get the status of a Job.
        Specified by:
        getJobStatus in class Scheduler
        Parameters:
        jobIdentifier - the job identifier of the job to get the status for.
        Returns:
        the status of the Job.
        Throws:
        NoSuchJobException - If the job is not known.
        XenonException - If the status of the job could not be retrieved.
      • cancelJob

        public JobStatus cancelJob​(java.lang.String jobIdentifier)
                            throws XenonException
        Description copied from class: Scheduler
        Cancel a job.

        A status is returned that indicates the state of the job after the cancel. If the job was already done it cannot be cancelled.

        A JobStatus is returned that can be used to determine the state of the job after cancelJob returns. Note that it may take some time before the job has actually terminated. The waitUntilDone method can be used to wait until the job is terminated.

        Specified by:
        cancelJob in class Scheduler
        Parameters:
        jobIdentifier - the identifier of job to kill.
        Returns:
        the status of the Job.
        Throws:
        NoSuchJobException - If the job is not known.
        XenonException - If the status of the job could not be retrieved.
      • getDefaultRuntime

        public int getDefaultRuntime()
        Description copied from class: Scheduler
        Get the default runtime of a job in minutes. If no default runtime is available, -1 will be returned. If the default runtime is infinite, 0 will be returned.
        Overrides:
        getDefaultRuntime in class ScriptingScheduler
        Returns:
        the default runtime of a job in minutes, -1 if no default is available, 0 if the default is infinite.