ibrokerkit.iservicestore.store.impl.db
Class DatabaseStore

java.lang.Object
  extended by ibrokerkit.iservicestore.store.impl.db.DatabaseStore
All Implemented Interfaces:
Store

public class DatabaseStore
extends java.lang.Object
implements Store

Hibernate-based implementation of the Store interface.


Constructor Summary
DatabaseStore(java.util.Properties properties)
           
 
Method Summary
 void close()
          Closes the Store.
 Authentication createAuthentication()
          Create a new Authentication i-service.
 Contact createContact()
          Create a new Contact i-service.
 Forwarding createForwarding()
          Create a new Forwarding i-service.
 Locator createLocator()
          Create a new Locator i-service.
 void deleteAllIServices(java.lang.String qxri)
          Deletes all i-services associated with a given QXRI field.
 void deleteObject(java.lang.Object object)
          Deletes an object from the database.
 Authentication findAuthentication(java.lang.String qxri)
          Find a single, enabled Authentication i-service with a given QXRI field.
 Authentication[] findAuthentications(java.lang.String qxri)
          Find all Authentication i-services with a given QXRI field.
 Contact findContact(java.lang.String qxri)
          Find a single, enabled Contact i-service with a given QXRI field.
 Contact[] findContacts(java.lang.String qxri)
          Find all Contact i-services with a given QXRI field.
 Forwarding findForwarding(java.lang.String qxri)
          Find a single, enabled Forwarding i-service with a given QXRI field.
 Forwarding[] findForwardings(java.lang.String qxri)
          Find all Forwarding i-services with a given QXRI field.
 Locator findLocator(java.lang.String qxri)
          Find a single, enabled Locator i-service with a given QXRI field.
 Locator[] findLocators(java.lang.String qxri)
          Find all Locator i-services with a given QXRI field.
 Authentication getAuthentication(java.lang.Long id)
          Get an Authentication i-service with a given ID.
 Contact getContact(java.lang.Long id)
          Get a Contact i-service with a given ID.
 Forwarding getForwarding(java.lang.Long id)
          Get an Forwarding i-service with a given ID.
 Locator getLocator(java.lang.Long id)
          Get an Locator i-service with a given ID.
 org.hibernate.SessionFactory getSessionFactory()
          Checks if the database connection is still alive; if not, try to reconnect, then throw exception.
 void init()
          Initializes the Store.
 boolean isClosed()
          True, if the Store has been initialized.
 boolean isInitialized()
          True, if the Store has been initialized.
 Authentication[] listAuthentications()
          List all Authentication i-services in the Store.
 Authentication[] listAuthenticationsByIndex(java.lang.String indx)
          List all Authentication i-services with a given INDX field.
 Contact[] listContacts()
          List all Contact i-services in the Store.
 Contact[] listContactsByIndex(java.lang.String indx)
          List all Contact i-services with a given INDX field.
 Forwarding[] listForwardings()
          List all Forwarding i-services in the Store.
 Forwarding[] listForwardingsByIndex(java.lang.String indx)
          List all Forwarding i-services with a given INDX field.
 Locator[] listLocators()
          List all Locator i-services in the Store.
 Locator[] listLocatorsByIndex(java.lang.String indx)
          List all Locator i-services with a given INDX field.
 void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
          Allow the connection to be changed externally.
 void updateObject(java.lang.Object object)
          Updates an object in the database after modifications have been made.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseStore

public DatabaseStore(java.util.Properties properties)
Method Detail

init

public void init()
          throws StoreException
Description copied from interface: Store
Initializes the Store.

Specified by:
init in interface Store
Throws:
StoreException

isInitialized

public boolean isInitialized()
Description copied from interface: Store
True, if the Store has been initialized.

Specified by:
isInitialized in interface Store

close

public void close()
Description copied from interface: Store
Closes the Store.

Specified by:
close in interface Store

isClosed

public boolean isClosed()
Description copied from interface: Store
True, if the Store has been initialized.

Specified by:
isClosed in interface Store

getSessionFactory

public org.hibernate.SessionFactory getSessionFactory()
                                               throws StoreException
Checks if the database connection is still alive; if not, try to reconnect, then throw exception.

Returns:
The database connection.
Throws:
StoreException

setSessionFactory

public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Allow the connection to be changed externally.

Parameters:
sessionFactory -

updateObject

public void updateObject(java.lang.Object object)
                  throws StoreException
Description copied from interface: Store
Updates an object in the database after modifications have been made.

Specified by:
updateObject in interface Store
Throws:
StoreException

deleteObject

public void deleteObject(java.lang.Object object)
                  throws StoreException
Description copied from interface: Store
Deletes an object from the database.

Specified by:
deleteObject in interface Store
Throws:
StoreException

deleteAllIServices

public void deleteAllIServices(java.lang.String qxri)
                        throws StoreException
Description copied from interface: Store
Deletes all i-services associated with a given QXRI field.

Specified by:
deleteAllIServices in interface Store
Throws:
StoreException

createAuthentication

public Authentication createAuthentication()
                                    throws StoreException
Description copied from interface: Store
Create a new Authentication i-service.

Specified by:
createAuthentication in interface Store
Throws:
StoreException

getAuthentication

public Authentication getAuthentication(java.lang.Long id)
                                 throws StoreException
Description copied from interface: Store
Get an Authentication i-service with a given ID.

Specified by:
getAuthentication in interface Store
Throws:
StoreException

listAuthentications

public Authentication[] listAuthentications()
                                     throws StoreException
Description copied from interface: Store
List all Authentication i-services in the Store.

Specified by:
listAuthentications in interface Store
Throws:
StoreException

listAuthenticationsByIndex

public Authentication[] listAuthenticationsByIndex(java.lang.String indx)
                                            throws StoreException
Description copied from interface: Store
List all Authentication i-services with a given INDX field.

Specified by:
listAuthenticationsByIndex in interface Store
Throws:
StoreException

findAuthentication

public Authentication findAuthentication(java.lang.String qxri)
                                  throws StoreException
Description copied from interface: Store
Find a single, enabled Authentication i-service with a given QXRI field.

Specified by:
findAuthentication in interface Store
Throws:
StoreException

findAuthentications

public Authentication[] findAuthentications(java.lang.String qxri)
                                     throws StoreException
Description copied from interface: Store
Find all Authentication i-services with a given QXRI field.

Specified by:
findAuthentications in interface Store
Throws:
StoreException

createContact

public Contact createContact()
                      throws StoreException
Description copied from interface: Store
Create a new Contact i-service.

Specified by:
createContact in interface Store
Throws:
StoreException

getContact

public Contact getContact(java.lang.Long id)
                   throws StoreException
Description copied from interface: Store
Get a Contact i-service with a given ID.

Specified by:
getContact in interface Store
Throws:
StoreException

listContacts

public Contact[] listContacts()
                       throws StoreException
Description copied from interface: Store
List all Contact i-services in the Store.

Specified by:
listContacts in interface Store
Throws:
StoreException

listContactsByIndex

public Contact[] listContactsByIndex(java.lang.String indx)
                              throws StoreException
Description copied from interface: Store
List all Contact i-services with a given INDX field.

Specified by:
listContactsByIndex in interface Store
Throws:
StoreException

findContact

public Contact findContact(java.lang.String qxri)
                    throws StoreException
Description copied from interface: Store
Find a single, enabled Contact i-service with a given QXRI field.

Specified by:
findContact in interface Store
Throws:
StoreException

findContacts

public Contact[] findContacts(java.lang.String qxri)
                       throws StoreException
Description copied from interface: Store
Find all Contact i-services with a given QXRI field.

Specified by:
findContacts in interface Store
Throws:
StoreException

createForwarding

public Forwarding createForwarding()
                            throws StoreException
Description copied from interface: Store
Create a new Forwarding i-service.

Specified by:
createForwarding in interface Store
Throws:
StoreException

getForwarding

public Forwarding getForwarding(java.lang.Long id)
                         throws StoreException
Description copied from interface: Store
Get an Forwarding i-service with a given ID.

Specified by:
getForwarding in interface Store
Throws:
StoreException

listForwardings

public Forwarding[] listForwardings()
                             throws StoreException
Description copied from interface: Store
List all Forwarding i-services in the Store.

Specified by:
listForwardings in interface Store
Throws:
StoreException

listForwardingsByIndex

public Forwarding[] listForwardingsByIndex(java.lang.String indx)
                                    throws StoreException
Description copied from interface: Store
List all Forwarding i-services with a given INDX field.

Specified by:
listForwardingsByIndex in interface Store
Throws:
StoreException

findForwarding

public Forwarding findForwarding(java.lang.String qxri)
                          throws StoreException
Description copied from interface: Store
Find a single, enabled Forwarding i-service with a given QXRI field.

Specified by:
findForwarding in interface Store
Throws:
StoreException

findForwardings

public Forwarding[] findForwardings(java.lang.String qxri)
                             throws StoreException
Description copied from interface: Store
Find all Forwarding i-services with a given QXRI field.

Specified by:
findForwardings in interface Store
Throws:
StoreException

createLocator

public Locator createLocator()
                      throws StoreException
Description copied from interface: Store
Create a new Locator i-service.

Specified by:
createLocator in interface Store
Throws:
StoreException

getLocator

public Locator getLocator(java.lang.Long id)
                   throws StoreException
Description copied from interface: Store
Get an Locator i-service with a given ID.

Specified by:
getLocator in interface Store
Throws:
StoreException

listLocators

public Locator[] listLocators()
                       throws StoreException
Description copied from interface: Store
List all Locator i-services in the Store.

Specified by:
listLocators in interface Store
Throws:
StoreException

listLocatorsByIndex

public Locator[] listLocatorsByIndex(java.lang.String indx)
                              throws StoreException
Description copied from interface: Store
List all Locator i-services with a given INDX field.

Specified by:
listLocatorsByIndex in interface Store
Throws:
StoreException

findLocator

public Locator findLocator(java.lang.String qxri)
                    throws StoreException
Description copied from interface: Store
Find a single, enabled Locator i-service with a given QXRI field.

Specified by:
findLocator in interface Store
Throws:
StoreException

findLocators

public Locator[] findLocators(java.lang.String qxri)
                       throws StoreException
Description copied from interface: Store
Find all Locator i-services with a given QXRI field.

Specified by:
findLocators in interface Store
Throws:
StoreException


Copyright © 2009. All Rights Reserved.