org.modeshape.web.jcr

## Class RepositoryManager

- java.lang.Object
- - org.modeshape.web.jcr.RepositoryManager

-     @ThreadSafe
      public class RepositoryManager
      extends Object

  Manager for accessing JCR Repository instances. This manager uses the idiomatic way to find JCR Repository (and ModeShape Repositories) instances via the `ServiceLoader` and `RepositoriesContainer` mechanism.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Set<String>` | `getJcrRepositoryNames()` Returns a set with all the names of the available repositories.
    `static Repository` | `getRepository(String repositoryName)` Returns the `Repository` instance with the given name.
    `static Session` | `getSession(HttpServletRequest request, String repositoryName, String workspaceName)` Get a JCR Session for the named workspace in the named repository, using the supplied HTTP servlet request for authentication information.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getSession

          public static Session getSession(HttpServletRequest request,
                           String repositoryName,
                           String workspaceName)
                                    throws RepositoryException

      Get a JCR Session for the named workspace in the named repository, using the supplied HTTP servlet request for authentication information.
      Parameters:
        `request` - the servlet request; may not be null or unauthenticated
        `repositoryName` - the name of the repository in which the session is created
        `workspaceName` - the name of the workspace to which the session should be connected
      Returns:
        an active session with the given workspace in the named repository
      Throws:
        `RepositoryException` - if the named repository does not exist or there was a problem obtaining the named repository

    - #### getRepository

          public static Repository getRepository(String repositoryName)
                                          throws NoSuchRepositoryException

      Returns the `Repository` instance with the given name.
      Parameters:
        `repositoryName` - a `non-null` string
      Returns:
        a `Repository` instance, never `null`
      Throws:
        `NoSuchRepositoryException` - if no repository with the given name exists.

    - #### getJcrRepositoryNames

          public static Set<String> getJcrRepositoryNames()

      Returns a set with all the names of the available repositories.
      Returns:
        a set with the names, never `null`

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.