Package ghidra.feature.vt.api.db
Class VTSessionDB
java.lang.Object
ghidra.framework.data.DomainObjectAdapter
ghidra.framework.data.DomainObjectAdapterDB
ghidra.feature.vt.api.db.VTSessionDB
- All Implemented Interfaces:
db.util.ErrorHandler
,VTSession
,ghidra.framework.model.DomainObject
-
Field Summary
Fields inherited from class ghidra.framework.data.DomainObjectAdapterDB
changeSet, dbh, NUM_UNDOS, options
Fields inherited from class ghidra.framework.data.DomainObjectAdapter
changed, changeSupportMap, DEFAULT_NAME, lock, metadata, name, temporary
Fields inherited from interface ghidra.framework.model.DomainObject
DO_DOMAIN_FILE_CHANGED, DO_OBJECT_CLOSED, DO_OBJECT_ERROR, DO_OBJECT_RENAMED, DO_OBJECT_RESTORED, DO_OBJECT_SAVED, DO_PROPERTY_CHANGED, undoLock
-
Constructor Summary
ConstructorDescriptionVTSessionDB
(String name, ghidra.program.model.listing.Program sourceProgram, ghidra.program.model.listing.Program destinationProgram, Object consumer) Construct a new VTSessionDB using specified source and desitination programs. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an Association hook that will be called whenever an association is accepted or cleared.protected void
clearCache
(boolean all) protected void
close()
createMatchSet
(VTProgramCorrelator correlator) Creates a new VTMatchSet that will contain all the matches discovered by some ProgramCorrletor algorithm run.createMatchTag
(String tagName) Creates a new match tag with the given name.static VTSessionDB
createVTSession
(String name, ghidra.program.model.listing.Program sourceProgram, ghidra.program.model.listing.Program destinationProgram, Object consumer) Deprecated, for removal: This API element is subject to removal in a future version.void
deleteMatchTag
(VTMatchTag tag) Deletes the given VTMatchTag from this session.void
endTransaction
(int transactionID, boolean commit) Returns the AssociationManager.ghidra.program.model.listing.Program
Returns the destination program associated with this VTSession.Returns the built-in VTMatchSet used to store implied VTMatches.Returns the built-in VTMatchSet used to store manually created VTMatches.getMatches
(VTAssociation association) Returns a list of all VTMatches for the given association.Returns a list of all VTMatchSets contained in this VTSessiongetMatchTag
(long key) Returns a set of all VTMatchTags in this session.getName()
Returns the name of this VTSessionghidra.program.model.listing.Program
Returns the source program associated with this VTSession.boolean
void
void
Removes the given Association hook.void
save()
Saves this VTSession.void
setChanged
(VTEvent eventType, Object oldValue, Object newValue) Mark the state of a Version Tracking item as having changed and generate the event of the specified type.protected void
setDomainFile
(ghidra.framework.model.DomainFile df) void
setObjectChanged
(VTEvent eventType, Object affected, Object oldValue, Object newValue) Mark the state of a Version Tracking item as having changed and generate the event of the specified type.toString()
void
updateDestinationProgram
(ghidra.program.model.listing.Program newProgram) void
updateSourceProgram
(ghidra.program.model.listing.Program newProgram) Methods inherited from class ghidra.framework.data.DomainObjectAdapterDB
addSynchronizedDomainObject, addTransactionListener, canLock, canRedo, canSave, canUndo, clearUndo, clearUndo, dbError, domainObjectRestored, flushWriteCache, forceLock, getAllRedoNames, getAllUndoNames, getChangeSet, getCurrentTransactionInfo, getDBHandle, getOptions, getOptionsNames, getRedoName, getSynchronizedDomainObjects, getUndoName, getUndoStackDepth, getUserData, hasTerminatedTransaction, invalidate, invalidateWriteCache, isChanged, isClosed, isLocked, loadMetadata, lock, openTransaction, performPropertyListAlterations, propertyChanged, redo, releaseSynchronizedDomainObject, removeTransactionListener, save, saveMetadata, saveToPackedFile, setChanged, setImmutable, startTransaction, startTransaction, undo, unlock, updateMetadata
Methods inherited from class ghidra.framework.data.DomainObjectAdapter
addCloseListener, addConsumer, addDomainFileListener, addListener, checkExclusiveAccess, createPrivateEventQueue, fatalErrorOccurred, fireEvent, flushEvents, flushPrivateEventQueue, getAssociatedUserFilesystem, getChangeStatus, getConsumerList, getContentHandler, getContentHandler, getContentHandler, getContentHandlers, getDomainFile, getLock, getMetadata, getModificationNumber, hasExclusiveAccess, isSendingEvents, isTemporary, isUsedBy, removeCloseListener, removeDomainFileListener, removeListener, removePrivateEventQueue, setEventsEnabled, setName, setTemporary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ghidra.framework.model.DomainObject
addCloseListener, addConsumer, addDomainFileListener, addSynchronizedDomainObject, addTransactionListener, canLock, canRedo, canSave, canUndo, clearUndo, createPrivateEventQueue, flushEvents, flushPrivateEventQueue, forceLock, getAllRedoNames, getAllUndoNames, getConsumerList, getCurrentTransactionInfo, getDomainFile, getMetadata, getModificationNumber, getOptions, getOptionsNames, getRedoName, getSynchronizedDomainObjects, getUndoName, hasExclusiveAccess, hasTerminatedTransaction, isChanged, isClosed, isLocked, isSendingEvents, isTemporary, isUsedBy, lock, openTransaction, redo, releaseSynchronizedDomainObject, removeCloseListener, removeDomainFileListener, removePrivateEventQueue, removeTransactionListener, save, saveToPackedFile, setEventsEnabled, setName, setTemporary, startTransaction, startTransaction, undo, unlock, withTransaction, withTransaction
Methods inherited from interface db.util.ErrorHandler
dbError
Methods inherited from interface ghidra.feature.vt.api.main.VTSession
addListener, removeListener
-
Constructor Details
-
VTSessionDB
public VTSessionDB(String name, ghidra.program.model.listing.Program sourceProgram, ghidra.program.model.listing.Program destinationProgram, Object consumer) throws IOException Construct a new VTSessionDB using specified source and desitination programs.- Parameters:
name
- name to be assigned to the resulting domain object filesourceProgram
- session source program within active projectdestinationProgram
- session destination program open for update within active projectconsumer
- object consumer resposible for the proper release of the returned instance.- Throws:
IOException
- if an IO error occurs
-
-
Method Details
-
createVTSession
@Deprecated(since="11.1", forRemoval=true) public static VTSessionDB createVTSession(String name, ghidra.program.model.listing.Program sourceProgram, ghidra.program.model.listing.Program destinationProgram, Object consumer) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.VTSessionDB(String, Program, Program, Object)
should be used insteadFactory method which constructs a new VTSessionDB using specified source and desitination programs.- Parameters:
name
- name to be assigned to the resulting domain object filesourceProgram
- session source program within active projectdestinationProgram
- session destination program open for update within active projectconsumer
- object consumer resposible for the proper release of the returned instance.- Returns:
- new
VTSessionDB
object - Throws:
IOException
- if an IO error occurs
-
setDomainFile
protected void setDomainFile(ghidra.framework.model.DomainFile df) throws ghidra.framework.model.DomainObjectException - Overrides:
setDomainFile
in classghidra.framework.data.DomainObjectAdapter
- Throws:
ghidra.framework.model.DomainObjectException
-
getSourceProgramID
-
getDestinationProgramID
-
updateDestinationProgram
public void updateDestinationProgram(ghidra.program.model.listing.Program newProgram) - Specified by:
updateDestinationProgram
in interfaceVTSession
-
updateSourceProgram
public void updateSourceProgram(ghidra.program.model.listing.Program newProgram) - Specified by:
updateSourceProgram
in interfaceVTSession
-
release
- Specified by:
release
in interfaceghidra.framework.model.DomainObject
- Overrides:
release
in classghidra.framework.data.DomainObjectAdapter
-
clearCache
protected void clearCache(boolean all) - Overrides:
clearCache
in classghidra.framework.data.DomainObjectAdapterDB
-
save
Description copied from interface:VTSession
Saves this VTSession.- Specified by:
save
in interfaceVTSession
- Throws:
IOException
- if there is an exception saving
-
getSourceProgram
public ghidra.program.model.listing.Program getSourceProgram()Description copied from interface:VTSession
Returns the source program associated with this VTSession.- Specified by:
getSourceProgram
in interfaceVTSession
- Returns:
- the source program associated with this VTSession.
-
getDestinationProgram
public ghidra.program.model.listing.Program getDestinationProgram()Description copied from interface:VTSession
Returns the destination program associated with this VTSession.- Specified by:
getDestinationProgram
in interfaceVTSession
- Returns:
- the destination program associated with this VTSession.
-
createMatchSet
Description copied from interface:VTSession
Creates a new VTMatchSet that will contain all the matches discovered by some ProgramCorrletor algorithm run.- Specified by:
createMatchSet
in interfaceVTSession
- Parameters:
correlator
- the VTProgramCorrelator used to generate this set of matches that will be added to this VTMatchSet.- Returns:
- A new VTMatchSet that can be used to store VTMatch objects.
-
getMatchSets
Description copied from interface:VTSession
Returns a list of all VTMatchSets contained in this VTSession- Specified by:
getMatchSets
in interfaceVTSession
- Returns:
- a list of all VTMatchSets contained in this VTSession
-
getAssociationManager
Description copied from interface:VTSession
Returns the AssociationManager.- Specified by:
getAssociationManager
in interfaceVTSession
- Returns:
- the AssociationManager.
-
getAssociationManagerDBM
-
getName
Description copied from interface:VTSession
Returns the name of this VTSession -
getDescription
- Specified by:
getDescription
in interfaceghidra.framework.model.DomainObject
- Specified by:
getDescription
in classghidra.framework.data.DomainObjectAdapter
-
isChangeable
public boolean isChangeable()- Specified by:
isChangeable
in interfaceghidra.framework.model.DomainObject
-
toString
- Overrides:
toString
in classghidra.framework.data.DomainObjectAdapter
-
setChanged
Mark the state of a Version Tracking item as having changed and generate the event of the specified type. Any or all parameters may be null.- Parameters:
eventType
- event typeoldValue
- original value or an Object that is related to the event.newValue
- new value or an Object that is related to the event.
-
getMatches
Description copied from interface:VTSession
Returns a list of all VTMatches for the given association.- Specified by:
getMatches
in interfaceVTSession
- Parameters:
association
- the VTAssociation for which to retrieve all VTMatches.- Returns:
- a list of all VTMatches for the given association.
-
setObjectChanged
Mark the state of a Version Tracking item as having changed and generate the event of the specified type. Any or all parameters may be null.- Parameters:
eventType
- event typeaffected
- the version tracking object that was affected by the change.oldValue
- original value or an Object that is related to the event.newValue
- new value or an Object that is related to the event.
-
getManualMatchSet
Description copied from interface:VTSession
Returns the built-in VTMatchSet used to store manually created VTMatches.- Specified by:
getManualMatchSet
in interfaceVTSession
- Returns:
- the built-in VTMatchSet used to store manually created VTMatches.
-
getImpliedMatchSet
Description copied from interface:VTSession
Returns the built-in VTMatchSet used to store implied VTMatches.- Specified by:
getImpliedMatchSet
in interfaceVTSession
- Returns:
- the built-in VTMatchSet used to store implied VTMatches.
-
deleteMatchTag
Description copied from interface:VTSession
Deletes the given VTMatchTag from this session.- Specified by:
deleteMatchTag
in interfaceVTSession
- Parameters:
tag
- the VTMatchTag to delete.
-
createMatchTag
Description copied from interface:VTSession
Creates a new match tag with the given name.- Specified by:
createMatchTag
in interfaceVTSession
- Parameters:
tagName
- the name of the new tag to create.- Returns:
- the new VTMatchTag object.
-
getMatchTags
Description copied from interface:VTSession
Returns a set of all VTMatchTags in this session.- Specified by:
getMatchTags
in interfaceVTSession
- Returns:
- a set of all VTMatchTags in this session.
-
getMatchTag
-
getOrCreateMatchTagDB
-
endTransaction
public void endTransaction(int transactionID, boolean commit) - Specified by:
endTransaction
in interfaceghidra.framework.model.DomainObject
- Overrides:
endTransaction
in classghidra.framework.data.DomainObjectAdapterDB
-
addAssociationHook
Description copied from interface:VTSession
Adds an Association hook that will be called whenever an association is accepted or cleared.- Specified by:
addAssociationHook
in interfaceVTSession
- Parameters:
hook
- the callback hook.
-
removeAssociationHook
Description copied from interface:VTSession
Removes the given Association hook.- Specified by:
removeAssociationHook
in interfaceVTSession
- Parameters:
hook
- the callback hook to remove.
-
close
protected void close()- Overrides:
close
in classghidra.framework.data.DomainObjectAdapterDB
-
VTSessionDB(String, Program, Program, Object)
should be used instead