org.apache.directory.server.core.partition.impl.btree.jdbm
Class JdbmMasterTable

java.lang.Object
  extended by org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmTable
      extended by org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmMasterTable
All Implemented Interfaces:
MasterTable, Table

public class JdbmMasterTable
extends JdbmTable
implements MasterTable

The master table used to store the Attributes of entries.

Version:
$Rev: 493916 $
Author:
Apache Directory Project

Field Summary
 
Fields inherited from interface org.apache.directory.server.core.partition.impl.btree.MasterTable
DBF, SEQPROP_KEY
 
Constructor Summary
JdbmMasterTable(jdbm.RecordManager recMan)
          Creates the master entry table using a Berkeley Db for the backing store.
 
Method Summary
 javax.naming.directory.Attributes delete(java.math.BigInteger id)
          Deletes a entry from the master table at an index specified by id.
 javax.naming.directory.Attributes get(java.math.BigInteger id)
          Gets the Attributes of an entry from this MasterTable.
 java.math.BigInteger getCurrentId()
          Get's the current id value from this master database's sequence without affecting the seq.
 java.math.BigInteger getNextId()
          Get's the next value from this SequenceBDb.
 java.lang.String getProperty(java.lang.String property)
          Gets a persistant property stored in the admin table of this MasterTable.
 javax.naming.directory.Attributes put(javax.naming.directory.Attributes entry, java.math.BigInteger id)
          Puts the Attributes of an entry into this master table at an index specified by id.
 void setProperty(java.lang.String property, java.lang.String value)
          Sets a persistant property stored in the admin table of this MasterTable.
 
Methods inherited from class org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmTable
close, count, count, count, get, getComparator, getName, getRenderer, has, has, has, has, isDupsEnabled, isSortedDupsEnabled, listTuples, listTuples, listTuples, listTuples, listValues, put, put, remove, remove, remove, setRenderer, sync
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.directory.server.core.partition.impl.btree.Table
close, count, count, count, get, getComparator, getName, getRenderer, has, has, has, has, isDupsEnabled, isSortedDupsEnabled, listTuples, listTuples, listTuples, listTuples, listValues, put, put, remove, remove, remove, setRenderer
 

Constructor Detail

JdbmMasterTable

public JdbmMasterTable(jdbm.RecordManager recMan)
                throws javax.naming.NamingException
Creates the master entry table using a Berkeley Db for the backing store.

Parameters:
recMan - the jdbm record manager
Throws:
javax.naming.NamingException - if there is an error opening the Db file.
Method Detail

get

public javax.naming.directory.Attributes get(java.math.BigInteger id)
                                      throws javax.naming.NamingException
Gets the Attributes of an entry from this MasterTable.

Specified by:
get in interface MasterTable
Parameters:
id - the BigInteger id of the entry to retrieve.
Returns:
the Attributes of the entry with operational attributes and all.
Throws:
javax.naming.NamingException - if there is a read error on the underlying Db.

put

public javax.naming.directory.Attributes put(javax.naming.directory.Attributes entry,
                                             java.math.BigInteger id)
                                      throws javax.naming.NamingException
Puts the Attributes of an entry into this master table at an index specified by id. Used both to create new entries and update existing ones.

Specified by:
put in interface MasterTable
Parameters:
entry - the Attributes of entry w/ operational attributes
id - the BigInteger id of the entry to put
Returns:
the Attributes of the entry put
Throws:
javax.naming.NamingException - if there is a write error on the underlying Db.

delete

public javax.naming.directory.Attributes delete(java.math.BigInteger id)
                                         throws javax.naming.NamingException
Deletes a entry from the master table at an index specified by id.

Specified by:
delete in interface MasterTable
Parameters:
id - the BigInteger id of the entry to delete
Returns:
the Attributes of the deleted entry
Throws:
javax.naming.NamingException - if there is a write error on the underlying Db

getCurrentId

public java.math.BigInteger getCurrentId()
                                  throws javax.naming.NamingException
Get's the current id value from this master database's sequence without affecting the seq.

Specified by:
getCurrentId in interface MasterTable
Returns:
the current value.
Throws:
javax.naming.NamingException - if the admin table storing sequences cannot be read.

getNextId

public java.math.BigInteger getNextId()
                               throws javax.naming.NamingException
Get's the next value from this SequenceBDb. This has the side-effect of changing the current sequence values perminantly in memory and on disk. Master table sequence begins at BigInteger.ONE. The BigInteger.ZERO is used for the fictitious parent of the suffix root entry.

Specified by:
getNextId in interface MasterTable
Returns:
the current value incremented by one.
Throws:
javax.naming.NamingException - if the admin table storing sequences cannot be read and writen to.

getProperty

public java.lang.String getProperty(java.lang.String property)
                             throws javax.naming.NamingException
Gets a persistant property stored in the admin table of this MasterTable.

Specified by:
getProperty in interface MasterTable
Parameters:
property - the key of the property to get the value of
Returns:
the value of the property
Throws:
javax.naming.NamingException - when the underlying admin table cannot be read

setProperty

public void setProperty(java.lang.String property,
                        java.lang.String value)
                 throws javax.naming.NamingException
Sets a persistant property stored in the admin table of this MasterTable.

Specified by:
setProperty in interface MasterTable
Parameters:
property - the key of the property to set the value of
value - the value of the property
Throws:
javax.naming.NamingException - when the underlying admin table cannot be writen


Copyright © 2003-2012 Apache Software Foundation. All Rights Reserved.