|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bibalex.daf.entities.AdminModuleBase org.bibalex.daf.entities.phase.Phase
public class Phase
Handles the checks and actions associated with the phase.
Field Summary | |
---|---|
private DBConnection |
conn
|
private java.lang.String |
description
|
private int |
id
|
private int |
jobType
|
private int |
maxPeriod
|
private java.lang.String |
name
|
private int |
noOfFiles
Holds the number of files uploaded to server after finishing the PhysicalAction |
private int |
sequence
|
private org.w3c.dom.Node |
userData
Holds the user data that he entered in response to the DatabaseAction. |
private java.lang.String |
xmlDescription
|
Constructor Summary | |
---|---|
Phase()
Creates a new instance of Phase. |
|
Phase(DataTable table)
Creates a new instance of Phase. This constructor fills all the fields from the DataTable. Remarks: Fields that correspond to null database columns are left to default values, i.e. |
|
Phase(int phaseID,
int jobTypeID)
Creates a new instance of Phase. |
Method Summary | |
---|---|
OperationInfo |
add()
Adds this instance to the Phase table. |
void |
applyActions(ActionContext context,
Job job,
FileHandler handler,
java.lang.String source,
java.lang.String destination)
Applies the pre-phase or post-phase actions as defined in the physical, reflection and database sections of the phase definition. |
void |
applyChecks(ActionContext context,
FileHandler fileHandler,
java.lang.String jobPath,
ActionContext alternateContext,
FileHandler alternateHandler,
java.lang.String alternatePath)
Applies pre-phase or post-phase checks as defined in the physical section of the phase definition. |
void |
applyPostPhaseActions(Job job,
FileHandler handler,
java.lang.String source,
java.lang.String destination)
Applies the post-phase checks as defined in the physical, reflection and database sections of the phase definition. |
void |
applyPostPhaseChecks(java.lang.String localPath,
FileHandler ftpHandler,
java.lang.String serverPath)
Applies the post-phase checks as defined in the physical section of the phase definition. |
void |
applyPrePhaseActions(Job job,
FileHandler handler,
java.lang.String source,
java.lang.String destination)
Applies the pre-phase checks as defined in the physical, reflection and database sections of the phase definition. |
void |
applyPrePhaseChecks(java.lang.String serverPath,
FileHandler ftpHandler,
java.lang.String localPath)
Applies the pre-phase checks as defined in the physical section of the phase definition. |
OperationInfo |
delete()
Deletes this instance from the Phase table. |
OperationInfo |
deleteCascade()
Deletes this instance from the Phase table. |
OperationInfo |
getAllUsers()
Gets all the users who can work in this phase. |
static OperationInfo |
getByID(int phaseID,
int jobTypeID)
Gets the phase specified by the phaseID and jobTypeID. |
static OperationInfo |
getByName(java.lang.String phaseName)
Gets the phase with the given name. |
java.lang.String |
getDescription()
Gets the description of the phase. |
OperationInfo |
getFinishedJobs(int collID,
int batchID)
Gets finished jobs for this phase. |
OperationInfo |
getFinishedJobsMoreThanOnce(int collID,
int batchID)
Gets finished jobs for this phase more than one time. |
OperationInfo |
getFinishedJobsOnce(int collID,
int batchID)
Gets finished jobs for this phase one time. |
int |
getID()
Gets the ID of the phase. |
int |
getJobType()
Gets the job type of the phase. |
private DatabaseInfoDef |
getLastFinishedDatabaseInfo(Job job)
Gets the phase last finished information. This method logs any error that might occur as warnings. |
static int |
getLastUser(int jobID,
int phaseID,
int jsID)
Gets the last user who has done thie phase |
int |
getMaxPeriod()
Gets the maximum period of the phase. |
java.lang.String |
getName()
Gets the name of the phase |
OperationInfo |
getNextPhase()
Gets next phase of the current one |
int |
getNoOfFiles()
Gets the number of files uploaded to the server after applying the PhysicalAction. Caution: Don't call this method before applying the phase actions. |
OperationInfo |
getPendingJobs(int collID,
int batchID)
Gets pending jobs for this phase. |
OperationInfo |
getPendingJobsMoreThanOnce(int collID,
int batchID)
Gets the jobs pending in this phase more than one time. |
OperationInfo |
getPendingJobsOnce(int collID,
int batchID)
Gets the jobs pending in this phase for one time. |
OperationInfo |
getProcessingJobs(int collID,
int batchID)
Gets the jobs that are in this phase. |
OperationInfo |
getProcessingJobsMoreThanOnce(int collID,
int batchID)
Gets the jobs that are in this phase more than one time. |
OperationInfo |
getProcessingJobsOnce(int collID,
int batchID)
Gets the jobs that are in this phase one time. |
private SemiPhaseDef |
getSemiPhaseDef(ActionContext context)
Gets the SemiPhaseDef of the phase xml description. |
int |
getSequence()
Gets the sequence of the phase. |
private DatabaseInfoDef |
getStartDatabaseInfo(Job job)
Gets the phase last finished information. This method logs any error that might occur as warnings. |
org.w3c.dom.Node |
getUserData()
Gets the user data that he entered in response for the DatabaseAction. Caution: Don't call this method before applying the phase actions. |
java.lang.String |
getXmlDescription()
Gets the Xml description of the book. |
boolean |
isLastPhase()
Determines whether this phase is the last phase or not. A phase is considered as last phase in the following two cases: 1) It is the last phase in the job type sequence. 2) It is not included in the sequence at all |
static OperationInfo |
loadAll()
Loads all the entries form the Phase table. |
static OperationInfo |
loadSpecial()
Gets all the Phases |
void |
setDescription(java.lang.String description)
Sets the description of the phase. |
void |
setFieldsFromDataTable(DataTable table)
Uses the given DataTable to set the fields. |
void |
setID(int phaseID)
Sets the ID of the phase. |
void |
setJobType(int jobType)
Sets the job type of the phase. |
void |
setMaxPeriod(int maxPeriod)
Sets the maximum period of the phase. |
void |
setName(java.lang.String name)
Sets the name of the phase. |
void |
setSequence(int sequence)
Sets the sequence of the phase. |
void |
setXmlDescription(java.lang.String xmlDescription)
Sets the Xml description of the phase. |
java.lang.String |
toString()
Returns the string representation of this object. |
OperationInfo |
update()
Updates this instance in the Phase table. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private DBConnection conn
private int id
private java.lang.String name
private int sequence
private int maxPeriod
private java.lang.String description
private java.lang.String xmlDescription
private int jobType
private int noOfFiles
private org.w3c.dom.Node userData
Constructor Detail |
---|
public Phase()
public Phase(int phaseID, int jobTypeID) throws java.lang.Exception
phaseID
- The ID of the Phase.jobTypeID
- The ID of the JobType.
java.lang.Exception
- If the phase couldn't be retrieved from the database.public Phase(DataTable table) throws java.lang.Exception
table
- The DataTable used to construct the object.
java.lang.Exception
- If the phase couldn't be constructed from the DataTable.Method Detail |
---|
public void setFieldsFromDataTable(DataTable table)
table
- The DataTable used to set the fields.public void setID(int phaseID)
phaseID
- The ID of the phase.public int getID()
public void setName(java.lang.String name)
name
- The name of the phase.public java.lang.String getName()
public void setSequence(int sequence)
sequence
- The sequence of the phase.public int getSequence()
public void setMaxPeriod(int maxPeriod)
maxPeriod
- The maximum period of the phase.public int getMaxPeriod()
public void setDescription(java.lang.String description)
description
- The description of the phase.public java.lang.String getDescription()
public void setXmlDescription(java.lang.String xmlDescription)
xmlDescription
- The Xml description of the phase.public java.lang.String getXmlDescription()
public void setJobType(int jobType)
jobType
- The job type of the phase.public int getJobType()
public static OperationInfo loadAll()
public static OperationInfo getByID(int phaseID, int jobTypeID)
phaseID
- The ID of the phase.jobTypeID
- The ID of the job type.
public static OperationInfo getByName(java.lang.String phaseName)
phaseName
- The name of the phase to search for.
public static int getLastUser(int jobID, int phaseID, int jsID)
jobID
- the job that passed the phasephaseID
- the phase to be checkedjsID
- the job status that the phase and job are on
public OperationInfo getAllUsers()
public static OperationInfo loadSpecial()
public boolean isLastPhase()
public OperationInfo getNextPhase()
public OperationInfo add()
add
in class AdminModuleBase
public OperationInfo delete()
delete
in class AdminModuleBase
public OperationInfo getFinishedJobs(int collID, int batchID)
collID
- The collection to filter on .batchID
- The batch to filter on.
public OperationInfo getFinishedJobsOnce(int collID, int batchID)
collID
- The collection to filter on .batchID
- The batch to filter on.
public OperationInfo getFinishedJobsMoreThanOnce(int collID, int batchID)
collID
- The collection to filter on .batchID
- The batch to filter on.
public OperationInfo getPendingJobs(int collID, int batchID)
collID
- The collection to filter on .batchID
- The batch to filter on.
public OperationInfo getPendingJobsOnce(int collID, int batchID)
collID
- The collection to filter on .batchID
- The batch to filter on.
public OperationInfo getPendingJobsMoreThanOnce(int collID, int batchID)
collID
- The collection to filter on .batchID
- The batch to filter on.
public OperationInfo getProcessingJobs(int collID, int batchID)
collID
- The collection to filter on .batchID
- The batch to filter on.
public OperationInfo getProcessingJobsOnce(int collID, int batchID)
collID
- The collection to filter on .batchID
- The batch to filter on.
public OperationInfo getProcessingJobsMoreThanOnce(int collID, int batchID)
collID
- The collection to filter on .batchID
- The batch to filter on.
public OperationInfo deleteCascade()
public OperationInfo update()
update
in class AdminModuleBase
public void applyPrePhaseChecks(java.lang.String serverPath, FileHandler ftpHandler, java.lang.String localPath) throws PhaseCheckException
serverPath
- The complete path to the job folder. The path is assumed to be an FTP path.ftpHandler
- The FTP connection to the server.localPath
- The complete path to the job folder. The path is assumed to be a local path.
PhaseCheckException
- If the checks fails or couldn't be started.public void applyPostPhaseChecks(java.lang.String localPath, FileHandler ftpHandler, java.lang.String serverPath) throws PhaseCheckException
localPath
- The complete path to the job folder. The path is assumed to be a local path.ftpHandler
- The FTP connection to the server.serverPath
- The complete path to the job folder. The path is assumed to be an FTP path.
PhaseCheckException
- If the checks fails.public void applyChecks(ActionContext context, FileHandler fileHandler, java.lang.String jobPath, ActionContext alternateContext, FileHandler alternateHandler, java.lang.String alternatePath) throws PhaseCheckException
context
- Whether it is Post-Phase or Pre-Phase.fileHandler
- The FileHandler used to check the job folder.jobPath
- The complete path to the job folder.alternateContext
- Whether it is Post-Phase or Pre-Phase.alternateHandler
- The alternate FileHandler used to check the job folder.alternatePath
- The complete alternate path to the job folder.
PhaseCheckException
- If the checks fails or couldn't be started.public void applyPrePhaseActions(Job job, FileHandler handler, java.lang.String source, java.lang.String destination) throws PhaseActionException
job
- The job to which actions are being applied.handler
- The FTP connection to the server.source
- The folder at which the job folder exists.destination
- The folder to which the folder will be copied.
PhaseActionException
- If the actions fails or couldn't be started.public void applyPostPhaseActions(Job job, FileHandler handler, java.lang.String source, java.lang.String destination) throws PhaseActionException
job
- The job to which actions are being applied.handler
- The FTP connection to the server.source
- The folder at which the job folder exists.destination
- The folder to which the folder will be copied.
PhaseActionException
- If the checks fails.public void applyActions(ActionContext context, Job job, FileHandler handler, java.lang.String source, java.lang.String destination) throws PhaseActionException
context
- Whether it is a pre-phase or post-phase.job
- The job to which actions are being applied.handler
- The FTP connection to the server.source
- The folder at which the job folder exists.destination
- The folder to which the folder will be copied.
PhaseActionException
- If the actions fails or couldn't be started.public org.w3c.dom.Node getUserData()
public int getNoOfFiles()
private SemiPhaseDef getSemiPhaseDef(ActionContext context) throws PhaseDefinitionException
context
- Determines whether to get prePhase or postPhase definition.
PhaseDefinitionException
- If the phase xml description couldn't be parsed.private DatabaseInfoDef getLastFinishedDatabaseInfo(Job job)
job
- The job that might have been finished in this pahse.
private DatabaseInfoDef getStartDatabaseInfo(Job job)
job
- The job that might have been finished in this pahse.
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |