org.bibalex.daf.handlers.statusdatahandler
Class ServerDef

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

public class ServerDef
extends java.lang.Object

Represents an Xml node with the following format:
<Server IP="" Username="" Password="" />

Author:
Shehab.Kamal

Field Summary
 java.lang.String address
          The 'IP' property of the server.
 java.lang.String password
          The 'Password' property of the element.
 java.lang.String username
          The 'Username' property of the element.
 
Constructor Summary
ServerDef()
          Creates a new instance of ServerDef.
ServerDef(org.w3c.dom.Node node)
          Creates a new instance of ServerDef.
ServerDef(java.lang.String nodeRep)
          Creates a new instance of ServerDef.
ServerDef(java.lang.String address, java.lang.String username, java.lang.String password)
          Creates a new instance of ServerDef.
 
Method Summary
private  void createElementFromNode(org.w3c.dom.Node node)
          Creates the ServerDef by supplying its XmlNode represenation.
 java.lang.String toString()
          Returns the string representation of this object.
 java.lang.String toXmlString()
          Converts this instance to a valid XML string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

address

public java.lang.String address
The 'IP' property of the server.


username

public java.lang.String username
The 'Username' property of the element.


password

public java.lang.String password
The 'Password' property of the element.

Constructor Detail

ServerDef

public ServerDef(java.lang.String address,
                 java.lang.String username,
                 java.lang.String password)
Creates a new instance of ServerDef.

Parameters:
address - The 'IP' property of the server.
username - The 'Size' property of the server.
password - The 'Password' property of the server.

ServerDef

public ServerDef()
Creates a new instance of ServerDef.


ServerDef

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

Parameters:
node - The Xml Node representing this element.
Throws:
StatusDefException - If the node couldn't be parsed.

ServerDef

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

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

createElementFromNode

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

Parameters:
node - The Xml Node representing this element.
Throws:
StatusDefException - If the node name is not 'Server' or attributes are missing.

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()
Converts this instance to a valid XML string.

Returns:
A valid XML string representing this instance.