org.bibalex.daf.managers.checkin
Class RetrievalCommandLine

java.lang.Object
  extended by org.bibalex.daf.managers.checkin.RetrievalCommandLine

public class RetrievalCommandLine
extends java.lang.Object

This class is used to retrieve Jobs from different medias using the Command Line for Batch Processing Purposes.

Author:
Fadi.Edward

Constructor Summary
RetrievalCommandLine()
           
 
Method Summary
private  boolean assignJobTo(Job job, int jobTypeID, int phaseID, int userID)
          Assigns and uploads the given Job to the listed phase and user.
private  StatusDef initializeBackUpStatusDef(Job job, int transactionLogID)
          Initialized the BackUp Info from the StatusDef object.
 boolean retrieveJob(int jobID, int transactionLogID, int version, java.lang.String mediaBarcode, java.lang.String retrievalPluginName, int assignedJobType, int assignedPhase, int assignedUser)
          This is the main entry point for this Object/Class, it retrieves the given Job from the specified Media using the indicated Retrieval Plugin, then assigns the Job to the Given User/Phase/Job Type.
private  boolean retrievePhysicalFiles(IRetrievalPlugin retrievalPlugin, Job job, java.lang.String mediaBarcode, int transactionLogID, int version)
          Retrieves the Physical files of the Job to be retrieved given the Retrival Plugin to be used, into the Working directory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RetrievalCommandLine

public RetrievalCommandLine()
Method Detail

retrieveJob

public boolean retrieveJob(int jobID,
                           int transactionLogID,
                           int version,
                           java.lang.String mediaBarcode,
                           java.lang.String retrievalPluginName,
                           int assignedJobType,
                           int assignedPhase,
                           int assignedUser)
This is the main entry point for this Object/Class, it retrieves the given Job from the specified Media using the indicated Retrieval Plugin, then assigns the Job to the Given User/Phase/Job Type.

Parameters:
jobID - The ID of the Job to be retrieved, used to create a Job object.
transactionLogID - The ID of the finish entry of the Backup Log from the transaction log table.
version - The version to be retrieved.
mediaBarcode - The Barcode of the media to retrieve from.
retrievalPluginName - The Full Path name of the plugin to use, make sure that this path is included in the runtime classpath, ex:org.bibalex.daf.retrievalplugins.OnlineStorageRetrieval .
assignedJobType - The Job Type ID to be assigned to. (You can find the Job Types in the table JobType, and this is the Field JT_ID).
assignedPhase - The Phase ID to be assigned to. (You can find the Phases in the table Phase, and this is the Field Phase_ID).
assignedUser - The User ID to be assigned to. (You can find the Users in the table User, and this is the Field User_ID).
Returns:
true, if successfull false otherwise.

retrievePhysicalFiles

private boolean retrievePhysicalFiles(IRetrievalPlugin retrievalPlugin,
                                      Job job,
                                      java.lang.String mediaBarcode,
                                      int transactionLogID,
                                      int version)
Retrieves the Physical files of the Job to be retrieved given the Retrival Plugin to be used, into the Working directory

Parameters:
retrievalPlugin - The Retrieval Plugin to be used, make sure the plugin jar is included in the classpath.
job - The Job object of the Job to be retrieved.
mediaBarcode - The Barcode of the media to retrieve from.
transactionLogID - The ID of the finish entry of the Backup Log from the transaction log table.
version - The version to be retrieved.
Returns:
true, if successfull false otherwise.

initializeBackUpStatusDef

private StatusDef initializeBackUpStatusDef(Job job,
                                            int transactionLogID)
                                     throws StatusDefException
Initialized the BackUp Info from the StatusDef object. And adjusts upon wether it is an old or new Job.

Parameters:
job - The Job to work on.
transactionLogID - The transactionLogID to extract the status data from.
Returns:
The StatusDef of that Job at this TransactionLog entry.
Throws:
StatusDefException

assignJobTo

private boolean assignJobTo(Job job,
                            int jobTypeID,
                            int phaseID,
                            int userID)
Assigns and uploads the given Job to the listed phase and user. If the job is already in the system then it is considered a simple assign or Job Type change, otherwise the job has also to be moved from the OldTransactionLog table to the Active one (TransactionLog table).

Parameters:
job - The Job to be assigned.
jobTypeID - The JobType ID to be modified to if necessary.
phaseID - The Phase ID to assign to within this JobType.
userID - The User ID to assign to.
Returns:
true if assign is successfull, false otherwise.