Class TransientRepository

    • Constructor Detail

      • TransientRepository

        public TransientRepository​(TransientRepository.RepositoryFactory factory,
                                   String home)
        Creates a transient repository proxy that will use the given repository factory to initialize the underlying repository instances.
        Parameters:
        factory - repository factory
        home - the path to the repository home directory.
      • TransientRepository

        public TransientRepository()
        Creates a transient repository proxy that will use the repository configuration file and home directory specified in system properties org.apache.jackrabbit.repository.conf and org.apache.jackrabbit.repository.home. If these properties are not found, then the default values "repository.xml" and "repository" are used.
      • TransientRepository

        public TransientRepository​(RepositoryConfig config)
        Creates a transient repository proxy that will use a copy of the given repository configuration to initialize the underlying repository instance.
        Parameters:
        config - repository configuration
      • TransientRepository

        public TransientRepository​(String config,
                                   String home)
        Creates a transient repository proxy that will use the given repository configuration file and home directory paths to initialize the underlying repository instances.
        Parameters:
        config - repository configuration file
        home - repository home directory
        See Also:
        TransientRepository(File, File)
      • TransientRepository

        public TransientRepository​(File dir)
        Creates a transient repository proxy based on the given repository home directory and the repository configuration file "repository.xml" contained in that directory.
        Parameters:
        dir - repository home directory
        Since:
        Apache Jackrabbit 1.6
      • TransientRepository

        public TransientRepository​(File xml,
                                   File dir)
        Creates a transient repository proxy that will use the given repository configuration file and home directory paths to initialize the underlying repository instances. The repository configuration file is reloaded whenever the repository is restarted, so it is safe to modify the configuration when all sessions have been closed.

        If the given repository configuration file does not exist, then a default configuration file is copied to the given location when the first session starts. Similarly, if the given repository home directory does not exist, it is automatically created when the first session starts. This is a convenience feature designed to reduce the need for manual configuration.

        Parameters:
        xml - repository configuration file
        dir - repository home directory
        Since:
        Apache Jackrabbit 1.6
    • Method Detail

      • getHomeDir

        public String getHomeDir()
        Returns:
        the path to the repository home directory.
      • getDescriptorKeys

        public String[] getDescriptorKeys()
        Returns the available descriptor keys. If the underlying repository is initialized, then the call is proxied to it, otherwise the static descriptor keys are returned.
        Specified by:
        getDescriptorKeys in interface Repository
        Returns:
        descriptor keys
      • getDescriptor

        public String getDescriptor​(String key)
        Returns the identified repository descriptor. If the underlying repository is initialized, then the call is proxied to it, otherwise the static descriptors are used.
        Specified by:
        getDescriptor in interface Repository
        Parameters:
        key - descriptor key
        Returns:
        descriptor value
        See Also:
        Repository.getDescriptor(String)
      • login

        public Session login​(Credentials credentials,
                             String workspaceName)
                      throws RepositoryException
        Logs in to the content repository. Initializes the underlying repository instance if needed. The opened session is added to the set of open sessions and a session listener is added to track when the session gets closed.
        Specified by:
        login in interface Repository
        Parameters:
        credentials - login credentials
        workspaceName - workspace name
        Returns:
        new session
        Throws:
        RepositoryException - if the session could not be created
        See Also:
        Repository.login(Credentials,String)
      • shutdown

        public void shutdown()
        Forces all active sessions to logout. Once the last session has logged out, the underlying repository instance will automatically be shut down.
        Specified by:
        shutdown in interface JackrabbitRepository
        See Also:
        Session.logout()
      • loggingOut

        public void loggingOut​(SessionImpl session)
        Ignored. Called when a Session is about to be 'closed' by calling Session.logout(). At this moment the session is still valid.
        Specified by:
        loggingOut in interface SessionListener
        Parameters:
        session - the Session that is about to be 'closed'