Class IndexDefinitions
java.lang.Object
org.apache.sling.feature.cpconverter.index.IndexDefinitions
Holds information about discovered index definitions
According to the Oak documentation, indexes are located under a root /oak:index
, or (lucene indexes only)
under arbitrary repository locations, as long as they have an oak:index
parent node.
This class supports non-root indexes but does not attempt to enforce Oak-level invariants, such as which index types support non-root locations.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
dump
(@NotNull PrintStream out) Dumps a compact representation of the data@NotNull Optional<byte[]>
Returns a potential binary registered for a repository path@NotNull List<org.apache.jackrabbit.vault.util.DocViewNode2>
getChildren
(@NotNull String parentPath) Returns the discovered index definitions by locationvoid
registerBinary
(@NotNull String repositoryPath, @NotNull InputStream is) Registers a binary entry at the specified repository pathvoid
registerPrefixMapping
(@NotNull String prefix, @NotNull String uri) Registers a prefix mapping for a specified uri@NotNull String
toShortName
(@NotNull org.apache.jackrabbit.spi.Name name) Returns a name in compact format
-
Field Details
-
OAK_INDEX_NAME
- See Also:
-
OAK_INDEX_PATH
- See Also:
-
-
Constructor Details
-
IndexDefinitions
public IndexDefinitions()
-
-
Method Details
-
addNode
public void addNode(@NotNull @NotNull String parentPath, @NotNull @NotNull org.apache.jackrabbit.vault.util.DocViewNode2 node) -
getIndexes
@NotNull public @NotNull Map<String,List<org.apache.jackrabbit.vault.util.DocViewNode2>> getIndexes()Returns the discovered index definitions by locationThe returned map has the index parent location as keys and the index definitions as values, for instance:
- oak:index -> [counter, uuid]
- content/oak:index -> [lucene-2]
- Returns:
- a map of discovered index locations, possibly empty
-
getChildren
-
toShortName
Returns a name in compact formatMaps a fully qualified
name
, e.g. ['http://jackrabbit.apache.org/oak/ns/1.0','index'] to a compact name likeoak:index
- Parameters:
name
- The name to map- Returns:
- the compact name
-
registerBinary
public void registerBinary(@NotNull @NotNull String repositoryPath, @NotNull @NotNull InputStream is) throws IOException Registers a binary entry at the specified repository pathThe input stream may be fully read into memory, and therefore is not expected to be unreasonably large.
The input stream will be fully read, but not closed.
- Parameters:
repositoryPath
- The JCR repository path where the binary was foundis
- the input stream for the binary- Throws:
IOException
- in case of I/O problems
-
getBinary
Returns a potential binary registered for a repository path- Parameters:
repositoryPath
- the path of the repository- Returns:
- an optional wrapping the binary data, possibly
empty
-
registerPrefixMapping
Registers a prefix mapping for a specified uri- Parameters:
prefix
- the prefixuri
- the uri
-
dump
Dumps a compact representation of the dataUseful for debugging purposes only
- Parameters:
out
- the PrintStream to use
-