org.bibalex.daf.handlers.statusdatahandler
Class StatusDef

java.lang.Object
  extended by org.bibalex.daf.handlers.statusdatahandler.StatusDef

public class StatusDef
extends java.lang.Object

Parses and handles the StatusData. StatusData are saved in the transaction log, on the following format: <Status>
<FileLevelInfo>
<Info From="" To="" Phase="" Reason="" User="" Done="" />
.
</FileLevelInfo>
<Comment>
Commnet goes here </Comment>
<Database>
<Name>Value</Name>
.
</Database>
<Backup Version="" Size="" >
<Server IP="" Username="" Password="" />
<CompressedFolder Name="" Size="" />
<CompressedFolder Name="" Size="" />
.
.
</Backup>
</Status>

Author:
Shehab.Kamal

Field Summary
 BackupInfoDef backupInfo
          Holds the backup portion of the status data.
 NameValueInfo commentInfo
          Holds the comment portion of the status data.
 DatabaseInfoDef databaseInfo
          Holds the database portion of the status data.
 FileLevelInfoHandler fileInfo
          Holds the FileLevelInfo portion of the status data.
 
Constructor Summary
StatusDef()
          Creates a new instacne of StatusDef.
All fields are set to null.
StatusDef(int transactionLogID)
          Creates a new instance of StatusDef.
StatusDef(org.w3c.dom.Node node)
          Creates a new instance of StatusDef.
StatusDef(java.lang.String nodeRep)
          Creates a new instance of StatusDef.
 
Method Summary
private  void createElementFromNode(org.w3c.dom.Node node)
          Creates the StatusDef element by supplying its XmlNode represenation.
private  void fillFieldsFromString(java.lang.String nodeRep)
          Fill the fields of this instance from the given String.
If the string is null or empty, the fileds are defaulted to null.
 java.lang.String toString()
          Returns the string representation of this object.
 java.lang.String toXmlString()
          Returns a String representing the StatusDef in xml format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fileInfo

public FileLevelInfoHandler fileInfo
Holds the FileLevelInfo portion of the status data. This section could be null.


commentInfo

public NameValueInfo commentInfo
Holds the comment portion of the status data. This section could be null.


databaseInfo

public DatabaseInfoDef databaseInfo
Holds the database portion of the status data. This section could be null.


backupInfo

public BackupInfoDef backupInfo
Holds the backup portion of the status data. This section could be null.

Constructor Detail

StatusDef

public StatusDef()
Creates a new instacne of StatusDef.
All fields are set to null.


StatusDef

public StatusDef(org.w3c.dom.Node node)
          throws StatusDefException
Creates a new instance of StatusDef.

Parameters:
node - The Xml node that representd the element.
Throws:
StatusDefException - If the given node couldn't be parsed.

StatusDef

public StatusDef(int transactionLogID)
          throws StatusDefException
Creates a new instance of StatusDef.

Parameters:
transactionLogID - The transactionLog ID to get its status data.
Use -1 * transactionLogID to indicate that the value is taken from the OldTransactionLog.
Throws:
StatusDefException - If the transaction log status data neither could be obtained nor parsed.

StatusDef

public StatusDef(java.lang.String nodeRep)
          throws StatusDefException
Creates a new instance of StatusDef.

Parameters:
nodeRep - The Xml String representing this element.
Throws:
StatusDefException - If the given String couldn't be parsed.
Method Detail

fillFieldsFromString

private void fillFieldsFromString(java.lang.String nodeRep)
                           throws StatusDefException
Fill the fields of this instance from the given String.
If the string is null or empty, the fileds are defaulted to null.

Parameters:
nodeRep - The String to be parsed.
Throws:
StatusDefException - If the String couldn't be parsed.

createElementFromNode

private void createElementFromNode(org.w3c.dom.Node node)
                            throws StatusDefException
Creates the StatusDef element by supplying its XmlNode represenation.

Parameters:
node - The Xml Node representing this element.
Throws:
StatusDefException - If the node name is not 'Status' or children couldn't be created.

toString

public java.lang.String toString()
Returns the string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
The string representation of this object.

toXmlString

public java.lang.String toXmlString()
Returns a String representing the StatusDef in xml format.

Returns:
A String representing the StatusDef in xml format.