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 Details

  • Constructor Details

  • Method Details

    • contextualize

      public void contextualize(Context context) throws ContextException
      Specified by:
      contextualize in interface Contextualizable
      Throws:
      ContextException
    • getRepository

      public javax.jcr.Repository getRepository()
      Get the repository.
      Returns:
      the repository.
    • getCredentials

      public javax.jcr.Credentials getCredentials()
      Get the credentials.
      Returns:
      the credentials.
    • isJndi

      public boolean 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 register
      credentials - The credentials to connect
      jndi - True to connect using jndi
    • getSessions

      public Map<String,javax.jcr.Session> getSessions()
      Get the JCR session map.
      Returns:
      a Map of the JCR sessions, indexed by workspace name.
    • getSession

      public javax.jcr.Session getSession(String workspaceName) throws javax.jcr.RepositoryException
      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

      public void disconnect()
      Disconnect from the repository.