Interface ChangeNumberIndexDB

    • Method Detail

      • getLastGeneratedChangeNumber

        long getLastGeneratedChangeNumber()
        Returns the last generated change number.
        Returns:
        the last generated change number
      • addRecord

        long addRecord​(ChangeNumberIndexRecord record)
                throws ChangelogException
        Add an update to the list of messages that must be saved to this DB managed by this DB and return the changeNumber associated to this record.

        Note: this method disregards the changeNumber in the provided record.

        Parameters:
        record - The ChangeNumberIndexRecord to add to this DB.
        Returns:
        the change number associated to this record on adding to this DB
        Throws:
        ChangelogException - if a database problem occurs.
      • getCursorFrom

        DBCursor<ChangeNumberIndexRecord> getCursorFrom​(long startChangeNumber)
                                                 throws ChangelogException
        Generate a new DBCursor that allows to browse the db managed by this object and starting at the position defined by a given changeNumber.
        Parameters:
        startChangeNumber - The position where the iterator must start.
        Returns:
        a new DBCursor that allows to browse this DB managed by this object and starting at the position defined by a given changeNumber.
        Throws:
        ChangelogException - if a database problem occurs.
      • getReader

        Flowable<ChangeNumberIndexRecord> getReader​(String name,
                                                    long startChangeNumber)
        Returns a reader of the index database, starting at the position defined by the provided changeNumber, that completes when it reaches the most recent record.

        Intended use case is to perform a search against cn=changelog.

        Reading will start only when the returned Flowable has been subscribed to.

        Parameters:
        name - The name of the reader.
        startChangeNumber - The position where the reader must start. If the change number is not found, then a ChangelogException will be thrown
        Returns:
        a reader of the index database, that completes when it reaches the most recent record.
      • resetChangeNumberTo

        void resetChangeNumberTo​(long newFirstCN,
                                 Dn baseDN,
                                 CSN newFirstCSN)
                          throws ChangelogException
        Resets ChangeNumber index to the given number and CSN.
        Parameters:
        newFirstCN - the new change number to appear as first change in the external changelog
        baseDN - the new record for the first change
        newFirstCSN - the CSN of the new first change
        Throws:
        ChangelogException - if an error occurs during reset