org.mmbase.storage
Interface Storage

All Superinterfaces:
SearchQueryHandler
All Known Subinterfaces:
DatabaseStorage
All Known Implementing Classes:
AbstractDatabaseStorage, OODatabaseStorage, PostgreSqlStorage, RelationalDatabaseStorage, SQL92DatabaseStorage, Support2Storage

Deprecated. This code is scheduled for removal once MMBase has been fully converted to the new StorageManager implementation.

public interface Storage
extends SearchQueryHandler

The Storage interface defines a storage device - a location where MMBase objects are kept, typically a database. The interface contains methods that can be used to query the storage, insert, update, or remove objects, or to change object definitions (adding fields, etc.).

Since:
MMBase-1.6
Version:
$Id: Storage.java,v 1.4 2004/01/27 12:04:45 pierre Exp $
Author:
Pierre van Rooden

Field Summary
 
Fields inherited from interface org.mmbase.storage.search.SearchQueryHandler
FEATURE_MAX_NUMBER, FEATURE_OFFSET, SUPPORT_NONE, SUPPORT_NORMAL, SUPPORT_OPTIMAL, SUPPORT_WEAK
 
Method Summary
 boolean addField(MMObjectBuilder builder, java.lang.String fieldname)
          Deprecated. Adds a field to the storage of this builder.
 boolean changeField(MMObjectBuilder builder, java.lang.String fieldname)
          Deprecated. Changes a field to the storage of this builder.
 boolean commit(MMObjectNode node)
          Deprecated. Commit this node to the specified builder.
 boolean commit(MMObjectNode node, Transaction trans)
          Deprecated. Commit this node to the specified builder within a transaction.
 boolean create(MMObjectBuilder builder)
          Deprecated. Create a storage for the specified builder.
 boolean create(MMObjectBuilder builder, Transaction trans)
          Deprecated. Create a storage for the specified builder.
 boolean created(MMObjectBuilder builder)
          Deprecated. Tells if a storage for the builder already exists
 int createKey()
          Deprecated. Gives an unique number for a node to be inserted.
 int createKey(Transaction trans)
          Deprecated. Gives an unique number for a node to be inserted.
 boolean createObjectStorage()
          Deprecated. Create the object storage (the storage where to register all objects).
 boolean createObjectStorage(Transaction trans)
          Deprecated. Create the object storage (the storage where to register all objects) within a transaction
 Transaction createTransaction()
          Deprecated. Returns a newly created transaction object.
 boolean delete(MMObjectNode node)
          Deprecated. Delete a node
 boolean delete(MMObjectNode node, Transaction trans)
          Deprecated. Delete a node within a transaction
 boolean drop(MMObjectBuilder builder)
          Deprecated. Drops the storage of this builder.
 byte[] getBytes(MMObjectNode node, java.lang.String fieldname)
          Deprecated. Retrieve a large binary object (byte array) for a specified object field.
 MMObjectNode getNode(MMObjectBuilder builder, int number)
          Deprecated. Select a node from a specified builder
 MMObjectNode getNode(MMObjectBuilder builder, int number, Transaction trans)
          Deprecated. Select a node from a specified builder
 int getNodeType(int number)
          Deprecated. Returns the nodetype for a specified nodereference
 int getNodeType(int number, Transaction trans)
          Deprecated. Returns the nodetype for a specified nodereference
 java.lang.String getText(MMObjectNode node, java.lang.String fieldname)
          Deprecated. Retrieve a large text for a specified object field.
 int insert(MMObjectNode node)
          Deprecated. This method inserts a new object, and registers the change.
 int insert(MMObjectNode node, Transaction trans)
          Deprecated. This method inserts a new object within a transaction, and registers the change.
 boolean isAllowedParentBuilder(MMObjectBuilder builder)
          Deprecated. Returns whether this storage layer allows for builder to be a parent builder (that is, other builders can 'extend' this builder and its storage device).
 void registerParentBuilder(MMObjectBuilder parent, MMObjectBuilder child)
          Deprecated. Registers a builder as a parent builder (that is, other builders can 'extend' this builder and its storage device).
 boolean removeField(MMObjectBuilder builder, java.lang.String fieldname)
          Deprecated. Deletes a field from the storage of this builder.
 int size(MMObjectBuilder builder)
          Deprecated. Return number of objects in a builder
 boolean supportsRollback()
          Deprecated. Returns whether rollback on storage level is supported.
 boolean updateStorage(MMObjectBuilder builder)
          Deprecated. Changes the storage of a builder to match its new configuration.
 
Methods inherited from interface org.mmbase.storage.search.SearchQueryHandler
getNodes, getSupportLevel, getSupportLevel
 

Method Detail

isAllowedParentBuilder

public boolean isAllowedParentBuilder(MMObjectBuilder builder)
Deprecated. 
Returns whether this storage layer allows for builder to be a parent builder (that is, other builders can 'extend' this builder and its storage device).

Parameters:
builder - the builder to test
Returns:
true if the builder can be extended
Since:
MMBase-1.6

registerParentBuilder

public void registerParentBuilder(MMObjectBuilder parent,
                                  MMObjectBuilder child)
                           throws StorageException
Deprecated. 
Registers a builder as a parent builder (that is, other builders can 'extend' this builder and its storage device). At the least, this code should check whether the builder is allowed as a parent builder, and throw an exception if this is not possible.

Parameters:
parent - the parent builder to register
child - the builder to register as the parent's child
Throws:
StorageException - when the support layer does not allow extension of this builder
Since:
MMBase-1.6

supportsRollback

public boolean supportsRollback()
Deprecated. 
Returns whether rollback on storage level is supported.

Returns:
true if transactions are supported

getText

public java.lang.String getText(MMObjectNode node,
                                java.lang.String fieldname)
Deprecated. 
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
fieldname - the name of the field to retrieve
Returns:
the retrieved text

getBytes

public byte[] getBytes(MMObjectNode node,
                       java.lang.String fieldname)
Deprecated. 
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
fieldname - the name of the field to retrieve
Returns:
the retrieved byte array

createTransaction

public Transaction createTransaction()
                              throws StorageException
Deprecated. 
Returns a newly created transaction object.

Returns:
the new transaction
Throws:
StorageException - if the transaction could not be created

createKey

public int createKey()
Deprecated. 
Gives an unique number for a node to be inserted. This method should work with multiple mmbases

Returns:
unique number

createKey

public int createKey(Transaction trans)
              throws StorageException
Deprecated. 
Gives an unique number for a node to be inserted. This method should work with multiple mmbases

Parameters:
trans - the transaction to use for obtaining the key
Returns:
unique number
Throws:
StorageException - if an error occurred during key generation

insert

public int insert(MMObjectNode node)
Deprecated. 
This method inserts a new object, and registers the change. Only fields with states of DBSTATE_PERSISTENT or DBSTATE_SYSTEM are stored.

Parameters:
node - The node to insert
Returns:
The (new) number for this node, or -1 if an error occurs.

insert

public int insert(MMObjectNode node,
                  Transaction trans)
           throws StorageException
Deprecated. 
This method inserts a new object within a transaction, and registers the change. Only fields with states of DBSTATE_PERSISTENT or DBSTATE_SYSTEM are stored.

Parameters:
node - The node to insert
trans - the transaction to perform the insert in
Returns:
The (new) number for this node, or -1 if an error occurs.
Throws:
StorageException - if an error occurred during insert

commit

public boolean commit(MMObjectNode node)
Deprecated. 
Commit this node to the specified builder.

Parameters:
node - The node to commit
Returns:
true of succesful, false otherwise

commit

public boolean commit(MMObjectNode node,
                      Transaction trans)
               throws StorageException
Deprecated. 
Commit this node to the specified builder within a transaction.

Parameters:
node - The node to commit
trans - the transaction to perform the insert in
Returns:
true of succesful, false otherwise
Throws:
StorageException - if an error occurred during commit

delete

public boolean delete(MMObjectNode node)
Deprecated. 
Delete a node

Parameters:
node - The node to delete
Returns:
true if succesful

delete

public boolean delete(MMObjectNode node,
                      Transaction trans)
               throws StorageException
Deprecated. 
Delete a node within a transaction

Parameters:
node - The node to delete
trans - the transaction to perform the insert in
Returns:
true if succesful
Throws:
StorageException - if an error occurred during delete

getNode

public MMObjectNode getNode(MMObjectBuilder builder,
                            int number)
Deprecated. 
Select a node from a specified builder

Parameters:
builder - The builder to select from
number - the number of the node
Returns:
the MMObjectNode that was found, or null f it doesn't exist

getNode

public MMObjectNode getNode(MMObjectBuilder builder,
                            int number,
                            Transaction trans)
                     throws StorageException
Deprecated. 
Select a node from a specified builder

Parameters:
builder - The builder to select from
number - the number of the node
trans - the transaction to perform the insert in
Returns:
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)
Deprecated. 
Returns the nodetype for a specified nodereference

Parameters:
number - the number of the node
Returns:
int the object type or -1 if not found

getNodeType

public int getNodeType(int number,
                       Transaction trans)
                throws StorageException
Deprecated. 
Returns the nodetype for a specified nodereference

Parameters:
number - the number of the node
trans - the transaction to perform the insert in
Returns:
int the object type or -1 if not found
Throws:
StorageException - if an error occurred during selection

create

public boolean create(MMObjectBuilder builder)
Deprecated. 
Create a storage for the specified builder.

Parameters:
builder - the builder to create the storage for
Returns:
true if the storage was succesfully created

create

public boolean create(MMObjectBuilder builder,
                      Transaction trans)
               throws StorageException
Deprecated. 
Create a storage for the specified builder.

Parameters:
builder - the builder to create the storage for
trans - the transaction to perform the create in
Returns:
true if the storage was succesfully created
Throws:
StorageException - if an error occurred during the creation fo the table

createObjectStorage

public boolean createObjectStorage()
Deprecated. 
Create the object storage (the storage where to register all objects).

Returns:
true if the storage was succesfully created

createObjectStorage

public boolean createObjectStorage(Transaction trans)
                            throws StorageException
Deprecated. 
Create the object storage (the storage where to register all objects) within a transaction

Parameters:
trans - the transaction to perform the create in
Returns:
true if the storage was succesfully created
Throws:
StorageException - if an error occurred during the caretion of the object storage

created

public boolean created(MMObjectBuilder builder)
Deprecated. 
Tells if a storage for the builder already exists

Parameters:
builder - the builder to check
Returns:
true if storage exists, false if storage doesn't exists

size

public int size(MMObjectBuilder builder)
Deprecated. 
Return number of objects in a builder

Parameters:
builder - the builder whose objects to count
Returns:
the number of objects the builder has, or -1 if the builder does not exist.

drop

public boolean drop(MMObjectBuilder builder)
Deprecated. 
Drops the storage of this builder.

Parameters:
builder - the builder whose storage to drop
Returns:
true if succesful

addField

public boolean addField(MMObjectBuilder builder,
                        java.lang.String fieldname)
Deprecated. 
Adds a field to the storage of this builder.

Parameters:
builder - the builder whose storage to change
fieldname - the name fo the field to add
Returns:
true if succesful

removeField

public boolean removeField(MMObjectBuilder builder,
                           java.lang.String fieldname)
Deprecated. 
Deletes a field from the storage of this builder.

Parameters:
builder - the builder whose storage to change
fieldname - the name fo the field to delete
Returns:
true if succesful

changeField

public boolean changeField(MMObjectBuilder builder,
                           java.lang.String fieldname)
Deprecated. 
Changes a field to the storage of this builder.

Parameters:
builder - the builder whose storage to change
fieldname - the name fo the field to change
Returns:
true if succesful

updateStorage

public boolean updateStorage(MMObjectBuilder builder)
Deprecated. 
Changes the storage of a builder to match its new configuration.

Parameters:
builder - the builder whose storage to change
Returns:
true if succesful


MMBase build 1.7.4.20050922