public class RepositoryImpl extends AbstractRepository implements javax.jcr.Repository, JackrabbitRepository, SessionListener, WorkspaceListener
RepositoryImpl ...| Modifier and Type | Class and Description |
|---|---|
protected static class |
RepositoryImpl.DescriptorValue
Represents a Repository Descriptor Value (either Value or Value[])
|
class |
RepositoryImpl.WorkspaceInfo
WorkspaceInfo holds the objects that are shared
among multiple per-session WorkspaceImpl instances
representing the same named workspace, i.e. |
| Modifier and Type | Field and Description |
|---|---|
static NodeId |
ACTIVITIES_NODE_ID
hardcoded id of the "/jcr:system/jcr:activities" node
|
static NodeId |
CONFIGURATIONS_NODE_ID
hardcoded id of the "/jcr:system/jcr:configurations" node
|
protected RepositoryContext |
context |
static String |
JACKRABBIT_CLUSTER_ID
Key to a
string descriptor. |
protected NodeIdFactory |
nodeIdFactory |
static NodeId |
NODETYPES_NODE_ID
hardcoded id of the "/jcr:system/jcr:nodeTypes" node
|
protected RepositoryConfig |
repConfig |
static NodeId |
ROOT_NODE_ID
hardcoded id of the repository root node
|
static NodeId |
SYSTEM_ROOT_NODE_ID
hardcoded id of the "/jcr:system" node
|
static NodeId |
VERSION_STORAGE_NODE_ID
hardcoded id of the "/jcr:system/jcr:versionStorage" node
|
OPTION_PRINCIPAL_MANAGEMENT_SUPPORTED, OPTION_PRIVILEGE_MANAGEMENT_SUPPORTED, OPTION_USER_MANAGEMENT_SUPPORTEDIDENTIFIER_STABILITY, IDENTIFIER_STABILITY_INDEFINITE_DURATION, IDENTIFIER_STABILITY_METHOD_DURATION, IDENTIFIER_STABILITY_SAVE_DURATION, IDENTIFIER_STABILITY_SESSION_DURATION, LEVEL_1_SUPPORTED, LEVEL_2_SUPPORTED, NODE_TYPE_MANAGEMENT_AUTOCREATED_DEFINITIONS_SUPPORTED, NODE_TYPE_MANAGEMENT_INHERITANCE, NODE_TYPE_MANAGEMENT_INHERITANCE_MINIMAL, NODE_TYPE_MANAGEMENT_INHERITANCE_MULTIPLE, NODE_TYPE_MANAGEMENT_INHERITANCE_SINGLE, NODE_TYPE_MANAGEMENT_MULTIPLE_BINARY_PROPERTIES_SUPPORTED, NODE_TYPE_MANAGEMENT_MULTIVALUED_PROPERTIES_SUPPORTED, NODE_TYPE_MANAGEMENT_ORDERABLE_CHILD_NODES_SUPPORTED, NODE_TYPE_MANAGEMENT_OVERRIDES_SUPPORTED, NODE_TYPE_MANAGEMENT_PRIMARY_ITEM_NAME_SUPPORTED, NODE_TYPE_MANAGEMENT_PROPERTY_TYPES, NODE_TYPE_MANAGEMENT_RESIDUAL_DEFINITIONS_SUPPORTED, NODE_TYPE_MANAGEMENT_SAME_NAME_SIBLINGS_SUPPORTED, NODE_TYPE_MANAGEMENT_UPDATE_IN_USE_SUPORTED, NODE_TYPE_MANAGEMENT_VALUE_CONSTRAINTS_SUPPORTED, OPTION_ACCESS_CONTROL_SUPPORTED, OPTION_ACTIVITIES_SUPPORTED, OPTION_BASELINES_SUPPORTED, OPTION_JOURNALED_OBSERVATION_SUPPORTED, OPTION_LIFECYCLE_SUPPORTED, OPTION_LOCKING_SUPPORTED, OPTION_NODE_AND_PROPERTY_WITH_SAME_NAME_SUPPORTED, OPTION_NODE_TYPE_MANAGEMENT_SUPPORTED, OPTION_OBSERVATION_SUPPORTED, OPTION_QUERY_SQL_SUPPORTED, OPTION_RETENTION_SUPPORTED, OPTION_SHAREABLE_NODES_SUPPORTED, OPTION_SIMPLE_VERSIONING_SUPPORTED, OPTION_TRANSACTIONS_SUPPORTED, OPTION_UNFILED_CONTENT_SUPPORTED, OPTION_UPDATE_MIXIN_NODE_TYPES_SUPPORTED, OPTION_UPDATE_PRIMARY_NODE_TYPE_SUPPORTED, OPTION_VERSIONING_SUPPORTED, OPTION_WORKSPACE_MANAGEMENT_SUPPORTED, OPTION_XML_EXPORT_SUPPORTED, OPTION_XML_IMPORT_SUPPORTED, QUERY_FULL_TEXT_SEARCH_SUPPORTED, QUERY_JOINS, QUERY_JOINS_INNER, QUERY_JOINS_INNER_OUTER, QUERY_JOINS_NONE, QUERY_LANGUAGES, QUERY_STORED_QUERIES_SUPPORTED, QUERY_XPATH_DOC_ORDER, QUERY_XPATH_POS_INDEX, REP_NAME_DESC, REP_VENDOR_DESC, REP_VENDOR_URL_DESC, REP_VERSION_DESC, SPEC_NAME_DESC, SPEC_VERSION_DESC, WRITE_SUPPORTED| Modifier | Constructor and Description |
|---|---|
protected |
RepositoryImpl(RepositoryConfig repConfig)
Protected constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static RepositoryImpl |
create(RepositoryConfig config)
Creates a new
RepositoryImpl instance. |
protected ClusterNode |
createClusterNode()
Creates the cluster node.
|
GarbageCollector |
createDataStoreGarbageCollector()
Creates a data store garbage collector for this repository.
|
protected SharedItemStateManager |
createItemStateManager(PersistenceManager persistMgr,
boolean usesReferences,
ISMLocking locking)
Creates a
SharedItemStateManager or derivative. |
protected NamespaceRegistryImpl |
createNamespaceRegistry()
Protected factory method for creating the namespace registry.
|
protected NodeTypeRegistry |
createNodeTypeRegistry()
Protected factory method for creating the node type registry.
|
protected SessionImpl |
createSession(AuthContext loginContext,
String workspaceName)
Creates a new repository session on the specified workspace for the
authenticated subject of the given login context and
adds it to the active sessions.
|
protected SessionImpl |
createSession(Subject subject,
String workspaceName)
Creates a new repository session on the specified workspace for the given
authenticated subject and adds it to the active
sessions.
|
protected SessionImpl |
createSessionInstance(AuthContext loginContext,
WorkspaceConfig wspConfig)
Creates an instance of the
SessionImpl class representing a
user authenticated by the loginContext instance attached
to the workspace configured by the wspConfig. |
protected SessionImpl |
createSessionInstance(Subject subject,
WorkspaceConfig wspConfig)
Creates an instance of the
SessionImpl class representing a
user represented by the subject instance attached
to the workspace configured by the wspConfig. |
protected InternalVersionManagerImpl |
createVersionManager(VersioningConfig vConfig,
DelegatingObservationDispatcher delegatingDispatcher)
Creates the version manager.
|
protected void |
createWorkspace(String workspaceName)
Creates a workspace with the given name.
|
protected void |
createWorkspace(String workspaceName,
InputSource configTemplate)
Creates a workspace with the given name and given workspace configuration
template.
|
protected RepositoryImpl.WorkspaceInfo |
createWorkspaceInfo(WorkspaceConfig wspConfig)
Creates a new
RepositoryImpl.WorkspaceInfo instance for
wspConfig. |
protected void |
doShutdown()
Protected method that performs the actual shutdown after the shutdown
lock has been acquired by the
shutdown() method. |
void |
externalWorkspaceCreated(String workspaceName,
InputSource configTemplate)
Workspace created on another cluster node.
|
CacheManager |
getCacheManager()
Get the cache manager of this repository, useful
for setting its memory parameters.
|
RepositoryConfig |
getConfig()
Returns the configuration of this repository.
|
protected Properties |
getCustomRepositoryDescriptors()
Returns a
Properties object containing custom repository
descriptors or null if none exist. |
String |
getDescriptor(String key) |
String[] |
getDescriptorKeys() |
javax.jcr.Value |
getDescriptorValue(String key) |
javax.jcr.Value[] |
getDescriptorValues(String key) |
protected SearchManager |
getSystemSearchManager(String wspName)
Returns the system search manager or
null if none is
configured. |
protected RepositoryImpl.WorkspaceInfo |
getWorkspaceInfo(String workspaceName)
Returns the
RepositoryImpl.WorkspaceInfo for the named workspace. |
protected String[] |
getWorkspaceNames()
Returns the names of all workspaces in this repository.
|
protected void |
initRepositoryDescriptors()
Initializes the repository descriptors by executing the following steps:
Sets standard descriptors
getCustomRepositoryDescriptors() is called
afterwards in order to add custom/overwrite standard repository descriptors.
|
protected void |
initStartupWorkspaces()
Initialize startup workspaces.
|
boolean |
isSingleValueDescriptor(String key) |
void |
loggedOut(SessionImpl session)
Called when a
Session has been 'closed' by
calling . |
void |
loggingOut(SessionImpl session)
Called when a
Session is about to be 'closed' by
calling . |
javax.jcr.Session |
login(javax.jcr.Credentials credentials,
String workspaceName) |
protected void |
onSessionCreated(SessionImpl session)
Adds the given session to the list of active sessions and registers this
repository as listener.
|
protected void |
sanityCheck()
Performs a sanity check on this repository instance.
|
protected void |
setDescriptor(String desc,
String value) |
protected void |
setDescriptor(String desc,
javax.jcr.Value value) |
protected void |
setDescriptor(String desc,
javax.jcr.Value[] values) |
protected void |
setReferentialIntegrityChecking(String workspace,
boolean enabled)
Enables or disables referential integrity checking for given workspace.
|
void |
shutdown()
Shuts down this repository.
|
isStandardDescriptor, login, login, login, loginclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitloginpublic static final NodeId ROOT_NODE_ID
public static final NodeId SYSTEM_ROOT_NODE_ID
public static final NodeId VERSION_STORAGE_NODE_ID
public static final NodeId ACTIVITIES_NODE_ID
public static final NodeId CONFIGURATIONS_NODE_ID
public static final NodeId NODETYPES_NODE_ID
public static final String JACKRABBIT_CLUSTER_ID
string descriptor. Returns the repository cluster id if
and only if clustering is enabled.protected final RepositoryContext context
protected final RepositoryConfig repConfig
protected NodeIdFactory nodeIdFactory
protected RepositoryImpl(RepositoryConfig repConfig) throws javax.jcr.RepositoryException
repConfig - the repository configuration.javax.jcr.RepositoryException - if there is already another repository
instance running on the given configuration
or another error occurs.protected NamespaceRegistryImpl createNamespaceRegistry() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException - if the namespace registry can not be createdprotected NodeTypeRegistry createNodeTypeRegistry() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException - if the node type registry can not be createdpublic CacheManager getCacheManager()
protected InternalVersionManagerImpl createVersionManager(VersioningConfig vConfig, DelegatingObservationDispatcher delegatingDispatcher) throws javax.jcr.RepositoryException
vConfig - the versioning configjavax.jcr.RepositoryException - if an error occursprotected void initStartupWorkspaces()
throws javax.jcr.RepositoryException
javax.jcr.RepositoryException - if an error occurspublic static RepositoryImpl create(RepositoryConfig config) throws javax.jcr.RepositoryException
RepositoryImpl instance.
config - the configuration of the repositoryRepositoryImpl instancejavax.jcr.RepositoryException - If an error occursprotected void sanityCheck()
throws javax.jcr.RepositoryException
javax.jcr.RepositoryException - if this repository has been rendered
invalid for some reason (e.g. if it has been shut down)protected SearchManager getSystemSearchManager(String wspName) throws javax.jcr.RepositoryException
null if none is
configured.javax.jcr.RepositoryExceptionprotected ClusterNode createClusterNode() throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected String[] getWorkspaceNames()
Workspace.getAccessibleWorkspaceNames()protected RepositoryImpl.WorkspaceInfo getWorkspaceInfo(String workspaceName) throws javax.jcr.NoSuchWorkspaceException, javax.jcr.RepositoryException
RepositoryImpl.WorkspaceInfo for the named workspace.workspaceName - The name of the workspace whose RepositoryImpl.WorkspaceInfo
is to be returned. This must not be null.RepositoryImpl.WorkspaceInfo for the named workspace. This will
never be null.javax.jcr.NoSuchWorkspaceException - If the named workspace does not exist.javax.jcr.RepositoryException - If this repository has been shut down.protected void createWorkspace(String workspaceName) throws javax.jcr.RepositoryException
workspaceName - name of the new workspacejavax.jcr.RepositoryException - if a workspace with the given name
already exists or if another error occursWorkspaceImpl.createWorkspace(String)public void externalWorkspaceCreated(String workspaceName, InputSource configTemplate) throws javax.jcr.RepositoryException
WorkspaceListenerexternalWorkspaceCreated in interface WorkspaceListenerjavax.jcr.RepositoryExceptionprotected void createWorkspace(String workspaceName, InputSource configTemplate) throws javax.jcr.RepositoryException
workspaceName - name of the new workspaceconfigTemplate - the workspace configuration template of the new
workspacejavax.jcr.RepositoryException - if a workspace with the given name already
exists or if another error occursWorkspaceImpl.createWorkspace(String,InputSource)protected void setReferentialIntegrityChecking(String workspace, boolean enabled) throws javax.jcr.RepositoryException
workspace - name of the workspaceenabled - true to enable integrity checking (default),
false to disable itjavax.jcr.RepositoryException - if an error occursprotected final SessionImpl createSession(AuthContext loginContext, String workspaceName) throws javax.jcr.NoSuchWorkspaceException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
Calls createSessionInstance(AuthContext, WorkspaceConfig) to
create the actual SessionImpl instance.
loginContext - login context with authenticated subjectworkspaceName - workspace namejavax.jcr.NoSuchWorkspaceException - if the specified workspace does not existjavax.jcr.AccessDeniedException - if the subject of the given login context
is not granted access to the specified
workspacejavax.jcr.RepositoryException - if another error occursprotected final SessionImpl createSession(Subject subject, String workspaceName) throws javax.jcr.NoSuchWorkspaceException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
Calls createSessionInstance(Subject, WorkspaceConfig) to
create the actual SessionImpl instance.
subject - authenticated subjectworkspaceName - workspace namejavax.jcr.NoSuchWorkspaceException - if the specified workspace does not existjavax.jcr.AccessDeniedException - if the subject of the given login context
is not granted access to the specified
workspacejavax.jcr.RepositoryException - if another error occursprotected void onSessionCreated(SessionImpl session)
session - the session to registerpublic void shutdown()
shutdown in interface JackrabbitRepositoryprotected void doShutdown()
shutdown() method.public RepositoryConfig getConfig()
protected void initRepositoryDescriptors()
throws javax.jcr.RepositoryException
getCustomRepositoryDescriptors() is called
afterwards in order to add custom/overwrite standard repository descriptors.javax.jcr.RepositoryExceptionprotected Properties getCustomRepositoryDescriptors() throws javax.jcr.RepositoryException
Properties object containing custom repository
descriptors or null if none exist.
Overridable to allow subclasses to add custom descriptors or to override standard descriptor values.
Note that the properties entries will be set as single-valued STRING
descriptor values.
This method tries to load the Properties from the
org/apache/jackrabbit/core/repository.properties resource
found in the class path.
javax.jcr.RepositoryException - if the properties can not be loadedprotected void setDescriptor(String desc, javax.jcr.Value value)
protected void setDescriptor(String desc, javax.jcr.Value[] values)
protected SharedItemStateManager createItemStateManager(PersistenceManager persistMgr, boolean usesReferences, ISMLocking locking) throws ItemStateException
SharedItemStateManager or derivative.persistMgr - persistence managerusesReferences - true if the item state manager should use
node references to verify integrity of its reference properties;
false otherwiseItemStateException - if an error occurspublic GarbageCollector createDataStoreGarbageCollector() throws javax.jcr.RepositoryException
Note that you should use the RepositoryManager interface
to access this functionality. This RepositoryImpl method may be
removed in future Jackrabbit versions.
javax.jcr.RepositoryExceptionpublic javax.jcr.Session login(javax.jcr.Credentials credentials,
String workspaceName)
throws javax.jcr.LoginException,
javax.jcr.NoSuchWorkspaceException,
javax.jcr.RepositoryException
login in interface javax.jcr.Repositoryjavax.jcr.LoginExceptionjavax.jcr.NoSuchWorkspaceExceptionjavax.jcr.RepositoryExceptionpublic String getDescriptor(String key)
getDescriptor in interface javax.jcr.Repositorypublic String[] getDescriptorKeys()
getDescriptorKeys in interface javax.jcr.Repositorypublic javax.jcr.Value getDescriptorValue(String key)
getDescriptorValue in interface javax.jcr.Repositorypublic javax.jcr.Value[] getDescriptorValues(String key)
getDescriptorValues in interface javax.jcr.Repositorypublic boolean isSingleValueDescriptor(String key)
isSingleValueDescriptor in interface javax.jcr.Repositorypublic void loggingOut(SessionImpl session)
Session is about to be 'closed' by
calling Session.logout(). At this
moment the session is still valid.loggingOut in interface SessionListenersession - the Session that is about to be 'closed'public void loggedOut(SessionImpl session)
Session has been 'closed' by
calling Session.logout().loggedOut in interface SessionListenersession - the Session that has been 'closed'protected SessionImpl createSessionInstance(AuthContext loginContext, WorkspaceConfig wspConfig) throws javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
SessionImpl class representing a
user authenticated by the loginContext instance attached
to the workspace configured by the wspConfig.javax.jcr.AccessDeniedException - if the subject of the given login context
is not granted access to the specified
workspacejavax.jcr.RepositoryException - If any other error occurs creating the
session.protected SessionImpl createSessionInstance(Subject subject, WorkspaceConfig wspConfig) throws javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
SessionImpl class representing a
user represented by the subject instance attached
to the workspace configured by the wspConfig.javax.jcr.AccessDeniedException - if the subject of the given login context
is not granted access to the specified
workspacejavax.jcr.RepositoryException - If any other error occurs creating the
session.protected RepositoryImpl.WorkspaceInfo createWorkspaceInfo(WorkspaceConfig wspConfig)
RepositoryImpl.WorkspaceInfo instance for
wspConfig.wspConfig - the workspace configuration.WorkspaceInfo instance.Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.