gov.nih.nci.caarray.domain.project
Class JobSnapshot

java.lang.Object
  extended by gov.nih.nci.caarray.domain.project.JobSnapshot
All Implemented Interfaces:
BaseJob, Job

public class JobSnapshot
extends java.lang.Object
implements Job

Represents the read-only state of another job at the time an instance of this class is created.

Author:
jscott

Constructor Summary
JobSnapshot(gov.nih.nci.security.authorization.domainobjects.User user, ExecutableJob originalJob, int position)
           
 
Method Summary
 java.util.List<BaseJob> getChildren()
          Return an empty list if there are no children.
 long getJobEntityId()
          
 java.lang.String getJobEntityName()
          
 java.util.UUID getJobId()
          
 JobStatus getJobStatus()
          
 JobType getJobType()
          
 BaseJob getOriginalJob()
           
 java.lang.String getOwnerName()
          
 ParentJob getParent()
          
 int getPosition()
          
 java.util.Date getTimeRequested()
          The time requested is never null.
 java.util.Date getTimeStarted()
          
 boolean getUserCanCancelJob()
          
 boolean getUserHasOwnership()
          
 boolean getUserHasReadAccess()
          
 boolean getUserHasWriteAccess()
          
 boolean isInProgress()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobSnapshot

public JobSnapshot(gov.nih.nci.security.authorization.domainobjects.User user,
                   ExecutableJob originalJob,
                   int position)
Parameters:
user - the current user
originalJob - the job this object is a snapshot of
position - the position of the job in the job queue at the time this snapshot is created
Method Detail

getJobId

public java.util.UUID getJobId()

Specified by:
getJobId in interface BaseJob
Returns:
the job id

getOwnerName

public java.lang.String getOwnerName()

Specified by:
getOwnerName in interface BaseJob
Returns:
the name of the user who owns the job

getJobEntityName

public java.lang.String getJobEntityName()

Specified by:
getJobEntityName in interface BaseJob
Returns:
the name of the experiment or array desing related to the job.

getJobEntityId

public long getJobEntityId()

Specified by:
getJobEntityId in interface BaseJob
Returns:
the id of the experiment or array design related to the job.

getJobType

public JobType getJobType()

Specified by:
getJobType in interface BaseJob
Returns:
the jobType

getTimeRequested

public java.util.Date getTimeRequested()
The time requested is never null.

Specified by:
getTimeRequested in interface BaseJob
Returns:
the timeRequested

getTimeStarted

public java.util.Date getTimeStarted()

Specified by:
getTimeStarted in interface BaseJob
Returns:
the timeStarted

getJobStatus

public JobStatus getJobStatus()

Specified by:
getJobStatus in interface BaseJob
Returns:
the job status

getUserHasReadAccess

public boolean getUserHasReadAccess()

Specified by:
getUserHasReadAccess in interface Job
Returns:
true if the user has read access to this job

getUserHasWriteAccess

public boolean getUserHasWriteAccess()

Specified by:
getUserHasWriteAccess in interface Job
Returns:
true if the user has write access to this job

getUserHasOwnership

public boolean getUserHasOwnership()

Specified by:
getUserHasOwnership in interface Job
Returns:
true if the user is the owner of the job

getUserCanCancelJob

public boolean getUserCanCancelJob()


isInProgress

public boolean isInProgress()

Specified by:
isInProgress in interface BaseJob
Returns:
true if the job is in progress

getPosition

public int getPosition()

Specified by:
getPosition in interface Job
Returns:
the position in the queue

getOriginalJob

public BaseJob getOriginalJob()
Returns:
the job represented by this snapshot

getParent

public ParentJob getParent()

Specified by:
getParent in interface BaseJob
Returns:
parent of this job or null if this is top-level job

getChildren

public java.util.List<BaseJob> getChildren()
Return an empty list if there are no children.

Specified by:
getChildren in interface BaseJob
Returns:
children of this job