org.space4j.indexing
Class IndexManager

java.lang.Object
  extended by org.space4j.indexing.IndexManager
All Implemented Interfaces:
java.io.Serializable

public class IndexManager
extends java.lang.Object
implements java.io.Serializable

IndexManager will control all indexes for your space.

Author:
Sergio Oliveira Jr.
See Also:
Serialized Form

Field Summary
static java.lang.String KEY
           
 
Constructor Summary
IndexManager()
           
 
Method Summary
 void add(java.lang.Object obj, java.lang.Object source)
          Insert an object in this IndexManager.
 boolean checkIndex(java.lang.String name)
          Check if an index with that name already exists.
 boolean createIndex(Index<?> indx, Space4J space4j)
          Create an index in the system.
 boolean dropIndex(Index<?> indx, Space4J space4j)
          Drop an index from the system.
<T> Index<T>
getIndex(java.lang.String name)
          Return an index with that name.
 void remove(java.lang.Object obj, java.lang.Object source)
          Remove an object from this IndexManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY

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

IndexManager

public IndexManager()
Method Detail

dropIndex

public boolean dropIndex(Index<?> indx,
                         Space4J space4j)
                  throws CommandException,
                         LoggerException
Drop an index from the system.

Parameters:
indx - The index to drop
space4j - The space4j where this command will be executed.
Returns:
boolean True if the index was dropped.
Throws:
CommandException
LoggerException

add

public void add(java.lang.Object obj,
                java.lang.Object source)
Insert an object in this IndexManager. All indexes that index this object will be updated.

Parameters:
obj - The object to be inserted.

remove

public void remove(java.lang.Object obj,
                   java.lang.Object source)
Remove an object from this IndexManager. All the indexes that index this object will be updated.

Parameters:
obj - The object to be removed.

checkIndex

public boolean checkIndex(java.lang.String name)
Check if an index with that name already exists.

Parameters:
name - The name of the index
Returns:
true if it exists

getIndex

public <T> Index<T> getIndex(java.lang.String name)
Return an index with that name.

Parameters:
name - The name of the index.
Returns:
the index or null if it doesn't exist.

createIndex

public boolean createIndex(Index<?> indx,
                           Space4J space4j)
                    throws CommandException,
                           LoggerException
Create an index in the system.

Parameters:
indx - The index to be created.
space4j - The space4j were this command will be executed.
Returns:
True if the index was created.
Throws:
CommandException
LoggerException


Copyright © 2005 Space4J Team. All Rights Reserved.