|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.server.xdbm.AbstractIndex<K,O,ID>
org.apache.directory.server.xdbm.GenericIndex<K,O,ID>
public class GenericIndex<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.
| Field Summary | |
|---|---|
protected URI |
wkDirPath
Index working directory |
| Fields inherited from class org.apache.directory.server.xdbm.AbstractIndex |
|---|
attributeId, attributeType, cacheSize, initialized |
| Fields inherited from interface org.apache.directory.server.xdbm.Index |
|---|
DEFAULT_INDEX_CACHE_SIZE |
| Constructor Summary | |
|---|---|
GenericIndex(String attributeId)
Creates a new instance of GenericIndex. |
|
GenericIndex(String attributeId,
int cacheSize)
Creates a new instance of GenericIndex. |
|
GenericIndex(String attributeId,
int cacheSize,
URI wkDirPath)
Creates a new instance of GenericIndex. |
|
| Method Summary | |
|---|---|
void |
add(K attrVal,
ID id)
Add an entry into the index, associated with the element ID. |
void |
close()
|
int |
count()
Gets the total scan count for this index. |
int |
count(K attrVal)
Gets the scan count for the occurrence of a specific attribute value within the index. |
void |
drop(ID id)
Remove all the reference to an entry from the index. |
void |
drop(K attrVal,
ID id)
Remove the pair |
boolean |
forward(K attrVal)
|
boolean |
forward(K attrVal,
ID id)
|
IndexCursor<K,O,ID> |
forwardCursor()
|
IndexCursor<K,O,ID> |
forwardCursor(K key)
|
boolean |
forwardGreaterOrEq(K attrVal)
|
boolean |
forwardGreaterOrEq(K attrVal,
ID id)
|
boolean |
forwardLessOrEq(K attrVal)
|
boolean |
forwardLessOrEq(K attrVal,
ID id)
|
ID |
forwardLookup(K attrVal)
|
org.apache.directory.shared.ldap.model.cursor.Cursor<ID> |
forwardValueCursor(K key)
|
org.apache.directory.shared.ldap.model.schema.AttributeType |
getAttribute()
Gets the attribute this Index is built upon. |
K |
getNormalized(K attrVal)
Gets the normalized value for an attribute. |
URI |
getWkDirPath()
Gets the working directory path to something other than the default. |
int |
greaterThanCount(K attrVal)
|
boolean |
isDupsEnabled()
tells whether the Index implementation supports storing duplicate keys |
int |
lessThanCount(K attrVal)
|
boolean |
reverse(ID id)
|
boolean |
reverse(ID id,
K attrVal)
|
IndexCursor<K,O,ID> |
reverseCursor()
|
IndexCursor<K,O,ID> |
reverseCursor(ID id)
|
boolean |
reverseGreaterOrEq(ID id)
|
boolean |
reverseGreaterOrEq(ID id,
K attrVal)
|
boolean |
reverseLessOrEq(ID id)
|
boolean |
reverseLessOrEq(ID id,
K attrVal)
|
K |
reverseLookup(ID id)
|
org.apache.directory.shared.ldap.model.cursor.Cursor<K> |
reverseValueCursor(ID id)
|
void |
setWkDirPath(URI wkDirPath)
Sets the working directory path to something other than the default. |
void |
sync()
|
| Methods inherited from class org.apache.directory.server.xdbm.AbstractIndex |
|---|
getAttributeId, getCacheSize, protect, setAttributeId, setCacheSize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected URI wkDirPath
| Constructor Detail |
|---|
public GenericIndex(String attributeId)
attributeId - the attribute ID
public GenericIndex(String attributeId,
int cacheSize)
attributeId - the attribute IDcacheSize - the cache size
public GenericIndex(String attributeId,
int cacheSize,
URI wkDirPath)
attributeId - the attribute IDcacheSize - the cache sizewkDirPath - the working directory| Method Detail |
|---|
public void add(K attrVal,
ID id)
throws Exception
Index
attrVal - The added valueid - The element ID pointed by the added value
Exception - If the addition can't be done
public void close()
throws Exception
Exception
public int count()
throws Exception
Index
Exception - on failure to access index db files
public int count(K attrVal)
throws Exception
Index
attrVal - the value of the attribute to get a scan count for
Exception - on failure to access index db files
public void drop(ID id)
throws Exception
Index[entryId, [top, person, inetOrgPerson]]and the forward index will contain many entries like :
[top, [..., entryId, ...]] [person, [..., entryId, ...]] [inetOrgPerson, [..., entryId, ...]]So dropping the entryId means that we must first get all the values from the reverse index (and we will get [top, person, inetOrgPerson]) then to iterate through all those values to remove entryId from the associated list of entryIds.
id - The master table entry ID to remove
Exception
public void drop(K attrVal,
ID id)
throws Exception
Index
attrVal - The value we want to remove from the indexid - The associated ID
Exception - If the removal can't be done
public IndexCursor<K,O,ID> forwardCursor()
throws Exception
Exception
public IndexCursor<K,O,ID> forwardCursor(K key)
throws Exception
Exception
public ID forwardLookup(K attrVal)
throws Exception
Exception
public org.apache.directory.shared.ldap.model.cursor.Cursor<ID> forwardValueCursor(K key)
throws Exception
Exception
public boolean forward(K attrVal)
throws Exception
Exception
public boolean forward(K attrVal,
ID id)
throws Exception
Exception
public boolean reverse(ID id)
throws Exception
Exception
public boolean reverse(ID id,
K attrVal)
throws Exception
Exception
public boolean forwardGreaterOrEq(K attrVal)
throws Exception
Exception
public boolean forwardGreaterOrEq(K attrVal,
ID id)
throws Exception
Exception
public boolean reverseGreaterOrEq(ID id)
throws Exception
Exception
public boolean reverseGreaterOrEq(ID id,
K attrVal)
throws Exception
Exception
public boolean forwardLessOrEq(K attrVal)
throws Exception
Exception
public boolean forwardLessOrEq(K attrVal,
ID id)
throws Exception
Exception
public boolean reverseLessOrEq(ID id)
throws Exception
Exception
public boolean reverseLessOrEq(ID id,
K attrVal)
throws Exception
Exceptionpublic org.apache.directory.shared.ldap.model.schema.AttributeType getAttribute()
AbstractIndex
getAttribute in interface Index<K,O,ID>getAttribute in class AbstractIndex<K,O,ID>
public K getNormalized(K attrVal)
throws Exception
Index
attrVal - the user provided value to normalize
Exception - if something goes wrong.public URI getWkDirPath()
Index
public int greaterThanCount(K attrVal)
throws Exception
Exception
public int lessThanCount(K attrVal)
throws Exception
Exception
public IndexCursor<K,O,ID> reverseCursor()
throws Exception
Exception
public IndexCursor<K,O,ID> reverseCursor(ID id)
throws Exception
Exception
public K reverseLookup(ID id)
throws Exception
Exception
public org.apache.directory.shared.ldap.model.cursor.Cursor<K> reverseValueCursor(ID id)
throws Exception
Exceptionpublic void setWkDirPath(URI wkDirPath)
Index
wkDirPath - optional working directory path
public void sync()
throws Exception
Exceptionpublic boolean isDupsEnabled()
isDupsEnabled in interface Index<K,O,ID>isDupsEnabled in class AbstractIndex<K,O,ID>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||