|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bibalex.daf.managers.archive.CommandLineArchiver
public class CommandLineArchiver
This class archive jobs using command line not GUI
Field Summary | |
---|---|
private FileHandlerFTPImpl |
backupFileHandler
backupFileHandler is ftp file handler to download folders from backup server to the local machine |
private java.lang.String |
backupServerIP
backupServerIP represents the backup server IP that holds the backed up folders |
private java.lang.String |
backupServerPassword
backupServerPassword represents the backup server Password |
private java.lang.String |
backupServerPath
backupServerPath represents the path that contains the backed up folders |
private java.lang.String |
backupServerUser
backupServerUser represents the backup server User Name |
(package private) DBConnection |
conn
|
(package private) java.lang.String |
destFolder
destFolder to move jobs in, it's located under working directory of WS to working user |
private FileHandlerLocalImpl |
localFileHandler
localFileHandler is a local file handler to create and delete media folder |
(package private) float |
mediaSize
|
(package private) int |
MTID
|
(package private) java.lang.String |
newMediaBarCode
|
(package private) int |
newMediaID
|
private ResourceManager |
resourceManager
resourceManager handles working with resource fiel |
Constructor Summary | |
---|---|
CommandLineArchiver()
class constrictor |
Method Summary | |
---|---|
private boolean |
checkSelectedJobs(java.util.ArrayList TL_IDList,
int mediaType)
This method checks the validity of recording all the checked jobs in the archive list to DB |
private boolean |
confirmDeletion(int MTID,
int mediaID)
This method confrim media deletion on DB |
private boolean |
createLocalFolder()
This method creates local folder on working user on working WS |
private java.util.ArrayList |
createMedia()
this method creates new instance of media type |
private boolean |
deleteMediaFolder(java.lang.String mediaPath,
int MTID,
int mediaID)
This method checks if media folder has folder orr empty. |
private void |
getBackupServerInformation()
getBackupServerInformation reads backup server credentials |
boolean |
getJobs(int mediaType,
java.lang.String jobCount)
This method carries out downloading jobs in user working directory |
private java.lang.String |
getPath(java.lang.String mediaBarcode,
int jobID,
int version)
This method forms job's full path |
private boolean |
mediaRollBack(int MTID,
int mediaID)
rolls back media instance |
private java.lang.String |
paddingString(java.lang.String s,
int n,
char c,
boolean paddingLeft)
pad a string S with a size of N with char C on the left (True) or on the right(flase) |
private boolean |
publishMedia(int mediaID,
java.lang.String mediaBarcodePath,
int jobID,
java.lang.String version)
This method confirm media and publish the archiving data to DAK |
boolean |
recordJobs(java.lang.String mediaBarcode,
int jobID,
int version)
This method gets all jobs in specified fodler and record them in DB as archived |
private boolean |
recordJobsToDB(java.util.ArrayList TL_IDList,
int mediaType,
int mediaID)
|
private boolean |
validateWS()
This methos checks if current WS can archive or not |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
DBConnection conn
int MTID
int newMediaID
float mediaSize
java.lang.String newMediaBarCode
private FileHandlerLocalImpl localFileHandler
private FileHandlerFTPImpl backupFileHandler
private ResourceManager resourceManager
private java.lang.String backupServerIP
private java.lang.String backupServerUser
private java.lang.String backupServerPassword
private java.lang.String backupServerPath
java.lang.String destFolder
Constructor Detail |
---|
public CommandLineArchiver()
Method Detail |
---|
public boolean getJobs(int mediaType, java.lang.String jobCount)
mediaType
- the media type to collect jobs based onjobCount
- the jobs number to be retrieved
public boolean recordJobs(java.lang.String mediaBarcode, int jobID, int version)
mediaBarcode
- media barcodejobID
- the job to be recordedversion
- the job version
private java.lang.String getPath(java.lang.String mediaBarcode, int jobID, int version)
jobID
- the job to get its folderversion
- job's version
private boolean validateWS()
MTID
- the media type to validate WS on
private java.util.ArrayList createMedia()
MTID
- the media type to create new instance of
private boolean mediaRollBack(int MTID, int mediaID)
MTID
- the media typemediaID
- the media to be rolled back
private boolean createLocalFolder()
private void getBackupServerInformation() throws java.lang.Exception
java.lang.Exception
private boolean publishMedia(int mediaID, java.lang.String mediaBarcodePath, int jobID, java.lang.String version)
mediaID
- media to be publishedmediaType
- media typemediaBarcodePath
- physical folder of mediajobID
- job to be publishedversion
- job's version
private java.lang.String paddingString(java.lang.String s, int n, char c, boolean paddingLeft)
private boolean deleteMediaFolder(java.lang.String mediaPath, int MTID, int mediaID)
mediaPath
- the media folder path
private boolean confirmDeletion(int MTID, int mediaID)
MTID
- mediaID
- media to be confirmed
private boolean checkSelectedJobs(java.util.ArrayList TL_IDList, int mediaType)
readyToArchiveCheckList
- The list of the checked jobs to be archivedmediaType
- The type of media to archive jobs tomediaID
- The newly generated mediaID to use for archiving
private boolean recordJobsToDB(java.util.ArrayList TL_IDList, int mediaType, int mediaID)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |