JBoss.orgCommunity Documentation

Chapter 16. JCR Workspace Data Container (architecture contract)

16.1. Goals
16.2. Concepts
16.2.1. Container and connection
16.2.2. Value storages
16.2.3. Lifecycle
16.2.4. Value storage lifecycle
16.3. Requirements
16.3.1. Read operations
16.3.2. Write operations
16.3.3. State operations
16.3.4. Validation of write operations
16.3.5. Consistency of save
16.4. Value storages API
16.4.1. Storages provider:
16.4.2. Value storage plugin
16.4.3. Value I/O channel
16.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.