|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jackrabbit.commons.AbstractRepository org.apache.jackrabbit.core.RepositoryImpl
public class RepositoryImpl
A RepositoryImpl
...
Nested Class Summary | |
---|---|
protected class |
RepositoryImpl.DescriptorValue
Represents a Repository Descriptor Value (either Value or Value[]) |
protected class |
RepositoryImpl.WorkspaceInfo
WorkspaceInfo holds the objects that are shared
among multiple per-session WorkspaceImpl instances
representing the same named workspace, i.e. the same physical
storage. |
Field Summary | |
---|---|
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
|
protected ScheduledExecutorService |
executor
Scheduled executor service. |
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 |
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. |
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 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 decriptors. |
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. |
Methods inherited from class org.apache.jackrabbit.commons.AbstractRepository |
---|
isStandardDescriptor, 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 |
---|
isStandardDescriptor, 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 ACTIVITIES_NODE_ID
public static final NodeId CONFIGURATIONS_NODE_ID
public static final NodeId NODETYPES_NODE_ID
protected final RepositoryContext context
protected final RepositoryConfig repConfig
protected final ScheduledExecutorService executor
Constructor Detail |
---|
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.Method Detail |
---|
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 config
RepositoryException
- 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 repository
RepositoryImpl
instance
RepositoryException
- 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 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 workspace
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 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
workspace
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 RepositoryException
workspace
- name of the workspaceenabled
- true
to enable integrity checking (default),
false
to disable it
RepositoryException
- if an error occursprotected final SessionImpl createSession(AuthContext loginContext, String workspaceName) throws NoSuchWorkspaceException, AccessDeniedException, RepositoryException
createSessionInstance(AuthContext, WorkspaceConfig)
to
create the actual SessionImpl
instance.
loginContext
- login context with authenticated subjectworkspaceName
- workspace name
NoSuchWorkspaceException
- if the specified workspace does not exist
AccessDeniedException
- if the subject of the given login context
is not granted access to the specified
workspace
RepositoryException
- if another error occursprotected final SessionImpl createSession(Subject subject, String workspaceName) throws NoSuchWorkspaceException, AccessDeniedException, RepositoryException
createSessionInstance(Subject, WorkspaceConfig)
to
create the actual SessionImpl
instance.
subject
- authenticated subjectworkspaceName
- workspace name
NoSuchWorkspaceException
- if the specified workspace does not exist
AccessDeniedException
- if the subject of the given login context
is not granted access to the specified
workspace
RepositoryException
- if another error occursprotected void onSessionCreated(SessionImpl session)
session
- the session to registerpublic void shutdown()
shutdown
in interface 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 decriptors.
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 void setDescriptor(String desc, String value)
protected void setDescriptor(String desc, Value value)
protected void setDescriptor(String desc, 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
otherwise
ItemStateException
- 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()
- 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'
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
workspace
RepositoryException
- 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
workspace
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 |