Package ghidra.framework.store.remote
Class RemoteDatabaseItem
- java.lang.Object
-
- ghidra.framework.store.remote.RemoteFolderItem
-
- ghidra.framework.store.remote.RemoteDatabaseItem
-
- All Implemented Interfaces:
DatabaseItem
,FolderItem
public class RemoteDatabaseItem extends RemoteFolderItem implements DatabaseItem
RemoteDatabaseItem
provides a FolderItem implementation for a remote database. This item wraps an underlying versioned database which corresponds to a repository item.
-
-
Field Summary
-
Fields inherited from class ghidra.framework.store.remote.RemoteFolderItem
contentType, itemName, parentPath, repository, version, versionTime
-
Fields inherited from interface ghidra.framework.store.FolderItem
DATABASE_FILE_TYPE, DATAFILE_FILE_TYPE, DEFAULT_CHECKOUT_ID, LATEST_VERSION, UNKNOWN_FILE_TYPE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canRecover()
Returns true if unsaved file changes can be recovered.boolean
hasCheckouts()
Returns true if this item is versioned and has one or more checkouts.boolean
isCheckinActive()
Returns true if this item is versioned and has a checkin in-progress.long
length()
Returns the length of this domain file.ManagedBufferFileAdapter
open()
Open the current version of the stored database for non-update use.ManagedBufferFileAdapter
open(int version)
Open a specific version of the stored database for non-update use.ManagedBufferFileAdapter
open(int version, int minChangeDataVer)
Open a specific version of the stored database for non-update use.ManagedBufferFileAdapter
openForUpdate(long checkoutId)
Open the current version of the stored database for update use.void
output(java.io.File outputFile, int version, TaskMonitor monitor)
Serialize (i.e., pack) this item into the specified outputFile.void
updateCheckoutVersion(long checkoutId, int checkoutVersion, java.lang.String user)
Update the checkout version associated with this versioned item.-
Methods inherited from class ghidra.framework.store.remote.RemoteFolderItem
checkout, clearCheckout, delete, getCheckout, getCheckoutId, getCheckouts, getCheckoutVersion, getContentType, getContentTypeVersion, getCurrentVersion, getFileID, getLocalCheckoutVersion, getName, getParentPath, getPathName, getVersions, isCheckedOut, isCheckedOutExclusive, isReadOnly, isVersioned, lastModified, refresh, resetFileID, setCheckout, setContentTypeVersion, setReadOnly, terminateCheckout
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ghidra.framework.store.FolderItem
checkout, clearCheckout, delete, getCheckout, getCheckoutId, getCheckouts, getCheckoutVersion, getContentType, getContentTypeVersion, getCurrentVersion, getFileID, getLocalCheckoutVersion, getName, getParentPath, getPathName, getVersions, isCheckedOut, isCheckedOutExclusive, isReadOnly, isVersioned, lastModified, refresh, resetFileID, setCheckout, setContentTypeVersion, setReadOnly, terminateCheckout
-
-
-
-
Method Detail
-
length
public long length() throws java.io.IOException
Description copied from interface:FolderItem
Returns the length of this domain file. This size is the minimum disk space used for storing this file, but does not account for additional storage space used to tracks changes, etc.- Specified by:
length
in interfaceFolderItem
- Returns:
- file length
- Throws:
java.io.IOException
- thrown if IO or access error occurs
-
canRecover
public boolean canRecover()
Description copied from interface:FolderItem
Returns true if unsaved file changes can be recovered.- Specified by:
canRecover
in interfaceFolderItem
-
open
public ManagedBufferFileAdapter open(int version, int minChangeDataVer) throws java.io.IOException
Description copied from interface:DatabaseItem
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.- Specified by:
open
in interfaceDatabaseItem
- Parameters:
version
- database versionminChangeDataVer
- 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).java.io.IOException
- thrown if IO error occurs.- See Also:
ManagedBufferFile.getNextChangeDataFile(boolean)
-
open
public ManagedBufferFileAdapter open(int version) throws java.io.IOException
Description copied from interface:DatabaseItem
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.- Specified by:
open
in interfaceDatabaseItem
- Parameters:
version
- database version- Returns:
- buffer file
- Throws:
FileInUseException
- thrown if unable to obtain the required database lock(s).java.io.IOException
- thrown if IO error occurs.
-
open
public ManagedBufferFileAdapter open() throws java.io.IOException
Description copied from interface:DatabaseItem
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.- Specified by:
open
in interfaceDatabaseItem
- Throws:
java.io.IOException
- thrown if IO error occurs.
-
openForUpdate
public ManagedBufferFileAdapter openForUpdate(long checkoutId) throws java.io.IOException
Description copied from interface:DatabaseItem
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.- Specified by:
openForUpdate
in interfaceDatabaseItem
- 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).java.io.IOException
- thrown if IO error occurs.
-
updateCheckoutVersion
public void updateCheckoutVersion(long checkoutId, int checkoutVersion, java.lang.String user) throws java.io.IOException
Description copied from interface:FolderItem
Update the checkout version associated with this versioned item.- Specified by:
updateCheckoutVersion
in interfaceFolderItem
- Parameters:
checkoutId
- id corresponding to an existing checkout- Throws:
java.io.IOException
- if an IO error occurs.
-
hasCheckouts
public boolean hasCheckouts() throws java.io.IOException
Description copied from interface:FolderItem
Returns true if this item is versioned and has one or more checkouts.- Specified by:
hasCheckouts
in interfaceFolderItem
- Throws:
java.io.IOException
- if an IO error occurs
-
isCheckinActive
public boolean isCheckinActive() throws java.io.IOException
Description copied from interface:FolderItem
Returns true if this item is versioned and has a checkin in-progress.- Specified by:
isCheckinActive
in interfaceFolderItem
- Throws:
java.io.IOException
- if an IO error occurs
-
output
public void output(java.io.File outputFile, int version, TaskMonitor monitor) throws java.io.IOException, CancelledException
Description copied from interface:FolderItem
Serialize (i.e., pack) this item into the specified outputFile.- Specified by:
output
in interfaceFolderItem
- Parameters:
outputFile
- packed output file to be createdversion
- if this item is versioned, specifies the version to be output, otherwise -1 should be specified.monitor
- progress monitor- Throws:
java.io.IOException
CancelledException
- if monitor cancels operation
-
-