org.bibalex.daf.handlers
Class Credential

java.lang.Object
  extended by org.bibalex.daf.handlers.Credential

public class Credential
extends java.lang.Object

Represents a credential to connect to a server.

Author:
Shehab.Kamal

Field Summary
 java.lang.String password
          The password used to login.
This is an unencrypted form of the password.
 java.lang.String serverIP
          The IP of the server to connect to.
 java.lang.String username
          The user name used to login.
 
Constructor Summary
Credential()
          Creates a new instance of Credential.
Credential(java.lang.String server, java.lang.String username, java.lang.String password, boolean isEncrypted)
          Creates a new instance of Credential.
Credential(java.lang.String section, java.lang.String serverElement, java.lang.String usernameElement, java.lang.String passwordElement)
          Creates a new instance of Credential.
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serverIP

public java.lang.String serverIP
The IP of the server to connect to.


username

public java.lang.String username
The user name used to login.


password

public java.lang.String password
The password used to login.
This is an unencrypted form of the password.

Constructor Detail

Credential

public Credential()
Creates a new instance of Credential.


Credential

public Credential(java.lang.String section,
                  java.lang.String serverElement,
                  java.lang.String usernameElement,
                  java.lang.String passwordElement)
           throws java.lang.Exception
Creates a new instance of Credential.

Parameters:
section - The section within the resource file to read the credntials from.
serverElement - The element name that contains the IP address of the server as its caption.
usernameElement - The element name that contains the user name as its caption.
passwordElement - The element name that contains the encrypted password as its caption.
Throws:
java.lang.Exception - If the server credentials couldn't be read.

Credential

public Credential(java.lang.String server,
                  java.lang.String username,
                  java.lang.String password,
                  boolean isEncrypted)
           throws java.lang.Exception
Creates a new instance of Credential.

Parameters:
server - The IP address of the server.
username - The user name.
password - The password.
isEncrypted - Whether the given password is encryptd or not.
Throws:
java.lang.Exception - If the server credentials couldn't be read.