Package org.apache.jackrabbit.core
Class RepositoryContext
- java.lang.Object
-
- org.apache.jackrabbit.core.RepositoryContext
-
public class RepositoryContext extends Object
Internal component context of a Jackrabbit content repository. A repository context consists of the internal repository-level components and resources like the namespace and node type registries. Access to these resources is available only to objects with a reference to the context object.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RepositoryContext
create(RepositoryConfig config)
Starts a repository with the given configuration and returns the internal component context of the started repository.ClusterNode
getClusterNode()
Returns the cluster node instance of this repository, ornull
if clustering is not enabled.DataStore
getDataStore()
Returns the data store of this repository, ornull
if a data store is not configured.ScheduledExecutorService
getExecutor()
Returns the thread pool of this repository.FileSystem
getFileSystem()
Returns the repository file system.InternalVersionManagerImpl
getInternalVersionManager()
Returns the internal version manager of this repository.ItemStateCacheFactory
getItemStateCacheFactory()
Returns the item state cache factory of this repository.NamespaceRegistryImpl
getNamespaceRegistry()
Returns the namespace registry of this repository.NodeIdFactory
getNodeIdFactory()
NodeTypeRegistry
getNodeTypeRegistry()
Returns the namespace registry of this repository.PrivilegeRegistry
getPrivilegeRegistry()
Returns the privilege registry of this repository.RepositoryImpl
getRepository()
Returns the repository instance to which this context is associated.RepositoryConfig
getRepositoryConfig()
RepositoryStatisticsImpl
getRepositoryStatistics()
Returns the repository statistics collector.NodeId
getRootNodeId()
Returns the root node identifier of this repository.JackrabbitSecurityManager
getSecurityManager()
Returns the security manager of this repository.StatManager
getStatManager()
RepositoryImpl.WorkspaceInfo
getWorkspaceInfo(String workspaceName)
Returns theRepositoryImpl.WorkspaceInfo
for the named workspace.WorkspaceManager
getWorkspaceManager()
Returns the workspace manager of this repository.static RepositoryContext
install(File dir)
Starts a repository in the given directory and returns the internal component context of the started repository.boolean
isGcRunning()
void
setGcRunning(boolean gcRunning)
set gcRunnign statusvoid
setNodeIdFactory(NodeIdFactory nodeIdFactory)
-
-
-
Method Detail
-
create
public static RepositoryContext create(RepositoryConfig config) throws RepositoryException
Starts a repository with the given configuration and returns the internal component context of the started repository.- Parameters:
config
- repository configuration- Returns:
- component context of the repository
- Throws:
RepositoryException
- if the repository could not be started- Since:
- Apache Jackrabbit 2.3.1
-
install
public static RepositoryContext install(File dir) throws RepositoryException, IOException
Starts a repository in the given directory and returns the internal component context of the started repository. If needed, the directory is created and a default repository configuration is installed inside it.- Parameters:
dir
- repository directory- Returns:
- component context of the repository
- Throws:
RepositoryException
- if the repository could not be startedIOException
- if the directory could not be initialized- Since:
- Apache Jackrabbit 2.3.1
- See Also:
RepositoryConfig.install(File)
-
getRepositoryConfig
public RepositoryConfig getRepositoryConfig()
-
getRepository
public RepositoryImpl getRepository()
Returns the repository instance to which this context is associated.- Returns:
- repository instance
-
getExecutor
public ScheduledExecutorService getExecutor()
Returns the thread pool of this repository.- Returns:
- repository thread pool
-
getNamespaceRegistry
public NamespaceRegistryImpl getNamespaceRegistry()
Returns the namespace registry of this repository.- Returns:
- namespace registry
-
getNodeTypeRegistry
public NodeTypeRegistry getNodeTypeRegistry()
Returns the namespace registry of this repository.- Returns:
- node type registry
-
getPrivilegeRegistry
public PrivilegeRegistry getPrivilegeRegistry()
Returns the privilege registry of this repository.- Returns:
- the privilege registry of this repository.
-
getInternalVersionManager
public InternalVersionManagerImpl getInternalVersionManager()
Returns the internal version manager of this repository.- Returns:
- internal version manager
-
getRootNodeId
public NodeId getRootNodeId()
Returns the root node identifier of this repository.- Returns:
- root node identifier
-
getFileSystem
public FileSystem getFileSystem()
Returns the repository file system.- Returns:
- repository file system
-
getDataStore
public DataStore getDataStore()
Returns the data store of this repository, ornull
if a data store is not configured.- Returns:
- data store, or
null
-
getClusterNode
public ClusterNode getClusterNode()
Returns the cluster node instance of this repository, ornull
if clustering is not enabled.- Returns:
- cluster node
-
getWorkspaceManager
public WorkspaceManager getWorkspaceManager()
Returns the workspace manager of this repository.- Returns:
- workspace manager
-
getWorkspaceInfo
public RepositoryImpl.WorkspaceInfo getWorkspaceInfo(String workspaceName) throws NoSuchWorkspaceException, RepositoryException
Returns theRepositoryImpl.WorkspaceInfo
for the named workspace.- Parameters:
workspaceName
- The name of the workspace whoseRepositoryImpl.WorkspaceInfo
is to be returned. This must not benull
.- Returns:
- The
RepositoryImpl.WorkspaceInfo
for the named workspace. This will never benull
. - Throws:
NoSuchWorkspaceException
- If the named workspace does not exist.RepositoryException
- If this repository has been shut down.
-
getSecurityManager
public JackrabbitSecurityManager getSecurityManager()
Returns the security manager of this repository.- Returns:
- security manager
-
getItemStateCacheFactory
public ItemStateCacheFactory getItemStateCacheFactory()
Returns the item state cache factory of this repository.- Returns:
- item state cache factory
-
setNodeIdFactory
public void setNodeIdFactory(NodeIdFactory nodeIdFactory)
-
getNodeIdFactory
public NodeIdFactory getNodeIdFactory()
-
getRepositoryStatistics
public RepositoryStatisticsImpl getRepositoryStatistics()
Returns the repository statistics collector.- Returns:
- repository statistics collector
-
getStatManager
public StatManager getStatManager()
- Returns:
- the statistics manager object
-
isGcRunning
public boolean isGcRunning()
- Returns:
- gcRunning status
-
setGcRunning
public void setGcRunning(boolean gcRunning)
set gcRunnign status- Parameters:
gcRunning
-
-
-