suncertify.common
Class PropertiesWrapper

java.lang.Object
  |
  +--suncertify.common.PropertiesWrapper

public class PropertiesWrapper
extends java.lang.Object

PropertiesWrapper wrapps the Property object so only application specific property data can be stored. Apprtiopriate getters and setters method returns configuration values of the specified attributes. Property values are inicialized during object creatino from the specified file, if the file does not exist or does not have the desired property the default value of the prtoperty is used. Current values of the properties can be easy stored using storeProperties method.


Field Summary
static java.lang.String SERVER_LOGIN
          login string representing server login (server generates logins)
 
Method Summary
 java.lang.String getDbFileName()
          Returns data base file name stored in properties
static java.lang.String getDbFileNameDefault()
          Resturns default value of the data base file name
 java.lang.String getHostName()
          Returns the host name stored in properties
static java.lang.String getHostNameDefault()
          Resturns default value of the host name
static PropertiesWrapper getInstance()
          Method returns reference to the PropertiesWrapper instance.
 int getListenPort()
          Returns listen port stored in properties
static int getListenPortDefault()
          Returns default value for the listen port
 java.lang.String getLoginName()
          Returns login name stored in properties
static java.lang.String getLoginNameDefault()
          Returns default value of the login name
 void setDbFileName(java.lang.String string)
          Sets new value of the data base filename in properties
 void setHostName(java.lang.String string)
          Sets new value of host name in properties
 void setListenPort(int i)
          Sets new value of the listen port in properties
 void setLoginName(java.lang.String string)
          Sets new value of the login name in properties
 void storeProperties()
          Stores current properties values in a property file set in constructor.
 java.lang.String toString()
          Returns string reprezentation of the object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SERVER_LOGIN

public static final java.lang.String SERVER_LOGIN
login string representing server login (server generates logins)

See Also:
Constant Field Values
Method Detail

getInstance

public static PropertiesWrapper getInstance()
Method returns reference to the PropertiesWrapper instance. (Singleton pattern)

Returns:
reference to the PropertiesWrapper instance

storeProperties

public void storeProperties()
                     throws java.io.IOException
Stores current properties values in a property file set in constructor. If file does not exist it is created

Throws:
java.io.IOException - thrown in case IO exception occured

getHostName

public java.lang.String getHostName()
Returns the host name stored in properties

Returns:
the host name

getListenPort

public int getListenPort()
Returns listen port stored in properties

Returns:
the listen port

getDbFileName

public java.lang.String getDbFileName()
Returns data base file name stored in properties

Returns:
the data base file name

getLoginName

public java.lang.String getLoginName()
Returns login name stored in properties

Returns:
the login name

setHostName

public void setHostName(java.lang.String string)
Sets new value of host name in properties

Parameters:
string - new value of the host name

setListenPort

public void setListenPort(int i)
Sets new value of the listen port in properties

Parameters:
i - new value of the listen port

setLoginName

public void setLoginName(java.lang.String string)
Sets new value of the login name in properties

Parameters:
string - new value of the login name

setDbFileName

public void setDbFileName(java.lang.String string)
Sets new value of the data base filename in properties

Parameters:
string - new value of the data base filename

getDbFileNameDefault

public static java.lang.String getDbFileNameDefault()
Resturns default value of the data base file name

Returns:
default value of the database file name

getHostNameDefault

public static java.lang.String getHostNameDefault()
Resturns default value of the host name

Returns:
default value of the host name

getListenPortDefault

public static int getListenPortDefault()
Returns default value for the listen port

Returns:
default value of the listen port

getLoginNameDefault

public static java.lang.String getLoginNameDefault()
Returns default value of the login name

Returns:
default value of the login name

toString

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

Overrides:
toString in class java.lang.Object