cgl.narada.wsinfra.wsrm.storage.impl
Class WsrmStorageServiceImpl

java.lang.Object
  extended by cgl.narada.wsinfra.wsrm.storage.WsrmStorageService
      extended by cgl.narada.wsinfra.wsrm.storage.impl.WsrmStorageServiceImpl

public class WsrmStorageServiceImpl
extends WsrmStorageService

Title: WsrmStorageServiceImpl

Description: The WsrmStorageService provides accesses to 3 interfaces which cover the gamut of storage operations specific to the WSRM protocol.


Constructor Summary
WsrmStorageServiceImpl(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.
 WsrmAuditStorageOperations getWsrmAuditStorageOperations()
          Retrieves the reference to WsrmAuditStorageOperations by using given properties file.
 WsrmPolicyStorageOperations getWsrmPolicyStorageOperations()
          Retrieves the reference to WsrmPolicyStorageOperations.
 WsrmProtocolStorageOperations getWsrmProtocolStorageOperations()
          Retrieves the reference to the WsrmProtocolStorageOperations by using given properties file.
 WsrmSequenceInfoStorageOperations getWsrmSequenceInfoStorageOperations()
          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.
 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.wsrm.storage.WsrmStorageService
getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WsrmStorageServiceImpl

public WsrmStorageServiceImpl(String propertiesFileName)
                       throws WsrmStorageException
Throws:
WsrmStorageException
Method Detail

createNewConnection

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

Throws:
WsrmStorageException

getConnection

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

Throws:
WsrmStorageException

initialize

public void initialize()
                throws WsrmStorageException
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 WsrmStorageService
Throws:
WsrmStorageException

getProperties

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

Throws:
WsrmStorageException

loadProperties

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

Throws:
WsrmStorageException

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


getWsrmProtocolStorageOperations

public WsrmProtocolStorageOperations getWsrmProtocolStorageOperations()
                                                               throws WsrmStorageException
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:
getWsrmProtocolStorageOperations in class WsrmStorageService
Throws:
WsrmStorageException

getWsrmSequenceInfoStorageOperations

public WsrmSequenceInfoStorageOperations getWsrmSequenceInfoStorageOperations()
                                                                       throws WsrmStorageException
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:
getWsrmSequenceInfoStorageOperations in class WsrmStorageService
Throws:
WsrmStorageException

getWsrmAuditStorageOperations

public WsrmAuditStorageOperations getWsrmAuditStorageOperations()
                                                         throws WsrmStorageException
Retrieves the reference to WsrmAuditStorageOperations 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:
getWsrmAuditStorageOperations in class WsrmStorageService
Throws:
WsrmStorageException

getWsrmPolicyStorageOperations

public WsrmPolicyStorageOperations getWsrmPolicyStorageOperations()
                                                           throws WsrmStorageException
Description copied from class: WsrmStorageService
Retrieves the reference to WsrmPolicyStorageOperations. This interface is especially useful in determing the WsrmSequencePolicies associated with sequences, whose sequence-identifier values have a partial match (i.e. the prefix is the same as the one previously stored here).

Specified by:
getWsrmPolicyStorageOperations in class WsrmStorageService
Throws:
WsrmStorageException

main

public static void main(String[] args)


For comments and suggestions please send e-mail to The NaradaBrokering Project