org.apache.directory.server.xdbm
Class AbstractIndex<K,O,ID>

java.lang.Object
  extended by org.apache.directory.server.xdbm.AbstractIndex<K,O,ID>
All Implemented Interfaces:
Index<K,O,ID>
Direct Known Subclasses:
AvlIndex, GenericIndex

public abstract class AbstractIndex<K,O,ID>
extends Object
implements Index<K,O,ID>

A generic index implementation that is just used to hold the index configuration parameters (attributeId, cacheSize, wkDirPath). All other methods are not working.

Author:
Apache Directory Project

Field Summary
protected  String attributeId
          The attribute identifier for this index
protected  org.apache.directory.shared.ldap.model.schema.AttributeType attributeType
          the attribute type resolved for this JdbmIndex
protected  int cacheSize
          the size (number of index entries) for the cache
protected  boolean initialized
          whether or not this index has been initialized
 
Fields inherited from interface org.apache.directory.server.xdbm.Index
DEFAULT_INDEX_CACHE_SIZE
 
Constructor Summary
protected AbstractIndex()
          Creates a new instance of AbstractIndex.
protected AbstractIndex(String attributeId)
          Creates a new instance of AbstractIndex.
 
Method Summary
 org.apache.directory.shared.ldap.model.schema.AttributeType getAttribute()
          Gets the attribute this Index is built upon.
 String getAttributeId()
          Gets the attribute identifier set at configuration time for this index which may not be the OID but an alias name for the attributeType associated with this Index
 int getCacheSize()
          Gets the size of the index cache in terms of the number of index entries to be cached.
 boolean isDupsEnabled()
          tells whether the Index implementation supports storing duplicate keys
protected  void protect(String property)
          Protects configuration properties from being set after initialization.
 void setAttributeId(String attributeId)
          Sets the attribute identifier set at configuration time for this index which may not be the OID but an alias name for the attributeType associated with this Index
 void setCacheSize(int cacheSize)
          Sets the size of the index cache in terms of the number of index entries to be cached.
 
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.Index
add, close, count, count, drop, drop, forward, forward, forwardCursor, forwardCursor, forwardGreaterOrEq, forwardGreaterOrEq, forwardLessOrEq, forwardLessOrEq, forwardLookup, forwardValueCursor, getNormalized, getWkDirPath, greaterThanCount, lessThanCount, reverse, reverse, reverseCursor, reverseCursor, reverseGreaterOrEq, reverseGreaterOrEq, reverseLessOrEq, reverseLessOrEq, reverseLookup, reverseValueCursor, setWkDirPath, sync
 

Field Detail

attributeId

protected String attributeId
The attribute identifier for this index


attributeType

protected org.apache.directory.shared.ldap.model.schema.AttributeType attributeType
the attribute type resolved for this JdbmIndex


cacheSize

protected int cacheSize
the size (number of index entries) for the cache


initialized

protected boolean initialized
whether or not this index has been initialized

Constructor Detail

AbstractIndex

protected AbstractIndex()
Creates a new instance of AbstractIndex.

Parameters:
attributeId - the attribute ID

AbstractIndex

protected AbstractIndex(String attributeId)
Creates a new instance of AbstractIndex.

Parameters:
attributeId - the attribute ID
Method Detail

getAttributeId

public String getAttributeId()
Description copied from interface: Index
Gets the attribute identifier set at configuration time for this index which may not be the OID but an alias name for the attributeType associated with this Index

Specified by:
getAttributeId in interface Index<K,O,ID>
Returns:
configured attribute oid or alias name

getAttribute

public org.apache.directory.shared.ldap.model.schema.AttributeType getAttribute()
Gets the attribute this Index is built upon.

Specified by:
getAttribute in interface Index<K,O,ID>
Returns:
the id of the Index's attribute

setAttributeId

public void setAttributeId(String attributeId)
Description copied from interface: Index
Sets the attribute identifier set at configuration time for this index which may not be the OID but an alias name for the attributeType associated with this Index

Specified by:
setAttributeId in interface Index<K,O,ID>
Parameters:
attributeId - configured attribute oid or alias name

isDupsEnabled

public boolean isDupsEnabled()
tells whether the Index implementation supports storing duplicate keys

Specified by:
isDupsEnabled in interface Index<K,O,ID>
Returns:
true if duplicate keys are allowed false otherwise

getCacheSize

public int getCacheSize()
Gets the size of the index cache in terms of the number of index entries to be cached.

Specified by:
getCacheSize in interface Index<K,O,ID>
Returns:
the size of the index cache

setCacheSize

public void setCacheSize(int cacheSize)
Sets the size of the index cache in terms of the number of index entries to be cached.

Specified by:
setCacheSize in interface Index<K,O,ID>
Parameters:
cacheSize - the size of the index cache

protect

protected void protect(String property)
Protects configuration properties from being set after initialization.

Parameters:
property - the property to protect


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