org.ow2.petals.registry.core.repository
Class AbstractRepository

java.lang.Object
  extended by org.ow2.petals.registry.core.repository.AbstractRepository
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
Direct Known Subclasses:
JDBCRepository

public abstract class AbstractRepository
extends java.lang.Object
implements org.ow2.petals.registry.api.repository.Repository

An abstract respository definition. This abstract class handles the requests from the registry and use the transaction manager in order to get a coherent set of data. For example, working with resource in the DAO is not only a unique SQL query... All the repository operations are waiting to get a connection from the transaction manager.

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  org.ow2.petals.registry.api.context.Context context
           
protected  org.ow2.petals.registry.api.lifecycle.LifeCycle lifeCycle
           
protected  java.lang.String name
           
protected  org.ow2.petals.registry.api.context.Workspace workspace
           
 
Constructor Summary
AbstractRepository()
          Creates a new instance of AbstractRepository
 
Method Summary
 int clean()
           
 void createLifeCycle()
           
 boolean delete(java.lang.String key, boolean b)
           
 int deleteDataFromRegistry(java.lang.String registryName)
          
protected abstract  int doClean()
           
protected abstract  boolean doDelete(java.lang.String path)
           
protected abstract  int doDeleteDataFromRegistry(java.lang.String registryName)
           
protected abstract  org.ow2.petals.registry.api.Resource doGet(java.lang.String path)
           
protected abstract  java.util.List<org.ow2.petals.registry.api.Resource> doGetAll(java.lang.String path)
           
protected abstract  int doKeepOnly(java.lang.String registryName)
           
protected abstract  boolean doPut(java.lang.String path, org.ow2.petals.registry.api.Resource resource)
           
protected abstract  java.util.List<org.ow2.petals.registry.api.Resource> doQuery(org.ow2.petals.registry.api.Query query)
           
protected abstract  long doSize()
           
 org.ow2.petals.registry.api.Resource get(java.lang.String key, boolean b)
           
 java.util.List<org.ow2.petals.registry.api.Resource> getAll(java.lang.String path, boolean b)
           
 org.ow2.petals.registry.api.context.Context getContext()
           
 org.ow2.petals.registry.api.lifecycle.LifeCycle.STATE getState()
           
 void init(org.ow2.petals.registry.api.context.Context context)
           
 boolean isInitialized()
           
 boolean isNotInitialized()
           
 boolean isRunning()
           
 boolean isStarted()
           
 boolean isStopped()
           
 int keepOnly(java.lang.String registryName)
          
 boolean put(java.lang.String path, org.ow2.petals.registry.api.Resource resource, boolean b)
           
 java.util.List<org.ow2.petals.registry.api.Resource> query(org.ow2.petals.registry.api.Query query, boolean b)
           
protected  void setLifeCycle(org.ow2.petals.registry.api.lifecycle.LifeCycle lifeCycle)
           
 long size()
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ow2.petals.registry.api.repository.Repository
size
 

Field Detail

lifeCycle

protected org.ow2.petals.registry.api.lifecycle.LifeCycle lifeCycle

name

protected java.lang.String name

workspace

protected org.ow2.petals.registry.api.context.Workspace workspace

context

protected org.ow2.petals.registry.api.context.Context context
Constructor Detail

AbstractRepository

public AbstractRepository()
Creates a new instance of AbstractRepository

Method Detail

createLifeCycle

public void createLifeCycle()

get

public final org.ow2.petals.registry.api.Resource get(java.lang.String key,
                                                      boolean b)
                                               throws org.ow2.petals.registry.api.exception.RegistryException
Specified by:
get in interface org.ow2.petals.registry.api.Operations
Throws:
org.ow2.petals.registry.api.exception.RegistryException

getAll

public java.util.List<org.ow2.petals.registry.api.Resource> getAll(java.lang.String path,
                                                                   boolean b)
                                                            throws org.ow2.petals.registry.api.exception.RegistryException
Specified by:
getAll in interface org.ow2.petals.registry.api.Operations
Throws:
org.ow2.petals.registry.api.exception.RegistryException

put

public final boolean put(java.lang.String path,
                         org.ow2.petals.registry.api.Resource resource,
                         boolean b)
                  throws org.ow2.petals.registry.api.exception.RegistryException
Specified by:
put in interface org.ow2.petals.registry.api.Operations
Throws:
org.ow2.petals.registry.api.exception.RegistryException

delete

public final boolean delete(java.lang.String key,
                            boolean b)
                     throws org.ow2.petals.registry.api.exception.RegistryException
Specified by:
delete in interface org.ow2.petals.registry.api.Operations
Throws:
org.ow2.petals.registry.api.exception.RegistryException

clean

public final int clean()
                throws org.ow2.petals.registry.api.exception.RegistryException
Specified by:
clean in interface org.ow2.petals.registry.api.repository.Repository
Throws:
org.ow2.petals.registry.api.exception.RegistryException

size

public final long size()
                throws org.ow2.petals.registry.api.exception.RegistryException
Specified by:
size in interface org.ow2.petals.registry.api.repository.Repository
Throws:
org.ow2.petals.registry.api.exception.RegistryException

keepOnly

public int keepOnly(java.lang.String registryName)
             throws org.ow2.petals.registry.api.exception.RegistryException

Throws:
org.ow2.petals.registry.api.exception.RegistryException

doKeepOnly

protected abstract int doKeepOnly(java.lang.String registryName)
                           throws org.ow2.petals.registry.api.exception.RegistryException
Throws:
org.ow2.petals.registry.api.exception.RegistryException

deleteDataFromRegistry

public int deleteDataFromRegistry(java.lang.String registryName)
                           throws org.ow2.petals.registry.api.exception.RegistryException

Throws:
org.ow2.petals.registry.api.exception.RegistryException

doDeleteDataFromRegistry

protected abstract int doDeleteDataFromRegistry(java.lang.String registryName)
                                         throws org.ow2.petals.registry.api.exception.RegistryException
Throws:
org.ow2.petals.registry.api.exception.RegistryException

query

public java.util.List<org.ow2.petals.registry.api.Resource> query(org.ow2.petals.registry.api.Query query,
                                                                  boolean b)
                                                           throws org.ow2.petals.registry.api.exception.RegistryException
Specified by:
query in interface org.ow2.petals.registry.api.Operations
Throws:
org.ow2.petals.registry.api.exception.RegistryException

doGet

protected abstract org.ow2.petals.registry.api.Resource doGet(java.lang.String path)
                                                       throws org.ow2.petals.registry.api.exception.RegistryException
Throws:
org.ow2.petals.registry.api.exception.RegistryException

doGetAll

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

doPut

protected abstract boolean doPut(java.lang.String path,
                                 org.ow2.petals.registry.api.Resource resource)
                          throws org.ow2.petals.registry.api.exception.RegistryException
Throws:
org.ow2.petals.registry.api.exception.RegistryException

doDelete

protected abstract boolean doDelete(java.lang.String path)
                             throws org.ow2.petals.registry.api.exception.RegistryException
Throws:
org.ow2.petals.registry.api.exception.RegistryException

doClean

protected abstract int doClean()
                        throws org.ow2.petals.registry.api.exception.RegistryException
Throws:
org.ow2.petals.registry.api.exception.RegistryException

doSize

protected abstract long doSize()
                        throws org.ow2.petals.registry.api.exception.RegistryException
Throws:
org.ow2.petals.registry.api.exception.RegistryException

doQuery

protected abstract 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
Throws:
org.ow2.petals.registry.api.exception.RegistryException

getContext

public org.ow2.petals.registry.api.context.Context getContext()

setLifeCycle

protected void setLifeCycle(org.ow2.petals.registry.api.lifecycle.LifeCycle lifeCycle)
Parameters:
lifeCycle -

getState

public org.ow2.petals.registry.api.lifecycle.LifeCycle.STATE getState()
Specified by:
getState in interface org.ow2.petals.registry.api.lifecycle.LifeCycle

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
Throws:
org.ow2.petals.registry.api.exception.LifeCycleException

isInitialized

public boolean isInitialized()
Specified by:
isInitialized in interface org.ow2.petals.registry.api.lifecycle.LifeCycle

isNotInitialized

public boolean isNotInitialized()
Specified by:
isNotInitialized in interface org.ow2.petals.registry.api.lifecycle.LifeCycle

isRunning

public boolean isRunning()
Specified by:
isRunning in interface org.ow2.petals.registry.api.lifecycle.LifeCycle

isStarted

public boolean isStarted()
Specified by:
isStarted in interface org.ow2.petals.registry.api.lifecycle.LifeCycle

isStopped

public boolean isStopped()
Specified by:
isStopped in interface org.ow2.petals.registry.api.lifecycle.LifeCycle

start

public void start()
           throws org.ow2.petals.registry.api.exception.LifeCycleException
Specified by:
start in interface org.ow2.petals.registry.api.lifecycle.LifeCycle
Throws:
org.ow2.petals.registry.api.exception.LifeCycleException

stop

public void stop()
          throws org.ow2.petals.registry.api.exception.LifeCycleException
Specified by:
stop in interface org.ow2.petals.registry.api.lifecycle.LifeCycle
Throws:
org.ow2.petals.registry.api.exception.LifeCycleException


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