Class JcrRepositoryConnector


  • public class JcrRepositoryConnector
    extends Object
    A connector in charge to manage the connexions with the underlying JCR repository used by Silverpeas. For each opened connexion, a session is created and from which the content of the repository can be accessed.

    Number of thread that are able to use a session at a same time can be managed by setting a positive value to parameter 'jcr.connection.maxThread' of property file 'org.silverpeas.util .attachment.Attachment'.
    By default, there is no limitation.

    Author:
    mmoquillon
    • Method Detail

      • openBasicSession

        public static JcrSession openBasicSession​(String login,
                                                  String domainId,
                                                  String password)
                                           throws javax.jcr.RepositoryException
        Opens a connection with the underlying JCR repository by using a basic authentication in which is specified a pair of user identifier and password. This method of authentication must be used to authenticate a user that which to access directly the content of the JCR repository.
        Parameters:
        login - the login of the user that wants to access the content of the repository.
        domainId - the unique identifier of the domain to which the user belongs.
        password - the password associated with the login of the user.
        Returns:
        the session spawned by the authenticated connection.
        Throws:
        javax.jcr.RepositoryException - if an error occurs while opening the connection with the repository.
      • openSystemSession

        public static JcrSession openSystemSession()
                                            throws javax.jcr.RepositoryException
        Opens a system connection with the underlying JCR repository. This way of establishing a connection is reserved to the services in Silverpeas in charge to manage the content stored into the JCR repository.
        Returns:
        the session spawned by the system connection.
        Throws:
        javax.jcr.RepositoryException - if an error occurs while opening a system connection with the repository.
      • closeSession

        public static void closeSession​(javax.jcr.Session session)