ClassCatalog (Sleepycat Software, Inc. - Berkeley DB Java API)
Keywords: com.sleepycat.bdb.bind.serial.ClassCatalog,ClassCatalog interface

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB version 4.2.52
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sleepycat.bdb.bind.serial
Interface ClassCatalog

All Known Implementing Classes:
  StoredClassCatalog

public interface ClassCatalog

Represents a catalog of class information for use in object serialization so that class descriptions can be stored separately from serialized objects.

This information is used for serialization of class descriptors or java.io.ObjectStreamClass objects, each of which represents a unique class format. For each unique format, a unique class ID is assigned by the catalog. The class ID can then be used in the serialization stream in place of the full class information. When used with `SerialInput` and `SerialOutput` or any of the serial bindings, the use of the catalog is transparent to the application.

Method Summary
`void` | `close()` Close a catalog database and release any cached resources.
`ObjectStreamClass` | `getClassFormat(byte[] classID)` Return the ObjectStreamClass for the given class ID.
`ObjectStreamClass` | `getClassFormat(String className)` Return the ObjectStreamClass for the given class name.
`byte[]` | `getClassID(String className)` Return the class ID for the current version of the given class name.

Method Detail

### close

    public void close()
               throws IOException

  Close a catalog database and release any cached resources.

    `IOException`

### getClassID

    public byte[] getClassID(String className)
                      throws IOException,
                             ClassNotFoundException

  Return the class ID for the current version of the given class name. This is used for storing in serialization streams in place of a full class descriptor, since it is much more compact. To get back the ObjectStreamClass for a class ID, call `getClassFormat(byte[])`. This function causes a new class ID to be assigned if the class description has changed.

  Parameters:
    `className` - The fully qualified class name for which to return the class ID.
  Returns:
    The class ID for the current version of the class.
    `IOException`
    `ClassNotFoundException`

### getClassFormat

    public ObjectStreamClass getClassFormat(String className)
                                     throws IOException,
                                            ClassNotFoundException

  Return the ObjectStreamClass for the given class name. This is always the current class format. Calling this method is equivalent to calling java.io.ObjectStreamClass.lookup, but this method causes a new class ID to be assigned if the class description has changed.

  Parameters:
    `className` - The fully qualified class name for which to return the class format.
  Returns:
    The class format for the current version of the class.
    `IOException`
    `ClassNotFoundException`

### getClassFormat

    public ObjectStreamClass getClassFormat(byte[] classID)
                                     throws IOException,
                                            ClassNotFoundException

  Return the ObjectStreamClass for the given class ID. This may or may not be the current class format, depending on whether the class has changed since the class ID was generated.

  Parameters:
    `classID` - The class ID for which to return the class format.
  Returns:
    The class format for the given class ID, which may or may not represent the current version of the class.
    `IOException`
    `ClassNotFoundException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB version 4.2.52
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 1996-2003 Sleepycat Software, Inc. - All rights reserved.