org.apache.jdo.impl.fostore
Class DBExtent

java.lang.Object
  extended byorg.apache.jdo.impl.fostore.DBExtent
All Implemented Interfaces:
org.netbeans.mdr.persistence.Streamable

public class DBExtent
extends java.lang.Object
implements org.netbeans.mdr.persistence.Streamable

Represents a set of instances of a given class stored in the database.

This class is public so that it can be used as a Streamable and stored in the database.

Author:
Dave Bristor

Field Summary
private  CLID classCLID
          CLID of the class of the instances of this extent.
private  OID extentOID
          OID of this extent.
private  FOStoreDatabase fodb
          This DBExtent lives in a database.
private  FOStoreSchemaUID fsuid
           
private  java.util.HashSet instances
          OIDs of instances of this extent.
(package private) static org.apache.commons.logging.Log logger
          Logger
private static I18NHelper msg
          I18N support.
private  java.lang.String name
          Name of the class of instances in this extent.
 
Constructor Summary
  DBExtent()
           
private DBExtent(FOStoreDatabase fodb, java.lang.String name, FOStoreSchemaUID fsuid, CLID classCLID)
          Create a new DBExtent
 
Method Summary
(package private)  void add(OID oid)
           
(package private) static DBExtent create(FOStoreDatabase fodb, java.lang.String name, FOStoreSchemaUID fsuid, CLID classCLID)
          Return a new DBExtent to the caller.
private  void dump(java.lang.String where)
           
(package private)  CLID getClassCLID()
           
(package private)  OID getDBClassOID()
           
(package private)  CLID getExtentCLID()
           
(package private)  OID getExtentOID()
           
(package private)  java.lang.String getName()
           
(package private)  boolean isExtentFor(java.lang.String n, FOStoreSchemaUID f)
           
(package private)  java.util.Iterator iterator()
           
 void read(java.io.InputStream is)
           
(package private)  void remove(OID oid)
           
(package private)  int size()
           
(package private)  void store(FOStoreDatabase db)
           
 java.lang.String toString()
           
 void write(java.io.OutputStream os)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fodb

private FOStoreDatabase fodb
This DBExtent lives in a database.


name

private java.lang.String name
Name of the class of instances in this extent.


fsuid

private FOStoreSchemaUID fsuid

classCLID

private CLID classCLID
CLID of the class of the instances of this extent.


extentOID

private OID extentOID
OID of this extent. Cached so that we don't have to calculate each time we store the extent


instances

private java.util.HashSet instances
OIDs of instances of this extent.


msg

private static final I18NHelper msg
I18N support.


logger

static final org.apache.commons.logging.Log logger
Logger

Constructor Detail

DBExtent

private DBExtent(FOStoreDatabase fodb,
                 java.lang.String name,
                 FOStoreSchemaUID fsuid,
                 CLID classCLID)
Create a new DBExtent


DBExtent

public DBExtent()
Method Detail

create

static DBExtent create(FOStoreDatabase fodb,
                       java.lang.String name,
                       FOStoreSchemaUID fsuid,
                       CLID classCLID)
Return a new DBExtent to the caller.


isExtentFor

boolean isExtentFor(java.lang.String n,
                    FOStoreSchemaUID f)
Returns:
true if the given name and FOStoreSchemaUID are equal to those in this DBExtent.

getName

java.lang.String getName()

getExtentOID

OID getExtentOID()

getExtentCLID

CLID getExtentCLID()

getDBClassOID

OID getDBClassOID()

getClassCLID

CLID getClassCLID()

add

void add(OID oid)

remove

void remove(OID oid)

size

int size()

iterator

java.util.Iterator iterator()

store

void store(FOStoreDatabase db)
     throws FOStoreDatabaseException
Throws:
FOStoreDatabaseException

write

public void write(java.io.OutputStream os)
           throws org.netbeans.mdr.persistence.StorageException
Specified by:
write in interface org.netbeans.mdr.persistence.Streamable
Throws:
org.netbeans.mdr.persistence.StorageException

read

public void read(java.io.InputStream is)
          throws org.netbeans.mdr.persistence.StorageException
Specified by:
read in interface org.netbeans.mdr.persistence.Streamable
Throws:
org.netbeans.mdr.persistence.StorageException

dump

private void dump(java.lang.String where)

toString

public java.lang.String toString()