com.trendmicro.grid.acl.ds
Interface JobRepository

All Superinterfaces:
Repository

public interface JobRepository
extends Repository

Defines a repository that manages the processing Jobs inside the GRID.

Version:
1.0
Author:
juergen_kellerer, 2010-05-07

Method Summary
 void addJobSources(com.trendmicro.grid.acl.l0.datatypes.Job job, List<com.trendmicro.grid.acl.l0.datatypes.Source> sources)
          Adds sources to a single processing job.
 void addJobSources(UUID jobId, List<com.trendmicro.grid.acl.l0.datatypes.Source> sources)
          Adds sources to a single processing job.
 UUID createJob()
          Prepares a new processing job and returns the job's GUID.
 UUID createSubJob(UUID parentJobId)
          Prepares a new processing job and returns the job's GUID.
 void finalizeJob(com.trendmicro.grid.acl.l0.datatypes.Job job, com.trendmicro.grid.acl.l0.datatypes.Job.State finalJobState)
          Finalizes the specified job (sets it to the final state) or removes the job if it hasn't been started.
 void finalizeJob(UUID jobId, com.trendmicro.grid.acl.l0.datatypes.Job.State finalJobState)
          Finalizes the specified job (sets it to the final state) or removes the job if it hasn't been started.
 SharedJobDetails getJobDetails(UUID jobId)
          Returns the detailed information on a job, idenified by its id.
 Collection<SharedJob> getJobs(Collection<UUID> jobIds)
          Returns the read & writable information on the jobs, idenified by its ids.
 com.trendmicro.grid.acl.l0.datatypes.UUIDListPage getJobsByStateInRange(com.trendmicro.grid.acl.l0.datatypes.Job.State jobState, Date updatedFromDate, Date updatedToDate, int pageNumber)
          Returns a paged list of running jobs.
 com.trendmicro.grid.acl.l0.datatypes.Job.State getJobState(UUID jobId)
          Returns the state of the given job.
 void updateJob(com.trendmicro.grid.acl.l0.datatypes.Job job)
          Updates the given job inside the persistent store (= the database)
 

Method Detail

createJob

UUID createJob()
Prepares a new processing job and returns the job's GUID.

Returns:
The GUID of the job.

createSubJob

UUID createSubJob(UUID parentJobId)
Prepares a new processing job and returns the job's GUID.

Parameters:
parentJobId - The id of the parent job to bind this job to.
Returns:
The GUID of the job.

addJobSources

void addJobSources(UUID jobId,
                   List<com.trendmicro.grid.acl.l0.datatypes.Source> sources)
Adds sources to a single processing job.

Parameters:
jobId - the id of the job to add the source to.
sources - The sources to add.

addJobSources

void addJobSources(com.trendmicro.grid.acl.l0.datatypes.Job job,
                   List<com.trendmicro.grid.acl.l0.datatypes.Source> sources)
Adds sources to a single processing job.

Parameters:
job - the job to add the source to.
sources - The sources to add.

updateJob

void updateJob(com.trendmicro.grid.acl.l0.datatypes.Job job)
Updates the given job inside the persistent store (= the database)

Parameters:
job - the job to update.
Throws:
IllegalArgumentException - in case of the given value is null or doesn't reference an existing job.

finalizeJob

void finalizeJob(UUID jobId,
                 com.trendmicro.grid.acl.l0.datatypes.Job.State finalJobState)
                 throws IllegalArgumentException
Finalizes the specified job (sets it to the final state) or removes the job if it hasn't been started.

Parameters:
jobId - The GUID of the job to finalize.
finalJobState - the final state of the job or 'null' to finalize / remove a job that hasn't been started.
Throws:
IllegalArgumentException - in case of the final job state is set and not in Job.FINAL_STATES.

finalizeJob

void finalizeJob(com.trendmicro.grid.acl.l0.datatypes.Job job,
                 com.trendmicro.grid.acl.l0.datatypes.Job.State finalJobState)
                 throws IllegalArgumentException
Finalizes the specified job (sets it to the final state) or removes the job if it hasn't been started.

Parameters:
job - The job to finalize.
finalJobState - the final state of the job or 'null' to finalize / remove a job that hasn't been started.
Throws:
IllegalArgumentException - in case of the final job state is set and not in Job.FINAL_STATES.

getJobsByStateInRange

com.trendmicro.grid.acl.l0.datatypes.UUIDListPage getJobsByStateInRange(com.trendmicro.grid.acl.l0.datatypes.Job.State jobState,
                                                                        Date updatedFromDate,
                                                                        Date updatedToDate,
                                                                        int pageNumber)
Returns a paged list of running jobs.

Parameters:
jobState - The state of the jobs to list.
updatedFromDate - The inclusive lower bound for the last-update date value or 'null' if there is no lower bound.
updatedToDate - The exclusive upper bound for the last-update date value or 'null' if there is no upper bound.
pageNumber - The page number of the list page to return (0 is first page).
Returns:
A single list page for the given page number or 'null' if no jobs are running or the pageNumber is out of range.

getJobState

com.trendmicro.grid.acl.l0.datatypes.Job.State getJobState(UUID jobId)
Returns the state of the given job.

Parameters:
jobId - the id of the job to validate the state of.
Returns:
the state of the given job or 'null' no job exists for the given id.

getJobs

Collection<SharedJob> getJobs(Collection<UUID> jobIds)
Returns the read & writable information on the jobs, idenified by its ids.

Parameters:
jobIds - The GUIDs of the jobs to retur.
Returns:
the jobs, idenified by its ids.

getJobDetails

SharedJobDetails getJobDetails(UUID jobId)
Returns the detailed information on a job, idenified by its id.

Parameters:
jobId - The GUID of the job to return the details for.
Returns:
the details on a job, idenified by its id.