org.bibalex.daf.entities.job
Class CheckingInState

java.lang.Object
  extended by org.bibalex.daf.entities.job.JobState
      extended by org.bibalex.daf.entities.job.CheckingInState

public class CheckingInState
extends JobState

This class contains the logic necessary to check in the job. Calling makeTransition method will cause the job to be checked in.

Author:
Shehab.Kamal

Field Summary
private  java.lang.String errorMessage
           
private  FileHandler ftpHandler
           
private  TransitionInfo info
           
private  Job job
           
private  Phase phase
           
private  java.lang.String serverDir
           
private  User user
           
private  java.lang.String workingDir
           
private  WorkStation workstation
           
 
Constructor Summary
CheckingInState(Job job, User user, WorkStation workstation)
          Creates a new instance of CheckingInState.
 
Method Summary
 java.lang.String getErrorMessage()
          This method gets the mesage that is to be displaed to the user
 java.lang.String getName()
          Gets the name of the state.
 int getNoOfFiles()
          Gets the number of files required to be transferred in order to check in the job.
 boolean makeTransition()
          Checks in the job.
Notes:
This method assumes that the job exists at the machine working directory.
 boolean makeTransition(Phase phase)
          Checks in the job.
Notes:
This method assumes that the job exists at the machine working directory.
 void setPhase(Phase phase)
          Sets the Phase to validate against instead of the default one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

job

private Job job

user

private User user

workstation

private WorkStation workstation

info

private TransitionInfo info

workingDir

private java.lang.String workingDir

serverDir

private java.lang.String serverDir

ftpHandler

private FileHandler ftpHandler

phase

private Phase phase

errorMessage

private java.lang.String errorMessage
Constructor Detail

CheckingInState

public CheckingInState(Job job,
                       User user,
                       WorkStation workstation)
Creates a new instance of CheckingInState.

Parameters:
job - The job to check in.
user - The user who is checking in the job.
workstation - The workstation from which the job will be checked in.
Method Detail

setPhase

public void setPhase(Phase phase)
Sets the Phase to validate against instead of the default one.

Parameters:
phase - The Phase object to validate against.

getName

public java.lang.String getName()
Gets the name of the state.

Specified by:
getName in class JobState
Returns:
The name of the state.

getNoOfFiles

public int getNoOfFiles()
Gets the number of files required to be transferred in order to check in the job.

Specified by:
getNoOfFiles in class JobState
Returns:
The number of files to check in the job.

makeTransition

public boolean makeTransition()
Checks in the job.
Notes:
This method assumes that the job exists at the machine working directory. However, If the job doesn't exist at the machine working directory, it is created.
The job folder is validated against the phase to which the job is assigned.

Specified by:
makeTransition in class JobState
Returns:
True if the job has been checked in successfully otherwise false.

makeTransition

public boolean makeTransition(Phase phase)
Checks in the job.
Notes:
This method assumes that the job exists at the machine working directory. However, If the job doesn't exist at the machine working directory, it is created.
The job folder is validated against the given Phase object.

Parameters:
phase - The Phase object to validate against.
Returns:
true if the job has been checked in successfully otherwise false.

getErrorMessage

public java.lang.String getErrorMessage()
Description copied from class: JobState
This method gets the mesage that is to be displaed to the user

Specified by:
getErrorMessage in class JobState
Returns:
The error message to be dispalayed to the user