com.waveset.object
Interface ObjectLoader

All Superinterfaces:
CacheConsistencyNumberLoader
All Known Subinterfaces:
Session
All Known Implementing Classes:
AbstractLighthouseContext, AbstractSession, LocalSession, ObjectLoaderBase

public interface ObjectLoader
extends CacheConsistencyNumberLoader

An interface describing the characteristics of a storage manager for objects, used by the ObjectCache to dynamically fetch objects into the cache.

The cache doesn't really care where things come from, this isolation helps us use the cache in various contexts notably a remote client that may not have direct access to a repository. // Moved ItemNotFound to com.waveset.exception package. // *

// * NOTE: If we're going to have loadObject throw an object // * not found exception, then we need to define one! Right // * now we're propagating com.waveset.Repository.ItemNotFound, // * but that can't be declared here without introducing // * package dependencies. Need something in com.waveset.exception.


Method Summary
 int countObjects(RepositoryResult repoResult)
           
 PersistentObject loadObject(Type type, java.lang.String id, boolean tolerateMissing, boolean tolerateAuthzFailure, java.util.Map options)
          Load an object from the storage manager.
 java.util.ArrayList loadObjects(Type type, AttributeCondition[] attrConds)
          Load all objects of a given type.
 void nextBlock(RepositoryResult previousResult)
          Load the next blockful of objects into the specified RepositoryResult.
 void previousBlock(RepositoryResult previousResult)
          Load the previous blockful of objects into the specified RepositoryResult.
 
Methods inherited from interface com.waveset.object.CacheConsistencyNumberLoader
getCacheConsistencyNumber
 

Method Detail

loadObject

public PersistentObject loadObject(Type type,
                                   java.lang.String id,
                                   boolean tolerateMissing,
                                   boolean tolerateAuthzFailure,
                                   java.util.Map options)
                            throws WavesetException
Load an object from the storage manager. If tolerateMissing is true, silently return null if the object did not exist. If tolerateAuthzFailure is true, silently return null if the requesting admin doesn't have access to the requested object

Throws:
WavesetException - if the object was not found in the storage manager, or an internal error was encountered.

loadObjects

public java.util.ArrayList loadObjects(Type type,
                                       AttributeCondition[] attrConds)
                                throws WavesetException
Load all objects of a given type. If the optional attribute list is specified, only those objects with matching "query" attributes is returned.

Throws:
WavesetException - if an internal error was encountered.

countObjects

public int countObjects(RepositoryResult repoResult)
                 throws WavesetException
Returns:
the estimated number of rows in the "virtual result" of the specified RepositoryResult. That is, the number of rows the result would contain if it were unbuffered.
Throws:
WavesetException - if an internal error was encountered.

nextBlock

public void nextBlock(RepositoryResult previousResult)
               throws WavesetException
Load the next blockful of objects into the specified RepositoryResult.

Throws:
WavesetException - if an internal error was encountered.

previousBlock

public void previousBlock(RepositoryResult previousResult)
                   throws WavesetException
Load the previous blockful of objects into the specified RepositoryResult.

Throws:
WavesetException - if an internal error was encountered.