public interface IndexManager
Workspace.getIndexManager()
, like NodeTypeManager
it represents a session's mechanism to
define, alter, or remove index definitions for the whole repository (not just the session's workspace
).
To create an IndexDefinition:
createIndexDefinitionTemplate()
method to obtain a new blank templateIndexDefinitionTemplate
to make the template accurately describe the new or updated
index definitioncreate a column definition
template
and call the setters to define the property name
to
which the column applies and the type for the column
.IndexDefinitionTemplate.setColumnDefinitions(Iterable)
to assign the column definitions to the index
definitionIndexDefinitionTemplate
, which is also an IndexDefinition
, can then be passed to the
registerIndex(IndexDefinition, boolean)
or registerIndexes(IndexDefinition[], boolean)
methods to add/update
the index definition.Workspace.getIndexManager()
Modifier and Type | Method and Description |
---|---|
IndexColumnDefinitionTemplate |
createIndexColumnDefinitionTemplate()
Create a new template that can be used to programmatically define a column on an index.
|
IndexDefinitionTemplate |
createIndexDefinitionTemplate()
Create a new template that can be used to programmatically define an index.
|
Map<String,IndexDefinition> |
getIndexDefinitions()
Get a map of the registered index definitions keyed by their names.
|
Set<String> |
getProviderNames()
Get the names of the available index providers.
|
void |
registerIndex(IndexDefinition indexDefinition,
boolean allowUpdate)
Register a new definition for an index.
|
void |
registerIndexes(IndexDefinition[] indexDefinitions,
boolean allowUpdate)
Register new definitions for several indexes.
|
void |
unregisterIndexes(String... indexNames)
Removes an existing index definition.
|
Set<String> getProviderNames()
Map<String,IndexDefinition> getIndexDefinitions()
registerIndex(IndexDefinition, boolean)
or registerIndexes(IndexDefinition[], boolean)
; to remove an
index, use unregisterIndexes(java.lang.String...)
.void registerIndex(IndexDefinition indexDefinition, boolean allowUpdate) throws InvalidIndexDefinitionException, IndexExistsException, RepositoryException
indexDefinition
- the definition; may not be nullallowUpdate
- true if the definition can update or ovewrite an existing definition with the same name, or false if
calling this method should result in an exception when the repository already contains a definition with the same
name already existsInvalidIndexDefinitionException
- if the new definition is invalidIndexExistsException
- if allowUpdate
is false
and the IndexDefinition
specifies a node type name that is already registered.RepositoryException
- if there is a problem registering the new definition, or if an existing indexvoid registerIndexes(IndexDefinition[] indexDefinitions, boolean allowUpdate) throws InvalidIndexDefinitionException, IndexExistsException, RepositoryException
indexDefinitions
- the definitions; may not be nullallowUpdate
- true if each of the definition can update or ovewrite an existing definition with the same name, or
false if calling this method should result in an exception when the repository already contains any definition with
names that match the supplied definitionsInvalidIndexDefinitionException
- if the new definition is invalidIndexExistsException
- if allowUpdate
is false
and the IndexDefinition
specifies a node type name that is already registered.RepositoryException
- if there is a problem registering the new definition, or if an existing indexvoid unregisterIndexes(String... indexNames) throws NoSuchIndexException, RepositoryException
indexNames
- the names of the index definition to be removed; may not be nullNoSuchIndexException
- there is no index with the supplied nameRepositoryException
- if there is a problem registering the new definition, or if an existing indexIndexDefinitionTemplate createIndexDefinitionTemplate()
IndexColumnDefinitionTemplate createIndexColumnDefinitionTemplate()
Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.