|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.priha.providers.EhCachingProvider
public class EhCachingProvider
Uses EHCache for an intermediate level cache. It lies on top of a real provider, like FileProvider, and provides caching for most of the items that can be fetched from the cache. Configurable properties are:
| Field Summary | |
|---|---|
static java.lang.String |
PROP_CACHENAME
|
static java.lang.String |
PROP_MAXCACHEABLESIZE
|
static java.lang.String |
PROP_REALPROVIDER
|
static java.lang.String |
PROP_SIZE
|
| Constructor Summary | |
|---|---|
EhCachingProvider()
|
|
| Method Summary | |
|---|---|
void |
addNode(StoreTransaction tx,
Path path,
QNodeDefinition def)
Adds a new Node to the repository to the given Path. |
void |
close(WorkspaceImpl ws)
The repository will no longer be used by a session, so any session-specific things can now be deallocated. |
Path |
findByUUID(WorkspaceImpl ws,
java.lang.String uuid)
If an item by this UUID exists, returns a Path. |
java.util.List<Path> |
findReferences(WorkspaceImpl ws,
java.lang.String uuid)
Finds all the Property paths which are of type REFERENCE and whose content is equal to the UUID given. |
ValueContainer |
getPropertyValue(WorkspaceImpl ws,
Path path)
Returns the value of a property. |
boolean |
itemExists(WorkspaceImpl ws,
Path path,
ItemType type)
Returns true, if the Item exists and is of given type. |
java.util.List<Path> |
listNodes(WorkspaceImpl ws,
Path parentpath)
Lists all the Nodes from the repository which belong to this parent. |
java.util.List<QName> |
listProperties(WorkspaceImpl ws,
Path path)
Returns a list of properties for a Node. |
java.util.Collection<java.lang.String> |
listWorkspaces()
Lists all workspaces which are available in this Repository. |
void |
open(RepositoryImpl rep,
Credentials credentials,
java.lang.String workspaceName)
Opens a repository. |
void |
putPropertyValue(StoreTransaction tx,
Path path,
ValueContainer vc)
Sets or adds a new Property to the repository. |
void |
remove(StoreTransaction tx,
Path path)
Removes a node or a property from the repository. |
void |
reorderNodes(StoreTransaction tx,
Path internalPath,
java.util.List<Path> childOrder)
|
void |
start(RepositoryImpl repository,
java.util.Properties properties)
Starts access to a repository. |
void |
stop(RepositoryImpl rep)
Stops a given repository. |
void |
storeCancelled(StoreTransaction tx)
If the store has been cancelled and changes need to be rolled back. |
void |
storeFinished(StoreTransaction tx)
This method is called when the repository-changing operation is complete. |
StoreTransaction |
storeStarted(WorkspaceImpl ws)
This method is called whenever Priha starts a transaction which will save the contents of the repository. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROP_MAXCACHEABLESIZE
public static final java.lang.String PROP_SIZE
public static final java.lang.String PROP_CACHENAME
public static final java.lang.String PROP_REALPROVIDER
| Constructor Detail |
|---|
public EhCachingProvider()
| Method Detail |
|---|
public void start(RepositoryImpl repository,
java.util.Properties properties)
throws ConfigurationException
RepositoryProvider
start in interface RepositoryProviderrepository - The Repository which owns this provider.properties - A set of filtered properties for this provider.
ConfigurationException - If the repository cannot be started due to a faulty configuration.ProviderManager.filterProperties(RepositoryImpl, String)public void stop(RepositoryImpl rep)
RepositoryProviderThis method will only be called when the Repository shuts down.
stop in interface RepositoryProviderrep - The Repository object.
public void open(RepositoryImpl rep,
Credentials credentials,
java.lang.String workspaceName)
throws RepositoryException,
NoSuchWorkspaceException
RepositoryProvider
open in interface RepositoryProviderrep - The Repository which owns this Provider.credentials - The Credentials object passed to the Session.open() call. May be null,
if there were no credentials.workspaceName - The workspace which will be accessed.
NoSuchWorkspaceException - if no such workspace exists.
RepositoryExceptionpublic void close(WorkspaceImpl ws)
RepositoryProvider
close in interface RepositoryProviderws - The Workspace attached to the Session.
public void addNode(StoreTransaction tx,
Path path,
QNodeDefinition def)
throws RepositoryException
RepositoryProvider
addNode in interface RepositoryProviderpath - Path to the node in this workspace.
RepositoryException - If the Node cannot be added.
public Path findByUUID(WorkspaceImpl ws,
java.lang.String uuid)
throws RepositoryException
RepositoryProvider
findByUUID in interface RepositoryProviderRepositoryException
public java.util.List<Path> findReferences(WorkspaceImpl ws,
java.lang.String uuid)
throws RepositoryException
RepositoryProvider
findReferences in interface RepositoryProviderRepositoryException
public ValueContainer getPropertyValue(WorkspaceImpl ws,
Path path)
throws RepositoryException
RepositoryProvider
getPropertyValue in interface RepositoryProviderws - The workspace in which the property value should be located.path - The path to the Property
RepositoryException - If something goes wrong.
public java.util.List<Path> listNodes(WorkspaceImpl ws,
Path parentpath)
throws RepositoryException
RepositoryProvider
listNodes in interface RepositoryProviderws - The Workspace.parentpath - The path to the Node whose children should be listed.
RepositoryException - If the children cannot be found.
public java.util.List<QName> listProperties(WorkspaceImpl ws,
Path path)
throws RepositoryException
RepositoryProvider
listProperties in interface RepositoryProviderws - The Workspace in which the properties should be located.path - The path of the Node.
RepositoryException - If something goes wrong.
public java.util.Collection<java.lang.String> listWorkspaces()
throws RepositoryException
RepositoryProvider
listWorkspaces in interface RepositoryProviderRepositoryException
public boolean itemExists(WorkspaceImpl ws,
Path path,
ItemType type)
throws RepositoryException
RepositoryProvider
itemExists in interface RepositoryProviderws - The workspace in which the existence of the Node is checked.path - The path to the Node.type - Type to check for
RepositoryException
public void putPropertyValue(StoreTransaction tx,
Path path,
ValueContainer vc)
throws RepositoryException
RepositoryProvider
putPropertyValue in interface RepositoryProvidervc - The Property content to store.
RepositoryException - If the property cannot be stored.
public void remove(StoreTransaction tx,
Path path)
throws RepositoryException
RepositoryProviderIn addition, it MUST NOT be an error if remove() is called on a path which is already removed. In such a case, remove() shall fail silently.
remove in interface RepositoryProviderRepositoryException
public void storeFinished(StoreTransaction tx)
throws RepositoryException
RepositoryProvider
storeFinished in interface RepositoryProvidertx - The same StoreTransaction object which was returned from storeStarted().
RepositoryException
public void storeCancelled(StoreTransaction tx)
throws RepositoryException
RepositoryProvider
storeCancelled in interface RepositoryProvidertx - The transaction from storeStarted().
RepositoryException
public StoreTransaction storeStarted(WorkspaceImpl ws)
throws RepositoryException
RepositoryProvider
storeStarted in interface RepositoryProviderws - The workspace
RepositoryException
public void reorderNodes(StoreTransaction tx,
Path internalPath,
java.util.List<Path> childOrder)
throws RepositoryException
reorderNodes in interface RepositoryProviderRepositoryException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||