Last update: 2011-06-23

org.proteios.core
Interface ManageableJobQueueInterface

All Superinterfaces:
AbortableJobQueueInterface, AbortableJobQueueReadOnlyInterface, ManageableJobQueueReadOnlyInterface

public interface ManageableJobQueueInterface
extends AbortableJobQueueInterface, ManageableJobQueueReadOnlyInterface

An interface for a job queue class that allows external requests for adding jobs.

Author:
olle

Method Summary
 void add(JobData jobData)
          Add job to the queue.
 void addExecutionTime(Job.ExecutionTime executionTime)
          Add an execution time to list of execution times automatically handled by the job queue class.
 boolean contains(JobData jobData)
          Checks if the queue contains a job item.
 String getDescription()
          Get the job queue class description string.
 List<Job.ExecutionTime> getExecutionTimeList()
          Get the execution time list.
 String getId()
          Get the job queue class id string.
 JobData getJob(int listIndex)
          Get job specified by list index number in queue.
 JobData getNextJob()
          Get next (first) job in queue, without modifying the queue.
 boolean isEmpty()
          Checks if the queue is empty.
 JobData pollNextJob()
          Retrieve next (first) job in queue and remove it from the queue.
 void remove(JobData jobData)
          Remove job from the queue.
 void setDescription(String description)
          Set the job queue class description string.
 void setId(String id)
          Set the job queue class id string.
 int size()
          Returns the size of the queue.
 void updateStatusForAbortedJobsInQueue()
          Updates status for jobs in queue if they are listed to be aborted.
 
Methods inherited from interface org.proteios.core.AbortableJobQueueInterface
addAbortedJobId, addPluginExecutionRequest, addThread, removeAbortedJobId, removePluginExecutionRequest, removeThread
 
Methods inherited from interface org.proteios.core.AbortableJobQueueReadOnlyInterface
getAbortedJobIdList, getPluginExecutionRequest, getThread, isJobCommandAborted
 

Method Detail

getId

String getId()
Get the job queue class id string.

Specified by:
getId in interface ManageableJobQueueReadOnlyInterface
Returns:
String The job queue class id string.

setId

void setId(String id)
Set the job queue class id string.

Parameters:
id - String The job queue class id string.

getDescription

String getDescription()
Get the job queue class description string.

Specified by:
getDescription in interface ManageableJobQueueReadOnlyInterface
Returns:
String The job queue class description string.

setDescription

void setDescription(String description)
Set the job queue class description string.

Parameters:
description - String The job queue class description string.

getExecutionTimeList

List<Job.ExecutionTime> getExecutionTimeList()
Get the execution time list. This is the list of execution time categories supported by the job queue class for automatic addition of a job to the job queue. A job must have an estimated execution time included in the list to be automatically loaded to the job queue. A job queue manager may override this using public method void addToQueue(int jobId).

Specified by:
getExecutionTimeList in interface ManageableJobQueueReadOnlyInterface
Returns:
List The execution time list.

addExecutionTime

void addExecutionTime(Job.ExecutionTime executionTime)
Add an execution time to list of execution times automatically handled by the job queue class.

Parameters:
executionTime - ExecutionTime The execution time to add.

isEmpty

boolean isEmpty()
Checks if the queue is empty.

Specified by:
isEmpty in interface ManageableJobQueueReadOnlyInterface
Returns:
boolean True if the queue is empty, else false.

size

int size()
Returns the size of the queue.

Specified by:
size in interface ManageableJobQueueReadOnlyInterface
Returns:
int The size of the queue.

contains

boolean contains(JobData jobData)
Checks if the queue contains a job item.

Specified by:
contains in interface ManageableJobQueueReadOnlyInterface
Parameters:
jobData - JobData The job item to check for.
Returns:
boolean True if the queue contains the job item, else false.

getNextJob

JobData getNextJob()
Get next (first) job in queue, without modifying the queue.

Specified by:
getNextJob in interface ManageableJobQueueReadOnlyInterface
Returns:
JobData The job data at the head of the queue, or null if not found.

pollNextJob

JobData pollNextJob()
Retrieve next (first) job in queue and remove it from the queue.

Returns:
JobData The job data at the head of the queue, or null if not found.

getJob

JobData getJob(int listIndex)
Get job specified by list index number in queue.

Specified by:
getJob in interface ManageableJobQueueReadOnlyInterface
Parameters:
listIndex - int Index number in list for job in queue.
Returns:
JobData The job data with specified list index number in queue, or null if not found.

add

void add(JobData jobData)
Add job to the queue.

Parameters:
jobData - JobData The job to add to queue.

remove

void remove(JobData jobData)
Remove job from the queue.

Parameters:
jobData - JobData The job to remove from the queue.

updateStatusForAbortedJobsInQueue

void updateStatusForAbortedJobsInQueue()
Updates status for jobs in queue if they are listed to be aborted. Note that changing the status for a job item in the database does not change the status of a job already put in the job queue.


Last update: 2011-06-23