|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.core.persistence.bundle.util.DbNameIndex
public class DbNameIndex
Implements a StringIndex
that stores and retrieves the names from a
table in a database.
Field Summary | |
---|---|
protected ConnectionRecoveryManager |
connectionManager
The class that manages statement execution and recovery from connection loss. |
protected String |
indexSelectSQL
|
protected String |
nameInsertSQL
|
protected String |
nameSelectSQL
|
Constructor Summary | |
---|---|
DbNameIndex(ConnectionRecoveryManager conMgr,
String schemaObjectPrefix)
Creates a new index that is stored in a db. |
Method Summary | |
---|---|
void |
close()
Closes this index and releases it's resources. |
protected int |
getIndex(String string)
Retrieves the index from the database for the given string. |
protected String |
getString(int index)
Retrieves the string from the database for the given index. |
String |
indexToString(int idx)
Returns the string for a given index. |
protected void |
init(String schemaObjectPrefix)
Inits this index and prepares the statements. |
protected int |
insertString(String string)
Inserts a string into the database and returns the new index. |
int |
stringToIndex(String string)
Returns the index for a given string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ConnectionRecoveryManager connectionManager
protected String nameSelectSQL
protected String indexSelectSQL
protected String nameInsertSQL
Constructor Detail |
---|
public DbNameIndex(ConnectionRecoveryManager conMgr, String schemaObjectPrefix) throws SQLException
con
- the jdbc connectionschemaObjectPrefix
- the prefix for table names
SQLException
- if the statements cannot be prepared.Method Detail |
---|
protected void init(String schemaObjectPrefix) throws SQLException
con
- the jdbc connectionschemaObjectPrefix
- the prefix for table names
SQLException
- if the statements cannot be prepared.public void close()
public int stringToIndex(String string)
stringToIndex
in interface StringIndex
string
- the indexed (or to be indexed) string
public String indexToString(int idx) throws IllegalArgumentException
indexToString
in interface StringIndex
idx
- index of a string
IllegalArgumentException
- if the indexed string does not existprotected int insertString(String string)
string
- the string to insert
protected int getIndex(String string)
string
- the string to retrieve the index for
protected String getString(int index) throws IllegalArgumentException, IllegalStateException
index
- the index to retrieve the string for.
IllegalArgumentException
- if the string is not found
IllegalStateException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |