org.apache.ldap.server.db.jdbm
Class JdbmIndex

java.lang.Object
  extended byorg.apache.ldap.server.db.jdbm.JdbmIndex
All Implemented Interfaces:
Index

public class JdbmIndex
extends java.lang.Object
implements Index

A Jdbm based index implementation.

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

Field Summary
static java.lang.String FORWARD_BTREE
           
static java.lang.String REVERSE_BTREE
           
 
Constructor Summary
JdbmIndex(org.apache.ldap.common.schema.AttributeType attribute, jdbm.RecordManager recMan)
          Creates an Index using an existing record manager based on a file.
JdbmIndex(org.apache.ldap.common.schema.AttributeType attribute, java.lang.String wkDirPath)
          TODO Document me!
 
Method Summary
 void add(javax.naming.directory.Attribute attr, java.math.BigInteger id)
          TODO Document me!
 void add(javax.naming.directory.Attributes attrs, java.math.BigInteger id)
          TODO Document me!
 void add(java.lang.Object attrVal, java.math.BigInteger id)
          TODO Document me!
 void close()
          TODO Document me!
 int count()
          Gets the total scan count for this index.
 int count(java.lang.Object attrVal)
          Gets the scan count for the occurance of a specific attribute value within the index.
 int count(java.lang.Object attrVal, boolean isGreaterThan)
          TODO Document me!
 void drop(javax.naming.directory.Attribute attr, java.math.BigInteger id)
          If the Attribute does not have any values then this reduces to a drop(BigInteger) call.
 void drop(javax.naming.directory.Attributes attrs, java.math.BigInteger id)
          If the Attribute for this index within the Attributes does not have any values then this reduces to a drop(BigInteger) call.
 void drop(java.math.BigInteger entryId)
          TODO Document me!
 void drop(java.lang.Object attrVal, java.math.BigInteger id)
          TODO Document me!
 java.math.BigInteger forwardLookup(java.lang.Object attrVal)
          TODO Document me!
 org.apache.ldap.common.schema.AttributeType getAttribute()
          Gets the attribute this Index is built upon.
 java.lang.Object getNormalized(java.lang.Object attrVal)
          TODO Document me!
 boolean hasValue(java.lang.Object attrVal, java.math.BigInteger id)
          TODO Document me!
 boolean hasValue(java.lang.Object attrVal, java.math.BigInteger id, boolean isGreaterThan)
          TODO Document me!
 boolean hasValue(org.apache.regexp.RE regex, java.math.BigInteger id)
          TODO Document me!
 IndexEnumeration listIndices()
          TODO Document me!
 IndexEnumeration listIndices(java.lang.Object attrVal)
          TODO Document me!
 IndexEnumeration listIndices(java.lang.Object attrVal, boolean isGreaterThan)
          TODO Document me!
 IndexEnumeration listIndices(org.apache.regexp.RE regex)
          TODO Document me!
 IndexEnumeration listIndices(org.apache.regexp.RE regex, java.lang.String prefix)
          TODO Document me!
 IndexEnumeration listReverseIndices(java.math.BigInteger id)
          TODO Document me!
 java.lang.Object reverseLookup(java.math.BigInteger id)
          TODO Document me!
 void sync()
          TODO Document me!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORWARD_BTREE

public static final java.lang.String FORWARD_BTREE
See Also:
Constant Field Values

REVERSE_BTREE

public static final java.lang.String REVERSE_BTREE
See Also:
Constant Field Values
Constructor Detail

JdbmIndex

public JdbmIndex(org.apache.ldap.common.schema.AttributeType attribute,
                 jdbm.RecordManager recMan)
          throws javax.naming.NamingException
Creates an Index using an existing record manager based on a file. The index table B+Tree are created and saved within this file rather than creating a new file.

Parameters:
attribute - the attribute specification to base this index on
recMan - the record manager
Throws:
javax.naming.NamingException - if we fail to create B+Trees using recMan

JdbmIndex

public JdbmIndex(org.apache.ldap.common.schema.AttributeType attribute,
                 java.lang.String wkDirPath)
          throws javax.naming.NamingException
TODO Document me!

Parameters:
attribute - TODO
wkDirPath - TODO
Throws:
javax.naming.NamingException - TODO
Method Detail

getAttribute

public org.apache.ldap.common.schema.AttributeType getAttribute()
Description copied from interface: Index
Gets the attribute this Index is built upon.

Specified by:
getAttribute in interface Index
Returns:
the id of the Index's attribute
See Also:
Index.getAttribute()

count

public int count()
          throws javax.naming.NamingException
Description copied from interface: Index
Gets the total scan count for this index.

Specified by:
count in interface Index
Returns:
the number of key/value pairs in this index
Throws:
javax.naming.NamingException - if their is a failure accessing the index
See Also:
Index.count()

count

public int count(java.lang.Object attrVal)
          throws javax.naming.NamingException
Description copied from interface: Index
Gets the scan count for the occurance of a specific attribute value within the index.

Specified by:
count in interface Index
Parameters:
attrVal - the value of the attribute to get a scan count for
Returns:
the number of key/value pairs in this index with the value value
Throws:
javax.naming.NamingException - if their is a failure accessing the index
See Also:
Index.count(java.lang.Object)

count

public int count(java.lang.Object attrVal,
                 boolean isGreaterThan)
          throws javax.naming.NamingException
Description copied from interface: Index
TODO Document me!

Specified by:
count in interface Index
Parameters:
attrVal - TODO
isGreaterThan - TODO
Returns:
TODO
Throws:
javax.naming.NamingException - TODO
See Also:
Index.count(java.lang.Object, boolean)

forwardLookup

public java.math.BigInteger forwardLookup(java.lang.Object attrVal)
                                   throws javax.naming.NamingException
Description copied from interface: Index
TODO Document me!

Specified by:
forwardLookup in interface Index
Parameters:
attrVal - TODO
Returns:
TODO
Throws:
javax.naming.NamingException - TODO
See Also:
Index.forwardLookup(java.lang.Object)

reverseLookup

public java.lang.Object reverseLookup(java.math.BigInteger id)
                               throws javax.naming.NamingException
Description copied from interface: Index
TODO Document me!

Specified by:
reverseLookup in interface Index
Parameters:
id - TODO
Returns:
TODO
Throws:
javax.naming.NamingException - TODO
See Also:
Index.reverseLookup(java.math.BigInteger)

add

public void add(java.lang.Object attrVal,
                java.math.BigInteger id)
         throws javax.naming.NamingException
Description copied from interface: Index
TODO Document me!

Specified by:
add in interface Index
Parameters:
attrVal - TODO
id - TODO
Throws:
javax.naming.NamingException - TODO
See Also:
Index.add(java.lang.Object, java.math.BigInteger)

add

public void add(javax.naming.directory.Attribute attr,
                java.math.BigInteger id)
         throws javax.naming.NamingException
Description copied from interface: Index
TODO Document me!

Specified by:
add in interface Index
Parameters:
attr - TODO
id - TODO
Throws:
javax.naming.NamingException - TODO
See Also:
Index.add( javax.naming.directory.Attribute, java.math.BigInteger)

add

public void add(javax.naming.directory.Attributes attrs,
                java.math.BigInteger id)
         throws javax.naming.NamingException
Description copied from interface: Index
TODO Document me!

Specified by:
add in interface Index
Parameters:
attrs - TODO
id - TODO
Throws:
javax.naming.NamingException - TODO
See Also:
Index.add( javax.naming.directory.Attributes, java.math.BigInteger)

drop

public void drop(java.lang.Object attrVal,
                 java.math.BigInteger id)
          throws javax.naming.NamingException
Description copied from interface: Index
TODO Document me!

Specified by:
drop in interface Index
Parameters:
attrVal - TODO
id - TODO
Throws:
javax.naming.NamingException - TODO
See Also:
Index.drop(java.lang.Object, java.math.BigInteger)

drop

public void drop(java.math.BigInteger entryId)
          throws javax.naming.NamingException
Description copied from interface: Index
TODO Document me!

Specified by:
drop in interface Index
Parameters:
entryId - TODO
Throws:
javax.naming.NamingException - TODO
See Also:
Index.drop(java.math.BigInteger)

drop

public void drop(javax.naming.directory.Attribute attr,
                 java.math.BigInteger id)
          throws javax.naming.NamingException
Description copied from interface: Index
If the Attribute does not have any values then this reduces to a drop(BigInteger) call.

Specified by:
drop in interface Index
Parameters:
attr - TODO
id - TODO
Throws:
javax.naming.NamingException - TODO
See Also:
Index.drop( javax.naming.directory.Attribute, java.math.BigInteger)

drop

public void drop(javax.naming.directory.Attributes attrs,
                 java.math.BigInteger id)
          throws javax.naming.NamingException
Description copied from interface: Index
If the Attribute for this index within the Attributes does not have any values then this reduces to a drop(BigInteger) call.

Specified by:
drop in interface Index
Parameters:
attrs - TODO
id - TODO
Throws:
javax.naming.NamingException - TODO
See Also:
Index.drop( javax.naming.directory.Attributes, java.math.BigInteger)

listReverseIndices

public IndexEnumeration listReverseIndices(java.math.BigInteger id)
                                    throws javax.naming.NamingException
Description copied from interface: Index
TODO Document me!

Specified by:
listReverseIndices in interface Index
Parameters:
id - TODO
Returns:
TODO
Throws:
javax.naming.NamingException - TODO
See Also:
Index.listReverseIndices(BigInteger)

listIndices

public IndexEnumeration listIndices()
                             throws javax.naming.NamingException
Description copied from interface: Index
TODO Document me!

Specified by:
listIndices in interface Index
Returns:
TODO
Throws:
javax.naming.NamingException - TODO
See Also:
Index.listIndices()

listIndices

public IndexEnumeration listIndices(java.lang.Object attrVal)
                             throws javax.naming.NamingException
Description copied from interface: Index
TODO Document me!

Specified by:
listIndices in interface Index
Parameters:
attrVal - TODO
Returns:
TODO
Throws:
javax.naming.NamingException - TODO
See Also:
Index.listIndices(java.lang.Object)

listIndices

public IndexEnumeration listIndices(java.lang.Object attrVal,
                                    boolean isGreaterThan)
                             throws javax.naming.NamingException
Description copied from interface: Index
TODO Document me!

Specified by:
listIndices in interface Index
Parameters:
attrVal - TODO
isGreaterThan - TODO
Returns:
TODO
Throws:
javax.naming.NamingException - TODO
See Also:
Index.listIndices(java.lang.Object, boolean)

listIndices

public IndexEnumeration listIndices(org.apache.regexp.RE regex)
                             throws javax.naming.NamingException
Description copied from interface: Index
TODO Document me!

Specified by:
listIndices in interface Index
Parameters:
regex - TODO
Returns:
TODO
Throws:
javax.naming.NamingException - TODO
See Also:
Index.listIndices(org.apache.regexp.RE)

listIndices

public IndexEnumeration listIndices(org.apache.regexp.RE regex,
                                    java.lang.String prefix)
                             throws javax.naming.NamingException
Description copied from interface: Index
TODO Document me!

Specified by:
listIndices in interface Index
Parameters:
regex - TODO
prefix - TODO
Returns:
TODO
Throws:
javax.naming.NamingException - TODO
See Also:
Index.listIndices(org.apache.regexp.RE, java.lang.String)

hasValue

public boolean hasValue(java.lang.Object attrVal,
                        java.math.BigInteger id)
                 throws javax.naming.NamingException
Description copied from interface: Index
TODO Document me!

Specified by:
hasValue in interface Index
Parameters:
attrVal - TODO
id - TODO
Returns:
TODO
Throws:
javax.naming.NamingException - TODO
See Also:
Index.hasValue(java.lang.Object, java.math.BigInteger)

hasValue

public boolean hasValue(java.lang.Object attrVal,
                        java.math.BigInteger id,
                        boolean isGreaterThan)
                 throws javax.naming.NamingException
Description copied from interface: Index
TODO Document me!

Specified by:
hasValue in interface Index
Parameters:
attrVal - TODO
id - TODO
isGreaterThan - TODO
Returns:
TODO
Throws:
javax.naming.NamingException - TODO
See Also:
Index.hasValue(java.lang.Object, java.math.BigInteger, boolean)

hasValue

public boolean hasValue(org.apache.regexp.RE regex,
                        java.math.BigInteger id)
                 throws javax.naming.NamingException
Description copied from interface: Index
TODO Document me!

Specified by:
hasValue in interface Index
Parameters:
regex - TODO
id - TODO
Returns:
TODO
Throws:
javax.naming.NamingException - TODO
See Also:
Index.hasValue(org.apache.regexp.RE, java.math.BigInteger)

close

public void close()
           throws javax.naming.NamingException
Description copied from interface: Index
TODO Document me!

Specified by:
close in interface Index
Throws:
javax.naming.NamingException - TODO
See Also:
Index.close()

sync

public void sync()
          throws javax.naming.NamingException
Description copied from interface: Index
TODO Document me!

Specified by:
sync in interface Index
Throws:
javax.naming.NamingException - TODO
See Also:
Index.sync()

getNormalized

public java.lang.Object getNormalized(java.lang.Object attrVal)
                               throws javax.naming.NamingException
TODO Document me!

Specified by:
getNormalized in interface Index
Parameters:
attrVal - TODO
Returns:
TODO
Throws:
javax.naming.NamingException - TODO


Copyright © 2002-2005 . All Rights Reserved.