public class RepositoryImpl extends AbstractRepository implements Repository, org.apache.jackrabbit.api.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_SUPPORTED
IDENTIFIER_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() |
Value |
getDescriptorValue(String key) |
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 . |
Session |
login(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,
Value value) |
protected void |
setDescriptor(String desc,
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, login
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isStandardDescriptor, login, login, login
public 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 RepositoryException
repConfig
- the repository configuration.RepositoryException
- if there is already another repository
instance running on the given configuration
or another error occurs.protected NamespaceRegistryImpl createNamespaceRegistry() throws RepositoryException
RepositoryException
- if the namespace registry can not be createdprotected NodeTypeRegistry createNodeTypeRegistry() throws RepositoryException
RepositoryException
- if the node type registry can not be createdpublic CacheManager getCacheManager()
protected InternalVersionManagerImpl createVersionManager(VersioningConfig vConfig, DelegatingObservationDispatcher delegatingDispatcher) throws RepositoryException
vConfig
- the versioning configRepositoryException
- if an error occursprotected void initStartupWorkspaces() throws RepositoryException
RepositoryException
- if an error occurspublic static RepositoryImpl create(RepositoryConfig config) throws RepositoryException
RepositoryImpl
instance.
config
- the configuration of the repositoryRepositoryImpl
instanceRepositoryException
- If an error occursprotected void sanityCheck() throws RepositoryException
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 RepositoryException
null
if none is
configured.RepositoryException
protected ClusterNode createClusterNode() throws RepositoryException
RepositoryException
protected String[] getWorkspaceNames()
Workspace.getAccessibleWorkspaceNames()
protected RepositoryImpl.WorkspaceInfo getWorkspaceInfo(String workspaceName) throws NoSuchWorkspaceException, 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
.NoSuchWorkspaceException
- If the named workspace does not exist.RepositoryException
- If this repository has been shut down.protected void createWorkspace(String workspaceName) throws RepositoryException
workspaceName
- name of the new workspaceRepositoryException
- if a workspace with the given name
already exists or if another error occursWorkspaceImpl.createWorkspace(String)
public void externalWorkspaceCreated(String workspaceName, InputSource configTemplate) throws RepositoryException
WorkspaceListener
externalWorkspaceCreated
in interface WorkspaceListener
RepositoryException
protected void createWorkspace(String workspaceName, InputSource configTemplate) throws RepositoryException
workspaceName
- name of the new workspaceconfigTemplate
- the workspace configuration template of the new
workspaceRepositoryException
- 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 RepositoryException
workspace
- name of the workspaceenabled
- true
to enable integrity checking (default),
false
to disable itRepositoryException
- if an error occursprotected final SessionImpl createSession(AuthContext loginContext, String workspaceName) throws NoSuchWorkspaceException, AccessDeniedException, RepositoryException
Calls createSessionInstance(AuthContext, WorkspaceConfig)
to
create the actual SessionImpl
instance.
loginContext
- login context with authenticated subjectworkspaceName
- workspace nameNoSuchWorkspaceException
- if the specified workspace does not existAccessDeniedException
- if the subject of the given login context
is not granted access to the specified
workspaceRepositoryException
- if another error occursprotected final SessionImpl createSession(Subject subject, String workspaceName) throws NoSuchWorkspaceException, AccessDeniedException, RepositoryException
Calls createSessionInstance(Subject, WorkspaceConfig)
to
create the actual SessionImpl
instance.
subject
- authenticated subjectworkspaceName
- workspace nameNoSuchWorkspaceException
- if the specified workspace does not existAccessDeniedException
- if the subject of the given login context
is not granted access to the specified
workspaceRepositoryException
- if another error occursprotected void onSessionCreated(SessionImpl session)
session
- the session to registerpublic void shutdown()
shutdown
in interface org.apache.jackrabbit.api.JackrabbitRepository
protected void doShutdown()
shutdown()
method.public RepositoryConfig getConfig()
protected void initRepositoryDescriptors() throws RepositoryException
getCustomRepositoryDescriptors()
is called
afterwards in order to add custom/overwrite standard repository descriptors.RepositoryException
protected Properties getCustomRepositoryDescriptors() throws 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.
RepositoryException
- if the properties can not be loadedprotected 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 RepositoryException
Note that you should use the RepositoryManager
interface
to access this functionality. This RepositoryImpl method may be
removed in future Jackrabbit versions.
RepositoryException
public Session login(Credentials credentials, String workspaceName) throws LoginException, NoSuchWorkspaceException, RepositoryException
login
in interface Repository
LoginException
NoSuchWorkspaceException
RepositoryException
public String getDescriptor(String key)
getDescriptor
in interface Repository
public String[] getDescriptorKeys()
getDescriptorKeys
in interface Repository
public Value getDescriptorValue(String key)
getDescriptorValue
in interface Repository
public Value[] getDescriptorValues(String key)
getDescriptorValues
in interface Repository
public boolean isSingleValueDescriptor(String key)
isSingleValueDescriptor
in interface Repository
public 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 SessionListener
session
- the Session
that is about to be 'closed'public void loggedOut(SessionImpl session)
Session
has been 'closed' by
calling Session.logout()
.loggedOut
in interface SessionListener
session
- the Session
that has been 'closed'protected SessionImpl createSessionInstance(AuthContext loginContext, WorkspaceConfig wspConfig) throws AccessDeniedException, RepositoryException
SessionImpl
class representing a
user authenticated by the loginContext
instance attached
to the workspace configured by the wspConfig
.AccessDeniedException
- if the subject of the given login context
is not granted access to the specified
workspaceRepositoryException
- If any other error occurs creating the
session.protected SessionImpl createSessionInstance(Subject subject, WorkspaceConfig wspConfig) throws AccessDeniedException, RepositoryException
SessionImpl
class representing a
user represented by the subject
instance attached
to the workspace configured by the wspConfig
.AccessDeniedException
- if the subject of the given login context
is not granted access to the specified
workspaceRepositoryException
- 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–2024 The Apache Software Foundation. All rights reserved.