| org.mmbase.storage.StorageManager
All known Subclasses: org.mmbase.storage.implementation.database.DatabaseStorageManager,
StorageManager | public interface StorageManager (Code) | | The StorageManager interface defines how to access a storage device.
It contains methods that can be used to query the storage, insert, update, or remove objects,
or to change object definitions (adding fields, etc.).
author: Pierre van Rooden since: MMBase-1.7 version: $Id: StorageManager.java,v 1.7 2005/10/02 16:16:43 michiel Exp $ |
beginTransaction | public void beginTransaction() throws StorageException(Code) | | Starts a transaction on this StorageManager instance.
All commands passed to the instance will be treated as being in this transaction.
If transactions are not supported by the storage, no actual storage transaction is started, but the code continues as if it has.
throws: StorageException - if the transaction could not be created |
change | public void change(MMObjectBuilder builder) throws StorageException(Code) | | Changes the storage of a builder to match its new configuration.
Parameters: builder - the builder whose storage to change |
change | public void change(CoreField field) throws StorageException(Code) | | Changes a field to the storage of this builder.
Parameters: field - the CoreField of the field to change |
commit | public void commit() throws StorageException(Code) | | Closes any transaction that was started and commits all changes.
If transactions are not supported by the storage, nothing really happens (as changes are allready committed), but the code continues as if it has.
throws: StorageException - if a transaction is not currently active, or an error occurred while committing |
create | public int create(MMObjectNode node) throws StorageException(Code) | | This method creates a new object in the storage, and registers the change.
Only fields with states of DBSTATE_PERSISTENT or DBSTATE_SYSTEM are stored.
Parameters: node - The node to insert The (new) number for this node, or -1 if an error occurs. throws: StorageException - if an error occurred during insert |
create | public void create(MMObjectBuilder builder) throws StorageException(Code) | | Create a storage element to store the specified builder's objects.
Parameters: builder - the builder to create the storage element for throws: StorageException - if an error occurred during the creation of the storage element |
create | public void create(CoreField field) throws StorageException(Code) | | Creates a field and adds it to the storage of this builder.
Parameters: field - the CoreField of the field to add |
createKey | public int createKey() throws StorageException(Code) | | Gives an unique number for a new node, to be inserted in the storage.
This method should work with multiple mmbases
unique number |
delete | public void delete(CoreField field) throws StorageException(Code) | | Deletes a field from the storage of this builder.
Parameters: field - the CoreField of the field to delete |
exists | public boolean exists(MMObjectBuilder builder) throws StorageException(Code) | | Determine if a storage element exists for storing the given builder's objects
Parameters: builder - the builder to check true if the storage element exists, false if it doesn't throws: StorageException - if an error occurred while querying the storage |
exists | public boolean exists() throws StorageException(Code) | | Determine if the basic storage elements exist
Basic storage elements include the 'object' storage (where all objects and their types are registered).
true if basic storage elements exist throws: StorageException - if an error occurred while querying the storage |
getBinaryValue | public byte[] getBinaryValue(MMObjectNode node, CoreField field) throws StorageException(Code) | | Retrieve a large binary object (byte array) for a specified object field.
Implement this method to allow for optimization of storing and retrieving binary objects.
Parameters: node - the node to retrieve the byte array from Parameters: field - the CoreField of the field to retrieve the retrieved byte array throws: StorageException - if an error occurred while retrieving the binary value |
getNode | public MMObjectNode getNode(MMObjectBuilder builder, int number) throws StorageException(Code) | | Select a node from a specified builder
Parameters: builder - The builder to select from Parameters: number - the number of the node the MMObjectNode that was found, or null f it doesn't exist throws: StorageException - if an error occurred during the get |
getNodeType | public int getNodeType(int number) throws StorageException(Code) | | Returns the nodetype for a specified nodereference
Parameters: number - the number of the node int the object type or -1 if not found throws: StorageException - if an error occurred during selection |
getStringValue | public String getStringValue(MMObjectNode node, CoreField field) throws StorageException(Code) | | Retrieve a large text for a specified object field.
Implement this method to allow for optimization of storing and retrieving large texts.
Parameters: node - the node to retrieve the text from Parameters: field - the Type of the field to retrieve the retrieved text throws: StorageException - if an error occurred while retrieving the text value |
getVersion | public double getVersion()(Code) | | Returns the version of this factory implementation.
The factory uses this number to verify whether it can handle storage configuration files
that list version requirements.
the version as an integer |
init | public void init(StorageManagerFactory factory) throws StorageException(Code) | | Initializes the manager.
Called by a StorageManagerFactory when instantiating the manager with the getStorageManager() method.
Parameters: factory - the StorageManagerFactory instance that created this storage manager. throws: StorageConfigurationException - if the initialization failed |
rollback | public boolean rollback() throws StorageException(Code) | | Cancels any transaction that was started and rollback changes if possible.
If transactions are not supported by the storage, nothing really happens (as changes are allready committed),
but the code continues as if it has (through in that case it will return false).
true if changes were rolled back, false if the transaction wascanceled but the storage does not support rollback throws: StorageException - if a transaction is not currently active, or an error occurred during rollback |
size | public int size(MMObjectBuilder builder) throws StorageException(Code) | | Return the number of objects of a builder in the storage
Parameters: builder - the builder whose objects to count the number of objects the builder has throws: StorageException - if the storage element for the builder does not exists |
size | public int size() throws StorageException(Code) | | Return the total number of objects in the storage
the number of objects throws: StorageException - if the basic storage elements do not exist |
|
|