Package org.ametys.plugins.repositoryapp
Class RepositoryProvider
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.plugins.repositoryapp.RepositoryProvider
- All Implemented Interfaces:
Component
,Contextualizable
,LogEnabled
Repository helper.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
contextualize
(Context context) void
Disconnect from the repository.javax.jcr.Credentials
Get the credentials.javax.jcr.Repository
Get the repository.javax.jcr.Session
getSession
(String workspaceName) Get a session on the given workspace.Get the JCR session map.boolean
isJndi()
Determines if the repository is obtained through JNDIvoid
registerRepository
(javax.jcr.Repository repository, javax.jcr.Credentials credentials, boolean jndi) Register a repository.Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
ROLE
The avalon role. -
SESSION_JCR_SESSIONS_KEY
The session map key.- See Also:
-
CONTEXT_REPOSITORY_KEY
The context repository key.- See Also:
-
CONTEXT_IS_JNDI_KEY
The JNDI variable key.- See Also:
-
-
Constructor Details
-
RepositoryProvider
public RepositoryProvider()
-
-
Method Details
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
getRepository
Get the repository.- Returns:
- the repository.
-
getCredentials
Get the credentials.- Returns:
- the credentials.
-
isJndi
Determines if the repository is obtained through JNDI- Returns:
- true if the repository is obtained through JNDI
-
registerRepository
public void registerRepository(javax.jcr.Repository repository, javax.jcr.Credentials credentials, boolean jndi) Register a repository.- Parameters:
repository
- The repository to registercredentials
- The credentials to connectjndi
- True to connect using jndi
-
getSessions
Get the JCR session map.- Returns:
- a Map of the JCR sessions, indexed by workspace name.
-
getSession
Get a session on the given workspace.- Parameters:
workspaceName
- the workspace name.- Returns:
- the JCR session.
- Throws:
javax.jcr.RepositoryException
- if an error occurred
-
disconnect
Disconnect from the repository.
-