Package db.buffers

Interface ManagedBufferFile

    • Method Detail

      • getNextChangeDataFile

        BufferFile getNextChangeDataFile​(boolean getFirst)
                                  throws java.io.IOException
        Get the next change data file which corresponds to this buffer file. This method acts like an iterator which each successive invocation returning the next available file. Null is returned when no more files are available. The invoker is responsible for closing each file returned. It is highly recommended that each file be closed prior to requesting the next file.
        Parameters:
        getFirst - causes the iterator to reset and return the first available file.
        Throws:
        java.io.IOException - if an I/O error occurs
      • getSaveChangeDataFile

        BufferFile getSaveChangeDataFile()
                                  throws java.io.IOException
        Returns a temporary change data buffer file which should be used to store a application-level ChangeSet associated with this new buffer file version. The getSaveFile method must be successfully invoked prior to invoking this method.
        Returns:
        change data file or null if one is not available.
        Throws:
        java.io.IOException - if an I/O error occurs
      • getForwardModMapData

        byte[] getForwardModMapData​(int oldVersion)
                             throws java.io.IOException
        Returns a bit map corresponding to all buffers modified since oldVersion. This identifies all buffers contained within the oldVersion which have been modified during any revision up until this file version. Buffers added since oldVersion are not identified NOTE: The bit mask may identify empty/free buffers within this file version.
        Parameters:
        oldVersion - indicates the older version of this file for which a change map will be returned. This method may only be invoked if this file is at version 2 or higher, has an associated BufferFileManager and the oldVersion related files still exist.
        Returns:
        ModMap buffer change map data
        Throws:
        java.io.IOException - if an I/O error occurs
      • getSaveFile

        ManagedBufferFile getSaveFile()
                               throws java.io.IOException
        Returns a Save file if available. Returns null if a save can not be performed. This method may block for an extended period of time if the pre-save process has not already completed. This method does not accept a monitor since a remote TaskMonitor does not yet exist.
        Throws:
        java.io.IOException - if an I/O error occurs
      • saveCompleted

        void saveCompleted​(boolean commit)
                    throws java.io.IOException
        After getting the save file, this method must be invoked to terminate the save.
        Parameters:
        commit - if true the save file will be reopened as read-only for update. If false, the save file will be deleted and the object will become invalid.
        Throws:
        java.io.IOException
      • canSave

        boolean canSave()
                 throws java.io.IOException
        Returns true if a save file is provided for creating a new version of this buffer file.
        Throws:
        java.io.IOException - if an I/O error occurs
        See Also:
        getSaveFile()
      • setVersionComment

        void setVersionComment​(java.lang.String comment)
                        throws java.io.IOException
        Set the comment which will be associated with this buffer file if saved. The comment must be set prior to invoking close or setReadOnly.
        Parameters:
        comment - comment text
        Throws:
        java.io.IOException - if an I/O error occurs
      • getCheckinID

        long getCheckinID()
                   throws java.io.IOException
        Returns the checkin ID corresponding to this buffer file. The returned value is only valid if this buffer file has an associated buffer file manager and is either being created (see isReadOnly) or is intended for update (see canSave).
        Throws:
        java.io.IOException - if an I/O error occurs