org.apache.directory.server.core.partition.avl
Class AvlMasterTable<E>

java.lang.Object
  extended by org.apache.directory.server.core.partition.avl.AvlTable<java.lang.Long,E>
      extended by org.apache.directory.server.core.partition.avl.AvlMasterTable<E>
All Implemented Interfaces:
MasterTable<E>, Table<java.lang.Long,E>

public class AvlMasterTable<E>
extends AvlTable<java.lang.Long,E>
implements MasterTable<E>

TODO Make it so the master table does not extend table interface - not needed with this single use of delete so we should just use containment.

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Field Summary
 
Fields inherited from interface org.apache.directory.server.xdbm.MasterTable
DBF, SEQPROP_KEY
 
Constructor Summary
AvlMasterTable(java.lang.String name, java.util.Comparator<java.lang.Long> keyComparator, java.util.Comparator<E> valComparator, boolean dupsEnabled)
           
 
Method Summary
 void delete(java.lang.Long id)
          Deletes a entry from this MasterTable at an index specified by id.
 java.lang.Long getCurrentId()
          Gets the value of the id sequence from this MasterTable's sequence without affecting the value.
 java.lang.Long getNextId()
          Gets the next value from the sequence of this MasterTable.
 java.lang.String getProperty(java.lang.String property)
          Gets a persistant property associated with this MasterTable.
 void setProperty(java.lang.String property, java.lang.String value)
          Sets a persistant property associated with this MasterTable.
 
Methods inherited from class org.apache.directory.server.core.partition.avl.AvlTable
close, count, count, cursor, cursor, get, getKeyComparator, getName, getValueComparator, greaterThanCount, has, has, hasGreaterOrEqual, hasGreaterOrEqual, hasLessOrEqual, hasLessOrEqual, isCountExact, isDupsEnabled, lessThanCount, put, remove, remove, valueCursor
 
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.xdbm.MasterTable
get, put
 
Methods inherited from interface org.apache.directory.server.xdbm.Table
close, count, count, cursor, cursor, getKeyComparator, getName, getValueComparator, greaterThanCount, has, has, hasGreaterOrEqual, hasGreaterOrEqual, hasLessOrEqual, hasLessOrEqual, isCountExact, isDupsEnabled, lessThanCount, remove, remove, valueCursor
 

Constructor Detail

AvlMasterTable

public AvlMasterTable(java.lang.String name,
                      java.util.Comparator<java.lang.Long> keyComparator,
                      java.util.Comparator<E> valComparator,
                      boolean dupsEnabled)
Method Detail

delete

public void delete(java.lang.Long id)
            throws java.lang.Exception
Description copied from interface: MasterTable
Deletes a entry from this MasterTable at an index specified by id.

Specified by:
delete in interface MasterTable<E>
Parameters:
id - unique identifier of the entry to delete
Throws:
java.lang.Exception - if there is a write error on the underlying Db

getCurrentId

public java.lang.Long getCurrentId()
                            throws java.lang.Exception
Description copied from interface: MasterTable
Gets the value of the id sequence from this MasterTable's sequence without affecting the value.

Specified by:
getCurrentId in interface MasterTable<E>
Throws:
java.lang.Exception - if the admin table storing sequences cannot be read

getNextId

public java.lang.Long getNextId()
                         throws java.lang.Exception
Description copied from interface: MasterTable
Gets the next value from the sequence of this MasterTable. This has the side-effect of incrementing the sequence values perminantly.

Specified by:
getNextId in interface MasterTable<E>
Returns:
the current value of this MasterTable's sequence incremented by one
Throws:
java.lang.Exception - on failure to update the id sequence

getProperty

public java.lang.String getProperty(java.lang.String property)
                             throws java.lang.Exception
Description copied from interface: MasterTable
Gets a persistant property associated with this MasterTable.

Specified by:
getProperty in interface MasterTable<E>
Parameters:
property - the key of the property to get the value of
Returns:
the value of the property
Throws:
java.lang.Exception - on failure to read the property

setProperty

public void setProperty(java.lang.String property,
                        java.lang.String value)
                 throws java.lang.Exception
Description copied from interface: MasterTable
Sets a persistant property associated with this MasterTable.

Specified by:
setProperty in interface MasterTable<E>
Parameters:
property - the key of the property to set the value of
value - the value of the property
Throws:
java.lang.Exception - on failure to write the property


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