JBoss.orgCommunity Documentation

Chapter 41. JCR Workspace Data Container (architecture contract)

41.1. Goals
41.2. Concepts
41.2.1. Container and connection
41.2.2. Value storages
41.2.3. Lifecycle
41.2.4. Value storage lifecycle
41.3. Requirements
41.3.1. Read operations
41.3.2. Write operations
41.3.3. State operations
41.3.4. Validation of write operations
41.3.5. Consistency of save
41.4. Value storages API
41.4.1. Storages provider:
41.4.2. Value storage plugin
41.4.3. Value I/O channel
41.4.4. Transaction support via channel

Workspace Data Container (container) serves Repository Workspace persistent storage. WorkspacePersistentDataManager (data manager) uses container to perform CRUD operation on the persistent storage. Accessing to the storage in the data manager is implemented via storage connection obtained from the container (WorkspaceDataContainer interface implemenatiton). Each connection represents a transaction on the storage. Storage Connection (connection) should be an implementation of WorkspaceStorageConnection.

WorkspaceStorageConnection openConnection() throws RepositoryException;
WorkspaceStorageConnection openConnection(boolean readOnly) throws RepositoryException;
WorkspaceStorageConnection reuseConnection(WorkspaceStorageConnection original) throws RepositoryException;
boolean isCheckSNSNewConnection();

Container initialization is only based on a configuration. After the container has been created, it's not possible to change parameters. Configuration consists of implementation class and set of properties and Value Storages configuration.

Connection creation and reuse should be a thread safe operation. Connection provides CRUD operations support on the storage.

void add(NodeData data) throws RepositoryException,UnsupportedOperationException,InvalidItemStateException,IllegalStateException;
void add(PropertyData data) throws RepositoryException,UnsupportedOperationException,InvalidItemStateException,IllegalStateException;
void update(NodeData data) throws RepositoryException,UnsupportedOperationException,InvalidItemStateException,IllegalStateException;
void update(PropertyData data) throws RepositoryException,UnsupportedOperationException,InvalidItemStateException,IllegalStateException;
void rename(NodeData data) throws RepositoryException,UnsupportedOperationException,InvalidItemStateException,IllegalStateException;
void delete(NodeData data) throws RepositoryException,UnsupportedOperationException,InvalidItemStateException,IllegalStateException;
void delete(PropertyData data) throws RepositoryException,UnsupportedOperationException,InvalidItemStateException,IllegalStateException;
void commit() throws IllegalStateException, RepositoryException;
void rollback() throws IllegalStateException, RepositoryException;

All methods throw IllegalStateException if connection is closed. UnsupportedOperationException if the method is not supported (e.g. JCR Level 1 implementation etc). RepositoryException if some errors occur during preparation, validation or persistence.