Package ghidra.framework.store

# Interface DatabaseItem

All Superinterfaces:
  `FolderItem`

All Known Implementing Classes:
  `LocalDatabaseItem`, `RemoteDatabaseItem`

public interface DatabaseItem extends FolderItem
`DatabaseItem` corresponds to a private or versioned database within a FileSystem. Methods are provided for opening the underlying database as a BufferFile.

- ## Field Summary

  ### Fields inherited from interface ghidra.framework.store.FolderItem

  `DATABASE_FILE_TYPE, DATAFILE_FILE_TYPE, DEFAULT_CHECKOUT_ID, LATEST_VERSION, LINK_FILE_TYPE, UNKNOWN_FILE_TYPE`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ManagedBufferFile`
  `open()`
  Open the current version of the stored database for non-update use.
  `ManagedBufferFile`
  `open(int version)`
  Open a specific version of the stored database for non-update use.
  `ManagedBufferFile`
  `open(int version, int minChangeDataVer)`
  Open a specific version of the stored database for non-update use.
  `ManagedBufferFile`
  `openForUpdate(long checkoutId)`
  Open the current version of the stored database for update use.

  ### Methods inherited from interface ghidra.framework.store.FolderItem

  `canRecover, checkout, clearCheckout, delete, getCheckout, getCheckoutId, getCheckouts, getCheckoutVersion, getContentType, getContentTypeVersion, getCurrentVersion, getFileID, getLocalCheckoutVersion, getName, getParentPath, getPathName, getVersions, hasCheckouts, isCheckedOut, isCheckedOutExclusive, isCheckinActive, isReadOnly, isVersioned, lastModified, length, output, refresh, resetFileID, setCheckout, setContentTypeVersion, setReadOnly, terminateCheckout, updateCheckoutVersion`

- ## Method Details

  - ### open

    ManagedBufferFile open(int version, int minChangeDataVer) throws IOException
    Open a specific version of the stored database for non-update use. Historical change data from minChangeDataVer through version is available. The returned BufferFile does not support the BufferMgr's Save operation.
    Parameters:
      `version` - database version
      `minChangeDataVer` - indicates the oldest change data version to be included in change set. A -1 indicates only the last change data buffer file is applicable.
    Returns:
      buffer file
    Throws:
      `FileInUseException` - thrown if unable to obtain the required database lock(s).
      `IOException` - thrown if IO error occurs.
    See Also:
      - `ManagedBufferFile.getNextChangeDataFile(boolean)`

  - ### open

    ManagedBufferFile open(int version) throws IOException
    Open a specific version of the stored database for non-update use. Change data will not be available. The returned BufferFile does not support the BufferMgr's Save operation.
    Parameters:
      `version` - database version
    Returns:
      buffer file
    Throws:
      `FileInUseException` - thrown if unable to obtain the required database lock(s).
      `IOException` - thrown if IO error occurs.

  - ### open

    ManagedBufferFile open() throws IOException
    Open the current version of the stored database for non-update use. Change data will not be available. The returned BufferFile does not support the BufferMgr's Save operation.
    Throws:
      `IOException` - thrown if IO error occurs.

  - ### openForUpdate

    ManagedBufferFile openForUpdate(long checkoutId) throws IOException
    Open the current version of the stored database for update use. The returned BufferFile supports the Save operation. If this item is on a shared file-system, this method initiates an item checkin. If a changeSet is specified, it will be filled with all change data since the check-out version. Change data will be read into the change set starting oldest to newest.
    Parameters:
      `checkoutId` - the associated checkoutId if this item is stored on a versioned file-system, otherwise DEFAULT_CHECKOUT_ID can be specified.
    Returns:
      buffer file
    Throws:
      `FileInUseException` - thrown if unable to obtain the required database lock(s).
      `IOException` - thrown if IO error occurs.