comparewith = UTF8Type
key : value = workspace : name
Method Summary |
void |
addNode(StoreTransaction tx,
Path path,
QNodeDefinition definition)
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 property)
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 path,
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 |
CassandraProvider
public CassandraProvider()
addNode
public void addNode(StoreTransaction tx,
Path path,
QNodeDefinition definition)
throws RepositoryException
- Description copied from interface:
RepositoryProvider
- Adds a new Node to the repository to the given Path. The properties of the
Node will be stored separately using successive putPropertyValue() calls.
This includes also system things like the jcr:primaryType, so this method
really exists just to ensure that the Node can be added to the repository.
- Specified by:
addNode
in interface RepositoryProvider
path
- Path to the node in this workspace.
- Throws:
RepositoryException
- If the Node cannot be added.
close
public void close(WorkspaceImpl ws)
- Description copied from interface:
RepositoryProvider
- The repository will no longer be used by a session, so any session-specific
things can now be deallocated.
- Specified by:
close
in interface RepositoryProvider
- Parameters:
ws
- The Workspace attached to the Session.
findByUUID
public Path findByUUID(WorkspaceImpl ws,
java.lang.String uuid)
throws ItemNotFoundException,
RepositoryException
- Description copied from interface:
RepositoryProvider
- If an item by this UUID exists, returns a Path.
- Specified by:
findByUUID
in interface RepositoryProvider
- Returns:
-
- Throws:
ItemNotFoundException
- If the repository does not contain an UUID by this name.
RepositoryException
findReferences
public java.util.List<Path> findReferences(WorkspaceImpl ws,
java.lang.String uuid)
throws RepositoryException
- Description copied from interface:
RepositoryProvider
- Finds all the Property paths which are of type REFERENCE and whose content
is equal to the UUID given.
- Specified by:
findReferences
in interface RepositoryProvider
- Returns:
- A list of paths to properties which reference the node by the given UUID.
- Throws:
RepositoryException
getPropertyValue
public ValueContainer getPropertyValue(WorkspaceImpl ws,
Path path)
throws PathNotFoundException,
RepositoryException
- Description copied from interface:
RepositoryProvider
- Returns the value of a property.
- Specified by:
getPropertyValue
in interface RepositoryProvider
- Parameters:
ws
- The workspace in which the property value should be located.path
- The path to the Property
- Returns:
- Either a ValueImpl or ValueImpl[], depending on whether this is a multi-valued thing
- Throws:
PathNotFoundException
- If there is nothing at the end of this Path, i.e. the object could not be found.
RepositoryException
- If something goes wrong.
itemExists
public boolean itemExists(WorkspaceImpl ws,
Path path,
ItemType type)
throws RepositoryException
- Description copied from interface:
RepositoryProvider
- Returns true, if the Item exists and is of given type.
- Specified by:
itemExists
in interface RepositoryProvider
- Parameters:
ws
- The workspace in which the existence of the Node is checked.path
- The path to the Node.type
- Type to check for
- Returns:
- True, if the item exists. False otherwise (like when it's actually of a different type)
- Throws:
RepositoryException
listNodes
public java.util.List<Path> listNodes(WorkspaceImpl ws,
Path parentpath)
throws RepositoryException
- Description copied from interface:
RepositoryProvider
- Lists all the Nodes from the repository which belong to this parent.
- Specified by:
listNodes
in interface RepositoryProvider
- Parameters:
ws
- The Workspace.parentpath
- The path to the Node whose children should be listed.
- Returns:
- A List of Path objects with the full paths to the children.
- Throws:
RepositoryException
- If the children cannot be found.
listProperties
public java.util.List<QName> listProperties(WorkspaceImpl ws,
Path path)
throws PathNotFoundException,
RepositoryException
- Description copied from interface:
RepositoryProvider
- Returns a list of properties for a Node.
- Specified by:
listProperties
in interface RepositoryProvider
- Parameters:
ws
- The Workspace in which the properties should be located.path
- The path of the Node.
- Returns:
- A List of the names of the properties under this Node.
- Throws:
PathNotFoundException
- If the path given does not exist.
RepositoryException
- If something goes wrong.
listWorkspaces
public java.util.Collection<java.lang.String> listWorkspaces()
throws RepositoryException
- Description copied from interface:
RepositoryProvider
- Lists all workspaces which are available in this Repository. This method is
called after start() but before open().
- Specified by:
listWorkspaces
in interface RepositoryProvider
- Returns:
- The workspace names.
- Throws:
RepositoryException
open
public void open(RepositoryImpl rep,
Credentials credentials,
java.lang.String workspaceName)
throws RepositoryException,
NoSuchWorkspaceException
- Description copied from interface:
RepositoryProvider
- Opens a repository. Called whenever a session login() is performed.
- Specified by:
open
in interface RepositoryProvider
- Parameters:
rep
- 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.
- Throws:
NoSuchWorkspaceException
- if no such workspace exists.
RepositoryException
putPropertyValue
public void putPropertyValue(StoreTransaction tx,
Path path,
ValueContainer property)
throws RepositoryException
- Description copied from interface:
RepositoryProvider
- Sets or adds a new Property to the repository. Note that
a Property may be multi-valued. It is up to the provider to
decide how it serializes the data.
- Specified by:
putPropertyValue
in interface RepositoryProvider
property
- The Property content to store.
- Throws:
RepositoryException
- If the property cannot be stored.
remove
public void remove(StoreTransaction tx,
Path path)
throws RepositoryException
- Description copied from interface:
RepositoryProvider
- Removes a node or a property from the repository. If the removed
entity is a Node, all of its children and properties MUST also be removed
from the repository.
In 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.
- Specified by:
remove
in interface RepositoryProvider
- Throws:
RepositoryException
reorderNodes
public void reorderNodes(StoreTransaction tx,
Path path,
java.util.List<Path> childOrder)
throws RepositoryException
- Specified by:
reorderNodes
in interface RepositoryProvider
- Throws:
RepositoryException
start
public void start(RepositoryImpl repository,
java.util.Properties properties)
throws ConfigurationException
- Description copied from interface:
RepositoryProvider
- Starts access to a repository. This is called only once per
RepositoryProvider lifecycle.
- Specified by:
start
in interface RepositoryProvider
- Parameters:
repository
- The Repository which owns this provider.properties
- A set of filtered properties for this provider.
- Throws:
ConfigurationException
- If the repository cannot be started due to a faulty configuration.- See Also:
ProviderManager.filterProperties(RepositoryImpl, String)
stop
public void stop(RepositoryImpl rep)
- Description copied from interface:
RepositoryProvider
- Stops a given repository. This may be called without a preceding call
to close(). All allocated resources can now be deallocated.
This method will only be called when the Repository shuts down.
- Specified by:
stop
in interface RepositoryProvider
- Parameters:
rep
- The Repository object.
storeCancelled
public void storeCancelled(StoreTransaction tx)
throws RepositoryException
- Description copied from interface:
RepositoryProvider
- If the store has been cancelled and changes need to be rolled back. A RepositoryProvider
should use this opportunity to make sure it is in a consistent state.
- Specified by:
storeCancelled
in interface RepositoryProvider
- Parameters:
tx
- The transaction from storeStarted().
- Throws:
RepositoryException
storeFinished
public void storeFinished(StoreTransaction tx)
throws RepositoryException
- Description copied from interface:
RepositoryProvider
- This method is called when the repository-changing operation is complete. For example,
you could close the transaction at this stage.
- Specified by:
storeFinished
in interface RepositoryProvider
- Parameters:
tx
- The same StoreTransaction object which was returned from storeStarted().
- Throws:
RepositoryException
storeStarted
public StoreTransaction storeStarted(WorkspaceImpl ws)
throws RepositoryException
- Description copied from interface:
RepositoryProvider
- This method is called whenever Priha starts a transaction which will save the
contents of the repository. You could, for example, use this to start a transaction.
- Specified by:
storeStarted
in interface RepositoryProvider
- Parameters:
ws
- The workspace
- Returns:
- An arbitrary StoreTransaction object. May be null.
- Throws:
RepositoryException