cgl.narada.wsinfra.wsr.storage.impl
Class WsrStorageServiceImpl

java.lang.Object
  extended bycgl.narada.wsinfra.wsr.storage.WsrStorageService
      extended bycgl.narada.wsinfra.wsr.storage.impl.WsrStorageServiceImpl

public class WsrStorageServiceImpl
extends WsrStorageService


Constructor Summary
WsrStorageServiceImpl(String propertiesFileName)
           
 
Method Summary
 void createNewConnection(String fileName)
          creates database connection
 Connection getConnection()
          gets the connection object to the database
 String getConnectionInfo()
          returns connection information
 Properties getProperties(String fileLocation)
          gets Properties object by given file location.
 WsrGroupInfoStorageOperations getWsrGroupInfoStorageOperations()
          Retrieves the reference to WsrmSequenceInfoStorageOperations by using given properties file.This method throws an exception if there were problems during the initialization of the StorageService due to inconsistencies or other storage related problems.
 WsrProtocolStorageOperations getWsrProtocolStorageOperations()
          Retrieves the reference to the WsrmProtocolStorageOperations by using given properties file.
 void initialize()
          This method is used to initialize the storage interfaces and tables when the service starts up for the first time or after a scheduled downtime or is recovering from an unforeseen failure.
 void loadProperties(String fileName)
          loads parameters to connect database from properties file
static void main(String[] args)
           
 void setConnectionParameters(String provider, String host, String db)
          sets connection parameters
 void setConnectionParameters(String provider, String host, String port, String db)
          sets connection parameters
 void setConnnectionInfo(String connectInfo)
          sets connection info without setting parameters
 void setConnnectionInfo(String provider, String host, String db)
          compose connection information from provided parameters
 void setConnnectionInfo(String provider, String host, String port, String db)
          compose connection information from provided parameter
 void setDbDriver(String dbDriver)
          sets jdbc driver
 void setUserParameters(String uname, String password)
          sets user name and passwords
 
Methods inherited from class cgl.narada.wsinfra.wsr.storage.WsrStorageService
getSinkStorageServiceInstance, getSourceStorageServiceInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WsrStorageServiceImpl

public WsrStorageServiceImpl(String propertiesFileName)
                      throws WsrStorageException
Method Detail

createNewConnection

public void createNewConnection(String fileName)
                         throws WsrStorageException
creates database connection

Throws:
WsrStorageException

getConnection

public Connection getConnection()
                         throws WsrStorageException
gets the connection object to the database

Throws:
WsrStorageException

initialize

public void initialize()
                throws WsrStorageException
This method is used to initialize the storage interfaces and tables when the service starts up for the first time or after a scheduled downtime or is recovering from an unforeseen failure. This method checks for consistencies across the storage and proceeds to initialize the ProtocolStorageOperations, SequenceInfoOperations and AuditStorageOperations. This method throws an exception if there are storage related problems.

Specified by:
initialize in class WsrStorageService
Throws:
WsrStorageException

getProperties

public Properties getProperties(String fileLocation)
                         throws WsrStorageException
gets Properties object by given file location. If file could not be found it throws exception

Throws:
WsrStorageException

loadProperties

public void loadProperties(String fileName)
                    throws WsrStorageException
loads parameters to connect database from properties file

Throws:
WsrStorageException

setDbDriver

public void setDbDriver(String dbDriver)
sets jdbc driver


setConnectionParameters

public void setConnectionParameters(String provider,
                                    String host,
                                    String db)
sets connection parameters


setConnectionParameters

public void setConnectionParameters(String provider,
                                    String host,
                                    String port,
                                    String db)
sets connection parameters


setConnnectionInfo

public void setConnnectionInfo(String connectInfo)
sets connection info without setting parameters


setConnnectionInfo

public void setConnnectionInfo(String provider,
                               String host,
                               String db)
compose connection information from provided parameters


setConnnectionInfo

public void setConnnectionInfo(String provider,
                               String host,
                               String port,
                               String db)
compose connection information from provided parameter


getConnectionInfo

public String getConnectionInfo()
returns connection information


setUserParameters

public void setUserParameters(String uname,
                              String password)
sets user name and passwords


getWsrProtocolStorageOperations

public WsrProtocolStorageOperations getWsrProtocolStorageOperations()
                                                             throws WsrStorageException
Retrieves the reference to the WsrmProtocolStorageOperations by using given properties file. This method throws an exception if there were problems during the initialization of the StorageService due to inconsistencies or other storage related problems.

Specified by:
getWsrProtocolStorageOperations in class WsrStorageService
Throws:
WsrStorageException

getWsrGroupInfoStorageOperations

public WsrGroupInfoStorageOperations getWsrGroupInfoStorageOperations()
                                                               throws WsrStorageException
Retrieves the reference to WsrmSequenceInfoStorageOperations by using given properties file.This method throws an exception if there were problems during the initialization of the StorageService due to inconsistencies or other storage related problems.

Specified by:
getWsrGroupInfoStorageOperations in class WsrStorageService
Throws:
WsrStorageException

main

public static void main(String[] args)