Class NotifyingRepositoryWrapper

    • Constructor Detail

      • NotifyingRepositoryWrapper

        public NotifyingRepositoryWrapper()
      • NotifyingRepositoryWrapper

        public NotifyingRepositoryWrapper​(Repository delegate)
      • NotifyingRepositoryWrapper

        public NotifyingRepositoryWrapper​(Repository delegate,
                                          boolean defaultReportDeltas)
    • Method Detail

      • getDefaultReportDeltas

        public boolean getDefaultReportDeltas()
      • setDefaultReportDeltas

        public void setDefaultReportDeltas​(boolean defaultReportDeltas)
      • getConnection

        public NotifyingRepositoryConnection getConnection()
                                                    throws RepositoryException
        Description copied from interface: Repository
        Opens a connection to this repository that can be used for querying and updating the contents of the repository. Created connections need to be closed to make sure that any resources they keep hold of are released. The best way to do this is to use a try-with-resources block, as follows:
         try (RepositoryConnection conn = repository.getConnection()) {
                // perform operations on the connection
         }
         

        Note that RepositoryConnection is not guaranteed to be thread-safe! The recommended pattern for repository access in a multi-threaded application is to share the Repository object between threads, but have each thread create and use its own RepositoryConnections.

        Specified by:
        getConnection in interface NotifyingRepository
        Specified by:
        getConnection in interface Repository
        Overrides:
        getConnection in class RepositoryWrapper
        Returns:
        A connection that allows operations on this repository.
        Throws:
        RepositoryException - If something went wrong during the creation of the Connection.
      • init

        public void init()
                  throws RepositoryException
        Description copied from interface: Repository
        Initializes this repository. A repository needs to be initialized before it can be used, however explicitly calling this method is not necessary: the repository will automatically initialize itself if an operation is executed on it that requires it to be initialized.
        Specified by:
        init in interface Repository
        Overrides:
        init in class RepositoryWrapper
        Throws:
        RepositoryException - If the initialization failed.
      • setDataDir

        public void setDataDir​(File dataDir)
        Description copied from interface: Repository
        Set the directory where data and logging for this repository is stored.
        Specified by:
        setDataDir in interface Repository
        Overrides:
        setDataDir in class RepositoryWrapper
        Parameters:
        dataDir - the directory where data for this repository is stored