Package db.buffers

# Interface ManagedBufferFile

All Superinterfaces:
  `BufferFile`

All Known Implementing Classes:
  `LocalManagedBufferFile`, `ManagedBufferFileAdapter`

public interface ManagedBufferFile extends BufferFile
`BufferFile` facilitates read/write access to buffer oriented file. Access to related resources, such as parameters and change data, is also facilitated.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `canSave()`
  Returns true if a save file is provided for creating a new version of this buffer file.
  `long`
  `getCheckinID()`
  Returns the checkin ID corresponding to this buffer file.
  `byte[]`
  `getForwardModMapData(int oldVersion)`
  Returns a bit map corresponding to all buffers modified since oldVersion.
  `BufferFile`
  `getNextChangeDataFile(boolean getFirst)`
  Get the next change data file which corresponds to this buffer file.
  `BufferFile`
  `getSaveChangeDataFile()`
  Returns a temporary change data buffer file which should be used to store a application-level ChangeSet associated with this new buffer file version.
  `ManagedBufferFile`
  `getSaveFile()`
  Returns a Save file if available.
  `void`
  `saveCompleted(boolean commit)`
  After getting the save file, this method must be invoked to terminate the save.
  `void`
  `setVersionComment(String comment)`
  Set the comment which will be associated with this buffer file if saved.

  ### Methods inherited from interface db.buffers.BufferFile

  `clearParameters, close, delete, dispose, get, getBufferSize, getFreeIndexes, getIndexCount, getParameter, getParameterNames, isReadOnly, put, setFreeIndexes, setParameter, setReadOnly`

- ## Method Details

  - ### getNextChangeDataFile

    BufferFile getNextChangeDataFile(boolean getFirst) throws 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:
      `IOException` - if an I/O error occurs

  - ### getSaveChangeDataFile

    BufferFile getSaveChangeDataFile() throws 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:
      `IOException` - if an I/O error occurs

  - ### getForwardModMapData

    byte[] getForwardModMapData(int oldVersion) throws 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:
      `IOException` - if an I/O error occurs

  - ### getSaveFile

    ManagedBufferFile getSaveFile() throws 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:
      `IOException` - if an I/O error occurs

  - ### saveCompleted

    void saveCompleted(boolean commit) throws 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:
      `IOException`

  - ### canSave

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

  - ### setVersionComment

    void setVersionComment(String comment) throws 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:
      `IOException` - if an I/O error occurs

  - ### getCheckinID

    long getCheckinID() throws 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:
      `IOException` - if an I/O error occurs