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. Access to the storage in data manager makes 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 based on a configuration only. After the container created it's not possible to change parameters. Configuration consists of implementation class and set of properties and Value Storages configuration.

Connection create 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 throws IllegalStateException if connection is closed. UnsupportedOperationException if the method is not supported (e.g. JCR Level 1 implementation etc). RepositoryException if some error occurs during preparation, validation or persistence.