|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.commons.AbstractRepository
org.apache.jackrabbit.core.RepositoryImpl
public class RepositoryImpl
A RepositoryImpl
...
Nested Class Summary | |
---|---|
protected class |
RepositoryImpl.WorkspaceInfo
WorkspaceInfo holds the objects that are shared
among multiple per-session WorkspaceImpl instances
representing the same named workspace, i.e. |
Field Summary | |
---|---|
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 String |
STATS_NODE_COUNT_PROPERTY
|
static String |
STATS_PROP_COUNT_PROPERTY
|
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 |
Fields inherited from interface javax.jcr.Repository |
---|
LEVEL_1_SUPPORTED, LEVEL_2_SUPPORTED, OPTION_LOCKING_SUPPORTED, OPTION_OBSERVATION_SUPPORTED, OPTION_QUERY_SQL_SUPPORTED, OPTION_TRANSACTIONS_SUPPORTED, OPTION_VERSIONING_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 |
Constructor Summary | |
---|---|
protected |
RepositoryImpl(RepositoryConfig repConfig)
Protected constructor. |
Method Summary | |
---|---|
static RepositoryImpl |
create(RepositoryConfig config)
Creates a new RepositoryImpl instance. |
protected ClusterNode |
createClusterNode()
Creates the cluster node. |
protected SharedItemStateManager |
createItemStateManager(PersistenceManager persistMgr,
NodeId rootNodeId,
NodeTypeRegistry ntReg,
boolean usesReferences,
ItemStateCacheFactory cacheFactory,
ISMLocking locking)
Creates a SharedItemStateManager or derivative. |
protected NamespaceRegistryImpl |
createNamespaceRegistry(FileSystem fs)
Creates the NamespaceRegistry instance. |
protected NodeTypeRegistry |
createNodeTypeRegistry(javax.jcr.NamespaceRegistry nsReg,
FileSystem fs)
Creates the NodeTypeRegistry instance. |
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 VersionManagerImpl |
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 . |
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. |
ClusterNode |
getClusterNode()
Get the cluster node. |
RepositoryConfig |
getConfig()
Returns the configuration of this repository. |
DataStore |
getDataStore()
|
String |
getDescriptor(String key)
|
String[] |
getDescriptorKeys()
|
protected FileSystem |
getFileSystem()
Returns the repository file system. |
ItemStateCacheFactory |
getItemStateCacheFactory()
Get the item state cache factory of this repository. |
protected NamespaceRegistryImpl |
getNamespaceRegistry()
|
protected NodeTypeRegistry |
getNodeTypeRegistry()
|
protected NodeId |
getRootNodeId()
|
protected JackrabbitSecurityManager |
getSecurityManager()
Returns the SecurityManager
of this Repository |
protected VersionManager |
getVersionManager()
|
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 |
initStartupWorkspaces()
Initialize startup workspaces. |
protected Properties |
loadRepProps()
Loads the repository properties by executing the following steps: if the PROPERTIES_RESOURCE exists in the meta data store,
the properties are loaded from that resource.
setDefaultRepositoryProperties(Properties) is called
afterwards in order to initialize/update the repository properties
since some default properties might have changed and need updating.
finally storeRepProps(Properties) is called in order to
persist the newly generated properties.
|
protected NodeId |
loadRootNodeId(FileSystem fs)
Returns the root node uuid. |
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)
|
void |
onEvent(javax.jcr.observation.EventIterator events)
|
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 |
setDefaultRepositoryProperties(Properties props)
Sets the default properties of the repository. |
protected void |
setReferentialIntegrityChecking(String workspace,
boolean enabled)
Enables or disables referential integrity checking for given workspace. |
void |
shutdown()
Shuts down this repository. |
protected void |
storeRepProps(Properties props)
Stores the properties to a persistent resource in the meta filesytem. |
Methods inherited from class org.apache.jackrabbit.commons.AbstractRepository |
---|
login, login, login |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.jcr.Repository |
---|
login, login, login |
Field Detail |
---|
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 NODETYPES_NODE_ID
public static final String STATS_NODE_COUNT_PROPERTY
public static final String STATS_PROP_COUNT_PROPERTY
protected final RepositoryConfig repConfig
Constructor Detail |
---|
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.Method Detail |
---|
public DataStore getDataStore()
public CacheManager getCacheManager()
public ItemStateCacheFactory getItemStateCacheFactory()
public ClusterNode getClusterNode()
null
if this repository
is not running clustered.
protected JackrabbitSecurityManager getSecurityManager() throws javax.jcr.RepositoryException
SecurityManager
of this Repository
javax.jcr.RepositoryException
- if an error occurs.protected VersionManagerImpl createVersionManager(VersioningConfig vConfig, DelegatingObservationDispatcher delegatingDispatcher) throws javax.jcr.RepositoryException
vConfig
- the versioning config
javax.jcr.RepositoryException
- if an error occurrsprotected void initStartupWorkspaces() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if an error occursprotected NodeId loadRootNodeId(FileSystem fs) throws javax.jcr.RepositoryException
fs
-
javax.jcr.RepositoryException
protected NamespaceRegistryImpl createNamespaceRegistry(FileSystem fs) throws javax.jcr.RepositoryException
NamespaceRegistry
instance.
fs
-
javax.jcr.RepositoryException
protected NodeTypeRegistry createNodeTypeRegistry(javax.jcr.NamespaceRegistry nsReg, FileSystem fs) throws javax.jcr.RepositoryException
NodeTypeRegistry
instance.
fs
-
javax.jcr.RepositoryException
public static RepositoryImpl create(RepositoryConfig config) throws javax.jcr.RepositoryException
RepositoryImpl
instance.
config
- the configuration of the repository
RepositoryImpl
instance
javax.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 ClusterNode createClusterNode() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected NamespaceRegistryImpl getNamespaceRegistry()
protected NodeTypeRegistry getNodeTypeRegistry()
protected VersionManager getVersionManager()
protected NodeId getRootNodeId()
protected 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 workspace
javax.jcr.RepositoryException
- if a workspace with the given name
already exists or if another error occursSessionImpl.createWorkspace(String)
public void externalWorkspaceCreated(String workspaceName, InputSource configTemplate) throws javax.jcr.RepositoryException
WorkspaceListener
externalWorkspaceCreated
in interface WorkspaceListener
javax.jcr.RepositoryException
protected void createWorkspace(String workspaceName, InputSource configTemplate) throws javax.jcr.RepositoryException
workspaceName
- name of the new workspaceconfigTemplate
- the workspace configuration template of the new
workspace
javax.jcr.RepositoryException
- if a workspace with the given name already
exists or if another error occursSessionImpl.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 it
javax.jcr.RepositoryException
- if an error occurshttps://issues.apache.org/jira/browse/JCR-954
protected final SessionImpl createSession(AuthContext loginContext, String workspaceName) throws javax.jcr.NoSuchWorkspaceException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
createSessionInstance(AuthContext, WorkspaceConfig)
to
create the actual SessionImpl
instance.
loginContext
- login context with authenticated subjectworkspaceName
- workspace name
javax.jcr.NoSuchWorkspaceException
- if the specified workspace does not exist
javax.jcr.AccessDeniedException
- if the subject of the given login context
is not granted access to the specified
workspace
javax.jcr.RepositoryException
- if another error occursprotected final SessionImpl createSession(Subject subject, String workspaceName) throws javax.jcr.NoSuchWorkspaceException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
createSessionInstance(Subject, WorkspaceConfig)
to
create the actual SessionImpl
instance.
subject
- authenticated subjectworkspaceName
- workspace name
javax.jcr.NoSuchWorkspaceException
- if the specified workspace does not exist
javax.jcr.AccessDeniedException
- if the subject of the given login context
is not granted access to the specified
workspace
javax.jcr.RepositoryException
- if another error occursprotected void onSessionCreated(SessionImpl session)
session
- the session to registerpublic void shutdown()
shutdown
in interface JackrabbitRepository
public RepositoryConfig getConfig()
protected FileSystem getFileSystem()
protected void setDefaultRepositoryProperties(Properties props) throws javax.jcr.RepositoryException
Properties
from the
org/apache/jackrabbit/core/repository.properties
resource
found in the class path and (re)sets the statistics properties, if not
present.
props
- the properties object to load
javax.jcr.RepositoryException
- if the properties can not be loadedprotected Properties loadRepProps() throws javax.jcr.RepositoryException
PROPERTIES_RESOURCE
exists in the meta data store,
the properties are loaded from that resource.setDefaultRepositoryProperties(Properties)
is called
afterwards in order to initialize/update the repository properties
since some default properties might have changed and need updating.storeRepProps(Properties)
is called in order to
persist the newly generated properties.
javax.jcr.RepositoryException
protected void storeRepProps(Properties props) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected SharedItemStateManager createItemStateManager(PersistenceManager persistMgr, NodeId rootNodeId, NodeTypeRegistry ntReg, boolean usesReferences, ItemStateCacheFactory cacheFactory, ISMLocking locking) throws ItemStateException
SharedItemStateManager
or derivative.
persistMgr
- persistence managerrootNodeId
- root node idntReg
- node type registryusesReferences
- true
if the item state manager should use
node references to verify integrity of its reference properties;
false
otherwisecacheFactory
- cache factory
ItemStateException
- if an error occurspublic 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.Repository
javax.jcr.LoginException
javax.jcr.NoSuchWorkspaceException
javax.jcr.RepositoryException
public String getDescriptor(String key)
getDescriptor
in interface javax.jcr.Repository
public String[] getDescriptorKeys()
getDescriptorKeys
in interface javax.jcr.Repository
public void loggingOut(SessionImpl session)
Session
is about to be 'closed' by
calling Session.logout()
- Specified by:
loggingOut
in interface SessionListener
- Parameters:
session
- the Session
that is about to be 'closed'
public void loggedOut(SessionImpl session)
Session
has been 'closed' by
calling Session.logout()
- Specified by:
loggedOut
in interface SessionListener
- Parameters:
session
- the Session
that has been 'closed'
public void onEvent(javax.jcr.observation.EventIterator events)
onEvent
in interface javax.jcr.observation.EventListener
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
workspace
javax.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
workspace
javax.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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |