gov.nih.nci.caarray.domain.project
Interface ExecutableJob

All Superinterfaces:
BaseJob

public interface ExecutableJob
extends BaseJob

Adds functionality to Job for execution purposes.

Author:
jscott

Method Summary
 void execute()
          Perform the job.
 CaArrayFileSet getFileSet()
           
 java.sql.PreparedStatement getUnexpectedErrorPreparedStatement(java.sql.Connection connection)
          Returns a prepared statement for the executer of the job to run if the job fails with an unexpected error.
 void markAsCancelled()
          Set the appropriate fileset and job status values, indicating that the job has been cancelled.
 void markAsInProgress()
          Set the appropriate fileset and job status values, indicating that the job is in progress.
 void markAsInQueue()
          Set the appropriate fileset and job status values, indicating that the job is in the queue.
 void markAsProcessed()
          Set the appropriate job status values, indicating that the job has been processed.
 void setJobId(java.util.UUID id)
          Set an uuid for the job.
 boolean userHasReadAccess(gov.nih.nci.security.authorization.domainobjects.User user)
           
 boolean userHasWriteAccess(gov.nih.nci.security.authorization.domainobjects.User user)
           
 
Methods inherited from interface gov.nih.nci.caarray.domain.project.BaseJob
getChildren, getJobEntityId, getJobEntityName, getJobId, getJobStatus, getJobType, getOwnerName, getParent, getTimeRequested, getTimeStarted, isInProgress
 

Method Detail

execute

void execute()
Perform the job.


setJobId

void setJobId(java.util.UUID id)
Set an uuid for the job.

Parameters:
id - the uuid to set.

markAsInQueue

void markAsInQueue()
Set the appropriate fileset and job status values, indicating that the job is in the queue.


markAsCancelled

void markAsCancelled()
Set the appropriate fileset and job status values, indicating that the job has been cancelled.


markAsInProgress

void markAsInProgress()
Set the appropriate fileset and job status values, indicating that the job is in progress.


markAsProcessed

void markAsProcessed()
Set the appropriate job status values, indicating that the job has been processed.


userHasReadAccess

boolean userHasReadAccess(gov.nih.nci.security.authorization.domainobjects.User user)
Parameters:
user - the given user
Returns:
true if the given user has read access to this job

userHasWriteAccess

boolean userHasWriteAccess(gov.nih.nci.security.authorization.domainobjects.User user)
Parameters:
user - the given user
Returns:
true if the given user has write access to this job

getUnexpectedErrorPreparedStatement

java.sql.PreparedStatement getUnexpectedErrorPreparedStatement(java.sql.Connection connection)
                                                               throws java.sql.SQLException
Returns a prepared statement for the executer of the job to run if the job fails with an unexpected error. This is ugly and should be replaced with something that runs at a higher level of abstraction. We should not be doing SQL at this level.

Parameters:
connection - the connection to prepare the statement on
Returns:
the prepared statement
Throws:
java.sql.SQLException - if a SQL error occurs

getFileSet

CaArrayFileSet getFileSet()
Returns:
the file set this job is operating on