org.bibalex.daf.entities.job
Class TransitionInfo

java.lang.Object
  extended by org.bibalex.daf.entities.job.TransitionInfo

public class TransitionInfo
extends java.lang.Object

This class calculates the information necessary for completing job transition.
The information can be accessed via getters.
Some information, FtpHandler and Phase, can be reset in order to calculate them again.

Author:
Shehab.Kamal

Field Summary
private  FileHandlerFTPImpl ftpHandler
           
private  Job job
           
private  java.lang.String localPath
           
private  java.util.ArrayList<FileLevelInfo> nextFileLevelInfo
           
private  Phase phase
           
private  java.lang.String remotePath
           
private  java.util.ArrayList<FileLevelInfo> todoFileLevelInfo
           
private  DataTable transactionLogRow
           
private  User user
           
private  WorkStation workstation
           
 
Constructor Summary
TransitionInfo(Job job)
          Creates a new instacne of TransitionInfo.
The user and the workstation are set to the MainController current user and workstation respectively.
TransitionInfo(Job job, User user, WorkStation workstation)
          Creates a new instacne of TransitionInfo.
 
Method Summary
 FileHandlerFTPImpl getFtpHandler()
          Gets the FTP file handler to conenct to the server.
 java.lang.String getLocalPath()
          Gets the job location at the workstation (not including job folder).
 java.util.ArrayList<FileLevelInfo> getNextFileLevelInfo()
          Gets the 'Next' FileLevelInfo associated with the last status data of the job.
If the 'Next' FileLevelInfo cannot be obtained an empty ArrayList is returned.
 Phase getPhase()
          Gets the current phase of the job.
 java.lang.String getRemotePath()
          Gets the job location at the server (not including job folder).
 java.util.ArrayList<FileLevelInfo> getTodoFileLevelInfo()
          Gets the 'ToDo' FileLevelInfo associated with the last status data of the job.
If the 'ToDo' FileLevelInfo cannot be obtained an emtpy ArrayList is returned.
 DataTable getTransactionLogRow()
          Gets the status associated with the last status data of the job.
private  void parseStatusData()
          Gets the TransactionLog row and FileLevelInfo from the job last status data.
 void resetFtpHandler()
          Resets the FtpHanlder.
 void resetPhase()
          Reset the Phase.
 void resetTransactionLogRow()
          Resets the transactionLog, todoFileLevelInfo and nextFileLevelInfo.
 
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

phase

private Phase phase

ftpHandler

private FileHandlerFTPImpl ftpHandler

localPath

private java.lang.String localPath

remotePath

private java.lang.String remotePath

transactionLogRow

private DataTable transactionLogRow

todoFileLevelInfo

private java.util.ArrayList<FileLevelInfo> todoFileLevelInfo

nextFileLevelInfo

private java.util.ArrayList<FileLevelInfo> nextFileLevelInfo
Constructor Detail

TransitionInfo

public TransitionInfo(Job job)
Creates a new instacne of TransitionInfo.
The user and the workstation are set to the MainController current user and workstation respectively.

Parameters:
job - The job to get its transition info.

TransitionInfo

public TransitionInfo(Job job,
                      User user,
                      WorkStation workstation)
Creates a new instacne of TransitionInfo.

Parameters:
job - The job to get its transition info.
user - The user holding or wants to hold the job.
workstation - The workstation at or to which the job will reside.
Method Detail

getFtpHandler

public FileHandlerFTPImpl getFtpHandler()
                                 throws java.lang.Exception
Gets the FTP file handler to conenct to the server.

Returns:
Returns the ftpHandler.
Throws:
java.lang.Exception - If the FTP file hanlder couldn't be obtained.

resetFtpHandler

public void resetFtpHandler()
Resets the FtpHanlder.


getPhase

public Phase getPhase()
               throws java.lang.Exception
Gets the current phase of the job.

Returns:
Returns the phase.
Throws:
java.lang.Exception - If the current job phase couldn't be obtained.

resetPhase

public void resetPhase()
Reset the Phase.


getLocalPath

public java.lang.String getLocalPath()
Gets the job location at the workstation (not including job folder).

Returns:
Returns the localPath.

getRemotePath

public java.lang.String getRemotePath()
                               throws java.lang.Exception
Gets the job location at the server (not including job folder).

Returns:
Returns the remotePath.
Throws:
java.lang.Exception - If the job remote path couldn't be obtained.

resetTransactionLogRow

public void resetTransactionLogRow()
Resets the transactionLog, todoFileLevelInfo and nextFileLevelInfo.


getTransactionLogRow

public DataTable getTransactionLogRow()
Gets the status associated with the last status data of the job.

Returns:
Reurns the transactionLogRow.

getTodoFileLevelInfo

public java.util.ArrayList<FileLevelInfo> getTodoFileLevelInfo()
Gets the 'ToDo' FileLevelInfo associated with the last status data of the job.
If the 'ToDo' FileLevelInfo cannot be obtained an emtpy ArrayList is returned.

Returns:
Returns the todoFileLevelInfo.

getNextFileLevelInfo

public java.util.ArrayList<FileLevelInfo> getNextFileLevelInfo()
Gets the 'Next' FileLevelInfo associated with the last status data of the job.
If the 'Next' FileLevelInfo cannot be obtained an empty ArrayList is returned.

Returns:
Returns the nextFileLevelInfo.

parseStatusData

private void parseStatusData()
Gets the TransactionLog row and FileLevelInfo from the job last status data.