org.ow2.petals.registry.core.repository.jdbc
Class JDBCRepository

java.lang.Object
  extended by org.ow2.petals.registry.core.repository.AbstractRepository
      extended by org.ow2.petals.registry.core.repository.jdbc.JDBCRepository
All Implemented Interfaces:
org.ow2.petals.registry.api.lifecycle.LifeCycle, org.ow2.petals.registry.api.Operations, org.ow2.petals.registry.api.repository.CoreRepository, org.ow2.petals.registry.api.repository.Repository

public class JDBCRepository
extends AbstractRepository

The JDBC repository implementation. All the transaction stuff is done in the AbstractRepository. The only thing that has to be done here is to call the good DAOs... If the repository is configured to work with an embedded JDBC server it is instanciated and its lifecycle is managed inside the repository lifecycle.

Author:
Christophe HAMERLING - eBM WebSourcing

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ow2.petals.registry.api.lifecycle.LifeCycle
org.ow2.petals.registry.api.lifecycle.LifeCycle.STATE
 
Field Summary
protected  TOAdapter adapter
           
protected  EndpointDAO endpointDAO
           
protected  HibernateHelper hibernateHelper
           
protected  org.apache.commons.logging.Log log
           
 
Fields inherited from class org.ow2.petals.registry.core.repository.AbstractRepository
context, lifeCycle, name, workspace
 
Constructor Summary
JDBCRepository()
           
 
Method Summary
 void createLifeCycle()
           
protected  int doClean()
           
protected  boolean doDelete(java.lang.String path)
           
protected  int doDeleteDataFromRegistry(java.lang.String registryName)
           
protected  org.ow2.petals.registry.api.Resource doGet(java.lang.String path)
           
protected  java.util.List<org.ow2.petals.registry.api.Resource> doGetAll(java.lang.String path)
           
protected  int doKeepOnly(java.lang.String registryName)
           
protected  boolean doPut(java.lang.String path, org.ow2.petals.registry.api.Resource resource)
           
protected  java.util.List<org.ow2.petals.registry.api.Resource> doQuery(org.ow2.petals.registry.api.Query query)
           
protected  long doSize()
           
 EndpointDAO getEndpointDAO()
           
 HibernateHelper getHibernateHelper()
           
 java.util.Collection<java.lang.String> getKeys()
           
 void init(org.ow2.petals.registry.api.context.Context context)
           
 void setHibernateHelper(HibernateHelper hibernateHelper)
           
 long size(java.lang.String path)
           
 
Methods inherited from class org.ow2.petals.registry.core.repository.AbstractRepository
clean, delete, deleteDataFromRegistry, get, getAll, getContext, getState, isInitialized, isNotInitialized, isRunning, isStarted, isStopped, keepOnly, put, query, setLifeCycle, size, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

endpointDAO

protected EndpointDAO endpointDAO

adapter

protected TOAdapter adapter

hibernateHelper

protected HibernateHelper hibernateHelper

log

protected org.apache.commons.logging.Log log
Constructor Detail

JDBCRepository

public JDBCRepository()
Method Detail

createLifeCycle

public void createLifeCycle()
Overrides:
createLifeCycle in class AbstractRepository

init

public void init(org.ow2.petals.registry.api.context.Context context)
          throws org.ow2.petals.registry.api.exception.LifeCycleException
Specified by:
init in interface org.ow2.petals.registry.api.lifecycle.LifeCycle
Overrides:
init in class AbstractRepository
Throws:
org.ow2.petals.registry.api.exception.LifeCycleException

doDelete

protected boolean doDelete(java.lang.String path)
                    throws org.ow2.petals.registry.api.exception.RegistryException
Specified by:
doDelete in class AbstractRepository
Throws:
org.ow2.petals.registry.api.exception.RegistryException

doGet

protected org.ow2.petals.registry.api.Resource doGet(java.lang.String path)
                                              throws org.ow2.petals.registry.api.exception.RegistryException
Specified by:
doGet in class AbstractRepository
Throws:
org.ow2.petals.registry.api.exception.RegistryException

doPut

protected boolean doPut(java.lang.String path,
                        org.ow2.petals.registry.api.Resource resource)
                 throws org.ow2.petals.registry.api.exception.RegistryException
Specified by:
doPut in class AbstractRepository
Throws:
org.ow2.petals.registry.api.exception.RegistryException

getKeys

public java.util.Collection<java.lang.String> getKeys()

doSize

protected long doSize()
               throws org.ow2.petals.registry.api.exception.RegistryException
Specified by:
doSize in class AbstractRepository
Throws:
org.ow2.petals.registry.api.exception.RegistryException

size

public long size(java.lang.String path)

doGetAll

protected java.util.List<org.ow2.petals.registry.api.Resource> doGetAll(java.lang.String path)
                                                                 throws org.ow2.petals.registry.api.exception.RegistryException
Specified by:
doGetAll in class AbstractRepository
Throws:
org.ow2.petals.registry.api.exception.RegistryException

doQuery

protected java.util.List<org.ow2.petals.registry.api.Resource> doQuery(org.ow2.petals.registry.api.Query query)
                                                                throws org.ow2.petals.registry.api.exception.RegistryException
Specified by:
doQuery in class AbstractRepository
Throws:
org.ow2.petals.registry.api.exception.RegistryException

doClean

protected int doClean()
               throws org.ow2.petals.registry.api.exception.RegistryException
Specified by:
doClean in class AbstractRepository
Throws:
org.ow2.petals.registry.api.exception.RegistryException

doKeepOnly

protected int doKeepOnly(java.lang.String registryName)
                  throws org.ow2.petals.registry.api.exception.RegistryException
Specified by:
doKeepOnly in class AbstractRepository
Throws:
org.ow2.petals.registry.api.exception.RegistryException

doDeleteDataFromRegistry

protected int doDeleteDataFromRegistry(java.lang.String registryName)
                                throws org.ow2.petals.registry.api.exception.RegistryException
Specified by:
doDeleteDataFromRegistry in class AbstractRepository
Throws:
org.ow2.petals.registry.api.exception.RegistryException

setHibernateHelper

public void setHibernateHelper(HibernateHelper hibernateHelper)

getHibernateHelper

public HibernateHelper getHibernateHelper()

getEndpointDAO

public EndpointDAO getEndpointDAO()
Returns:
the endpointDAO


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.