com.sleepycat.persist.impl
Interface Catalog

All Known Implementing Classes:
ComparatorCatalog, PersistCatalog, ReadOnlyCatalog, SimpleCatalog

interface Catalog

Catalog operation interface used by format classes.

Author:
Mark Hayes
See Also:
PersistCatalog, SimpleCatalog, ReadOnlyCatalog

Field Summary
static int BETA_VERSION
           
static int CURRENT_VERSION
           
 
Method Summary
 Object convertRawObject(RawObject o, IdentityHashMap converted)
           
 Format createFormat(Class type, Map<String,Format> newFormats)
           
 Format createFormat(String clsName, Map<String,Format> newFormats)
           
 Format getFormat(Class cls, boolean checkEntitySubclassIndexes)
          Returns a format for a given class, or throws an exception.
 Format getFormat(int formatId, boolean expectStored)
          Returns a format for a given ID, or throws an exception.
 Format getFormat(String className)
          Returns a format by class name.
 int getInitVersion(Format format, boolean forReader)
          See above.
 boolean isRawAccess()
           
 

Field Detail

BETA_VERSION

static final int BETA_VERSION
See Also:
Constant Field Values

CURRENT_VERSION

static final int CURRENT_VERSION
See Also:
Constant Field Values
Method Detail

getInitVersion

int getInitVersion(Format format,
                   boolean forReader)
See above.


getFormat

Format getFormat(int formatId,
                 boolean expectStored)
Returns a format for a given ID, or throws an exception. This method is used when reading an object from the byte array format.

Parameters:
expectStored - is true if reading a record from a database, and therefore the format ID is expected to be stored also. If the format ID is not stored, a RefreshException is thrown.
Throws:
IllegalStateException - if the formatId does not correspond to a persistent class. This is an internal consistency error.

getFormat

Format getFormat(Class cls,
                 boolean checkEntitySubclassIndexes)
Returns a format for a given class, or throws an exception. This method is used when writing an object that was passed in by the user.

Parameters:
checkEntitySubclassIndexes - is true if we're expecting this format to be an entity subclass and therefore subclass secondary indexes should be opened.
Throws:
IllegalArgumentException - if the class is not persistent. This is a user error.

getFormat

Format getFormat(String className)
Returns a format by class name. Unlike #getFormat(Class), the format will not be created if it is not already known.


createFormat

Format createFormat(String clsName,
                    Map<String,Format> newFormats)
See Also:
PersistCatalog.createFormat(java.lang.String, java.util.Map)

createFormat

Format createFormat(Class type,
                    Map<String,Format> newFormats)
See Also:
PersistCatalog.createFormat(java.lang.String, java.util.Map)

isRawAccess

boolean isRawAccess()
See Also:
PersistCatalog.isRawAccess()

convertRawObject

Object convertRawObject(RawObject o,
                        IdentityHashMap converted)
See Also:
PersistCatalog.convertRawObject(com.sleepycat.persist.raw.RawObject, com.sleepycat.je.utilint.IdentityHashMap)


Copyright (c) 2004-2010 Oracle. All rights reserved.