public class Oak extends Object
ContentRepository
instances with
a set of specified plugin components. This class acts as a public facade
that hides the internal implementation classes and the details of how
they get instantiated and wired together.Modifier and Type | Class and Description |
---|---|
static class |
Oak.OakDefaultComponents |
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_WORKSPACE_NAME
Constant for the default workspace name
|
Constructor and Description |
---|
Oak() |
Oak(org.apache.jackrabbit.oak.spi.state.NodeStore store) |
Modifier and Type | Method and Description |
---|---|
org.apache.jackrabbit.oak.api.ContentRepository |
createContentRepository()
Returns the content repository instance created with the given
configuration.
|
org.apache.jackrabbit.oak.api.ContentSession |
createContentSession()
Creates a content repository with the given configuration
and logs in to the default workspace with no credentials,
returning the resulting content session.
|
org.apache.jackrabbit.oak.api.Root |
createRoot()
Creates a content repository with the given configuration
and returns a
Root instance after logging in to the
default workspace with no credentials. |
static ExecutorService |
defaultExecutorService()
Default
ExecutorService used for scheduling concurrent tasks. |
static ScheduledExecutorService |
defaultScheduledExecutor()
Default
ScheduledExecutorService used for scheduling background tasks. |
org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard |
getWhiteboard() |
Oak |
with(org.apache.jackrabbit.oak.spi.state.Clusterable c)
Define the current repository as being a
Clusterable one. |
Oak |
with(org.apache.jackrabbit.oak.spi.commit.CommitHook hook)
Associates the given commit hook with the repository to be created.
|
Oak |
with(org.apache.jackrabbit.oak.spi.commit.ConflictHandler conflictHandler)
Deprecated.
Use
with(ThreeWayConflictHandler) instead |
Oak |
with(org.apache.jackrabbit.oak.spi.commit.Editor editor)
Associates the given editor with the repository to be created.
|
Oak |
with(org.apache.jackrabbit.oak.spi.commit.EditorProvider provider)
Associates the given editor provider with the repository to be created.
|
Oak |
with(Executor executor) |
Oak |
with(IndexEditorProvider provider)
Associates the given index hook provider with the repository to
be created.
|
Oak |
with(MBeanServer mbeanServer) |
Oak |
with(org.apache.jackrabbit.oak.spi.commit.Observer observer) |
Oak |
with(org.apache.jackrabbit.oak.spi.query.QueryIndexProvider provider)
Associates the given query index provider with the repository to
be created.
|
Oak |
with(org.apache.jackrabbit.oak.spi.query.QueryLimits settings) |
Oak |
with(org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer initializer) |
Oak |
with(ScheduledExecutorService scheduledExecutor) |
Oak |
with(org.apache.jackrabbit.oak.spi.security.SecurityProvider securityProvider) |
Oak |
with(String defaultWorkspaceName)
Sets the default workspace name that should be used in case of login
with
null workspace name. |
Oak |
with(org.apache.jackrabbit.oak.spi.commit.ThreeWayConflictHandler conflictHandler) |
Oak |
with(org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard whiteboard) |
Oak |
withAsyncIndexing()
Deprecated.
Use
withAsyncIndexing(String, long) instead |
Oak |
withAsyncIndexing(String name,
long delayInSeconds)
Enable the asynchronous (background) indexing behavior for the provided
task name.
|
Oak |
withAtomicCounter() |
Oak |
withFailOnMissingIndexProvider() |
public static final String DEFAULT_WORKSPACE_NAME
public Oak(org.apache.jackrabbit.oak.spi.state.NodeStore store)
public Oak()
public static ScheduledExecutorService defaultScheduledExecutor()
ScheduledExecutorService
used for scheduling background tasks.
This default spawns up to 32 background thread on an as need basis. Idle
threads are pruned after one minute.public static ExecutorService defaultExecutorService()
ExecutorService
used for scheduling concurrent tasks.
This default spawns as many threads as required with a priority of
Thread.MIN_PRIORITY
. Idle threads are pruned after one minute.@Nonnull public Oak with(@Nonnull org.apache.jackrabbit.oak.spi.state.Clusterable c)
Clusterable
one.c
- @Nonnull public Oak with(@Nonnull String defaultWorkspaceName)
null
workspace name. If this method has not been called
some internal default value will be used.defaultWorkspaceName
- The name of the default workspace.@Nonnull public Oak with(@Nonnull org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer initializer)
@Nonnull public Oak with(@Nonnull org.apache.jackrabbit.oak.spi.query.QueryLimits settings)
@Nonnull public Oak with(@Nonnull org.apache.jackrabbit.oak.spi.query.QueryIndexProvider provider)
provider
- query index provider@Nonnull public Oak with(@Nonnull IndexEditorProvider provider)
provider
- index hook provider@Nonnull public Oak with(@Nonnull org.apache.jackrabbit.oak.spi.commit.CommitHook hook)
hook
- commit hook@Nonnull public Oak with(@Nonnull org.apache.jackrabbit.oak.spi.commit.EditorProvider provider)
provider
- editor provider@Nonnull public Oak with(@Nonnull org.apache.jackrabbit.oak.spi.commit.Editor editor)
editor
- editor@Nonnull public Oak with(@Nonnull org.apache.jackrabbit.oak.spi.security.SecurityProvider securityProvider)
@Deprecated @Nonnull public Oak with(@Nonnull org.apache.jackrabbit.oak.spi.commit.ConflictHandler conflictHandler)
with(ThreeWayConflictHandler)
insteadconflictHandler
- conflict handler@Nonnull public Oak with(@Nonnull org.apache.jackrabbit.oak.spi.commit.ThreeWayConflictHandler conflictHandler)
@Nonnull public Oak with(@Nonnull ScheduledExecutorService scheduledExecutor)
@Nonnull public Oak with(@Nonnull MBeanServer mbeanServer)
@Nonnull public Oak with(@Nonnull org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard whiteboard)
@Nonnull public Oak with(@Nonnull org.apache.jackrabbit.oak.spi.commit.Observer observer)
@Deprecated public Oak withAsyncIndexing()
withAsyncIndexing(String, long)
insteadEnable the asynchronous (background) indexing behavior.
Please note that when enabling the background indexer, you need to take
care of calling
#shutdown
on the executor
provided for this Oak instance.
public Oak withFailOnMissingIndexProvider()
public Oak withAtomicCounter()
public Oak withAsyncIndexing(@Nonnull String name, long delayInSeconds)
Enable the asynchronous (background) indexing behavior for the provided task name.
Please note that when enabling the background indexer, you need to take
care of calling
#shutdown
on the executor
provided for this Oak instance.
@Nonnull public org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard getWhiteboard()
public org.apache.jackrabbit.oak.api.ContentRepository createContentRepository()
public org.apache.jackrabbit.oak.api.ContentSession createContentSession()
This method exists mostly as a convenience for one-off tests, as there's no way to create other sessions for accessing the same repository.
There is typically no need to explicitly close the returned session unless the repository has explicitly been configured to reserve some resources until all sessions have been closed. The repository will be garbage collected once the session is no longer used.
public org.apache.jackrabbit.oak.api.Root createRoot()
Root
instance after logging in to the
default workspace with no credentials.
This method exists mostly as a convenience for one-off tests, as the returned root is the only way to access the session or the repository.
Note that since there is no way to close the underlying content session, this method should only be used when no components that require sessions to be closed have been configured. The repository and the session will be garbage collected once the root is no longer used.
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.