org.bibalex.daf.entities.phase
Class DatabaseAction

java.lang.Object
  extended by org.bibalex.daf.entities.phase.PhaseAction
      extended by org.bibalex.daf.entities.phase.DatabaseAction

public class DatabaseAction
extends PhaseAction

Responsible for applying the Database actions associted with a phase.

Author:
Shehab.Kamal

Field Summary
private  DatabaseDef definition
          Holds the DatabaseDef that will be used when applying the action.
private  DatabaseInfoDef finishInfo
          Holds the DatabaseInfoDef that contains the values of the DatabaseDef.
The values is extracted from the finish entry of this phase, if that job has visited this phase previously.
private  Job job
          The job to which the action is being applied.
private  DatabaseInfoDef startInfo
          Holds the DatabaseInfoDef that contains the previous values of the DatabaseDef if any.
The value is extratced from the start entry of this phase.
The startInfo if exists takes precedene over the finishInfo.
private  org.w3c.dom.Node userData
          Holds the user data that was collected by the IDatabaseDataEntry.
 
Constructor Summary
DatabaseAction(Job job, DatabaseDef definition, DatabaseInfoDef finishInfo, DatabaseInfoDef startInfo)
          Creates a new instance of DatabaseAction.
 
Method Summary
 void applyAction()
          Applies the action.
 org.w3c.dom.Node getUserData()
          Gets the data, if any, that the user has entered.
private  void saveDatabaseInfo()
          Saves the database information that the user has entered in the start entry of the job.
Failing to save the informtion is not considered as an error.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

job

private Job job
The job to which the action is being applied.


definition

private DatabaseDef definition
Holds the DatabaseDef that will be used when applying the action.


finishInfo

private DatabaseInfoDef finishInfo
Holds the DatabaseInfoDef that contains the values of the DatabaseDef.
The values is extracted from the finish entry of this phase, if that job has visited this phase previously.


startInfo

private DatabaseInfoDef startInfo
Holds the DatabaseInfoDef that contains the previous values of the DatabaseDef if any.
The value is extratced from the start entry of this phase.
The startInfo if exists takes precedene over the finishInfo.


userData

private org.w3c.dom.Node userData
Holds the user data that was collected by the IDatabaseDataEntry.

Constructor Detail

DatabaseAction

public DatabaseAction(Job job,
                      DatabaseDef definition,
                      DatabaseInfoDef finishInfo,
                      DatabaseInfoDef startInfo)
Creates a new instance of DatabaseAction.

Parameters:
job - The job to which the DatabaseAction is being applied.
definition - The DatabaseDef to be applied.
finishInfo - The DatabaseInfoDef that holds the values of the given definition from the finish entry.
startInfo - The DatabaseInfoDef that holds the values of the given definition from the start entry. This parameter can be null.
Method Detail

applyAction

public void applyAction()
                 throws PhaseActionException
Applies the action. The information collected

Specified by:
applyAction in class PhaseAction
Throws:
PhaseActionException - If the action fails.

saveDatabaseInfo

private void saveDatabaseInfo()
Saves the database information that the user has entered in the start entry of the job.
Failing to save the informtion is not considered as an error.


getUserData

public org.w3c.dom.Node getUserData()
Gets the data, if any, that the user has entered.

Returns:
A Node holding the user data or null if no data has been entered.