Container implementation obtains Values Storages option via the
ValueStoragePluginProvider
component. Provider acts as a factory of
Value channels (ValueIOChannel) and has two methods for this
purpose:
Return ValueIOChannel
matched this property and
valueOrderNumer
. Null will be returned if no channel matches.
ValueIOChannel getApplicableChannel(PropertyData property, int valueOrderNumer) throws IOException;
Return ValueIOChannel
associated with given storageId
.
ValueIOChannel getChannel(String storageId) throws IOException, ValueStorageNotFoundException;
There is also a method for consistency check, but this method is not used anywhere and storage implementations has it empty.
Provider implementation should use the ValueStoragePlugin
abstract
class as a base for all storage implementations. Plugin provides support
for provider implementation methods. Plugin's methods should be
implemented:
Initialize this plugin. Used at start time in
ValueStoragePluginProvider
.
public abstract void init(Properties props, ValueDataResourceHolder resources) throws RepositoryConfigurationException, IOException;
Open ValueIOChannel.Used
in
ValueStoragePluginProvider.getApplicableChannel(PropertyData, int)
and getChannel(String)
.
public abstract ValueIOChannel openIOChannel() throws IOException;
Return true if this storage has the same storageId
.
public abstract boolean isSame(String valueDataDescriptor);
Channel should implement the ValueIOChannel
interface. CRUD operation
for Value Storage:
Read Property value.
ValueData read(String propertyId, int orderNumber, int maxBufferSize) throws IOException;
Add or update Property value.
void write(String propertyId, ValueData data) throws IOException;
Delete Property all values.
void delete(String propertyId) throws IOException;
Transaction support via channel
Modification operations should be applied only when committing. Rollback is required for data created cleanup.
Commit channel changes.
void commit() throws IOException;
Rollback channel changes.
void rollback() throws IOException;
Prepare Value content.
void prepare() throws IOException;
Commit Value content (two phases).
void twoPhaseCommit() throws IOException;