yawn.io
Interface IStorage

All Known Implementing Classes:
XmlStorage

public interface IStorage

A storage of instances of IPersistent sub-classes. $Id: IStorage.java,v 1.3 2005/04/07 17:28:25 supermarti Exp $

Version:
$Revision: 1.3 $
Author:
Alexei Guevara

Method Summary
 void flush()
           
 java.lang.String generateKey(java.lang.Object object)
           
 java.lang.Object get(java.lang.String key)
          Retrieves the IPersistent implementor instance that matches the provided id.
 java.lang.Object[] getAll()
          Retrieves all the instances of IPersistent implementors present in the underlying storage.
 IContext getContext()
           
 void insert(java.lang.Object object, java.lang.String key)
          Inserts an instance of a IPersistent implementor in the underlying storage.
 void setContext(IContext context)
           
 void update(java.lang.Object object, java.lang.String key)
           
 

Method Detail

setContext

void setContext(IContext context)

getContext

IContext getContext()

insert

void insert(java.lang.Object object,
            java.lang.String key)
            throws StorageException,
                   DuplicateKeyException
Inserts an instance of a IPersistent implementor in the underlying storage.

Parameters:
object - The IPersistent implementor instance to store.
Throws:
StorageException
DuplicateKeyException

generateKey

java.lang.String generateKey(java.lang.Object object)

update

void update(java.lang.Object object,
            java.lang.String key)
            throws KeyNotPresentException,
                   StorageException
Throws:
KeyNotPresentException
StorageException

get

java.lang.Object get(java.lang.String key)
                     throws StorageException,
                            KeyNotPresentException
Retrieves the IPersistent implementor instance that matches the provided id.

Parameters:
thePersistentId - The provided id.
Returns:
The IPersistent implementor instance that matches the provided id, or null if not matching instance is found.
Throws:
StorageException
KeyNotPresentException

getAll

java.lang.Object[] getAll()
                          throws StorageException
Retrieves all the instances of IPersistent implementors present in the underlying storage.

Returns:
All the retrieved instances.
Throws:
StorageException

flush

void flush()


Copyright © 2003-2005 GIAA, Universidad Carlos III de Madrid. All Rights Reserved.