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

public class VTSessionDB extends ghidra.framework.data.DomainObjectAdapterDB implements VTSession
  • 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

    Constructors
    Constructor
    Description
    VTSessionDB(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 Type
    Method
    Description
    void
    Adds an Association hook that will be called whenever an association is accepted or cleared.
    protected void
    clearCache(boolean all)
     
    protected void
     
    Creates a new VTMatchSet that will contain all the matches discovered by some ProgramCorrletor algorithm run.
    Creates a new match tag with the given name.
    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
    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.
    Returns a list of all VTMatches for the given association.
    Returns a list of all VTMatchSets contained in this VTSession
    getMatchTag(long key)
     
    Returns a set of all VTMatchTags in this session.
    Returns the name of this VTSession
     
    ghidra.program.model.listing.Program
    Returns the source program associated with this VTSession.
     
    boolean
     
    void
    release(Object consumer)
     
    void
    Removes the given Association hook.
    void
    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.
     
    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 file
      sourceProgram - session source program within active project
      destinationProgram - session destination program open for update within active project
      consumer - 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.
      Factory method which constructs a new VTSessionDB using specified source and desitination programs.
      Parameters:
      name - name to be assigned to the resulting domain object file
      sourceProgram - session source program within active project
      destinationProgram - session destination program open for update within active project
      consumer - 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 class ghidra.framework.data.DomainObjectAdapter
      Throws:
      ghidra.framework.model.DomainObjectException
    • getSourceProgramID

      public String getSourceProgramID()
    • getDestinationProgramID

      public String getDestinationProgramID()
    • updateDestinationProgram

      public void updateDestinationProgram(ghidra.program.model.listing.Program newProgram)
      Specified by:
      updateDestinationProgram in interface VTSession
    • updateSourceProgram

      public void updateSourceProgram(ghidra.program.model.listing.Program newProgram)
      Specified by:
      updateSourceProgram in interface VTSession
    • release

      public void release(Object consumer)
      Specified by:
      release in interface ghidra.framework.model.DomainObject
      Overrides:
      release in class ghidra.framework.data.DomainObjectAdapter
    • clearCache

      protected void clearCache(boolean all)
      Overrides:
      clearCache in class ghidra.framework.data.DomainObjectAdapterDB
    • save

      public void save() throws IOException
      Description copied from interface: VTSession
      Saves this VTSession.
      Specified by:
      save in interface VTSession
      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 interface VTSession
      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 interface VTSession
      Returns:
      the destination program associated with this VTSession.
    • createMatchSet

      public VTMatchSet createMatchSet(VTProgramCorrelator correlator)
      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 interface VTSession
      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

      public List<VTMatchSet> getMatchSets()
      Description copied from interface: VTSession
      Returns a list of all VTMatchSets contained in this VTSession
      Specified by:
      getMatchSets in interface VTSession
      Returns:
      a list of all VTMatchSets contained in this VTSession
    • getAssociationManager

      public VTAssociationManager getAssociationManager()
      Description copied from interface: VTSession
      Returns the AssociationManager.
      Specified by:
      getAssociationManager in interface VTSession
      Returns:
      the AssociationManager.
    • getAssociationManagerDBM

      public AssociationDatabaseManager getAssociationManagerDBM()
    • getName

      public String getName()
      Description copied from interface: VTSession
      Returns the name of this VTSession
      Specified by:
      getName in interface ghidra.framework.model.DomainObject
      Specified by:
      getName in interface VTSession
      Overrides:
      getName in class ghidra.framework.data.DomainObjectAdapter
      Returns:
      the name of this VTSession
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface ghidra.framework.model.DomainObject
      Specified by:
      getDescription in class ghidra.framework.data.DomainObjectAdapter
    • isChangeable

      public boolean isChangeable()
      Specified by:
      isChangeable in interface ghidra.framework.model.DomainObject
    • toString

      public String toString()
      Overrides:
      toString in class ghidra.framework.data.DomainObjectAdapter
    • setChanged

      public 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. Any or all parameters may be null.
      Parameters:
      eventType - event type
      oldValue - original value or an Object that is related to the event.
      newValue - new value or an Object that is related to the event.
    • getMatches

      public List<VTMatch> getMatches(VTAssociation association)
      Description copied from interface: VTSession
      Returns a list of all VTMatches for the given association.
      Specified by:
      getMatches in interface VTSession
      Parameters:
      association - the VTAssociation for which to retrieve all VTMatches.
      Returns:
      a list of all VTMatches for the given association.
    • setObjectChanged

      public 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. Any or all parameters may be null.
      Parameters:
      eventType - event type
      affected - 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

      public VTMatchSet getManualMatchSet()
      Description copied from interface: VTSession
      Returns the built-in VTMatchSet used to store manually created VTMatches.
      Specified by:
      getManualMatchSet in interface VTSession
      Returns:
      the built-in VTMatchSet used to store manually created VTMatches.
    • getImpliedMatchSet

      public VTMatchSet getImpliedMatchSet()
      Description copied from interface: VTSession
      Returns the built-in VTMatchSet used to store implied VTMatches.
      Specified by:
      getImpliedMatchSet in interface VTSession
      Returns:
      the built-in VTMatchSet used to store implied VTMatches.
    • deleteMatchTag

      public void deleteMatchTag(VTMatchTag tag)
      Description copied from interface: VTSession
      Deletes the given VTMatchTag from this session.
      Specified by:
      deleteMatchTag in interface VTSession
      Parameters:
      tag - the VTMatchTag to delete.
    • createMatchTag

      public VTMatchTagDB createMatchTag(String tagName)
      Description copied from interface: VTSession
      Creates a new match tag with the given name.
      Specified by:
      createMatchTag in interface VTSession
      Parameters:
      tagName - the name of the new tag to create.
      Returns:
      the new VTMatchTag object.
    • getMatchTags

      public Set<VTMatchTag> getMatchTags()
      Description copied from interface: VTSession
      Returns a set of all VTMatchTags in this session.
      Specified by:
      getMatchTags in interface VTSession
      Returns:
      a set of all VTMatchTags in this session.
    • getMatchTag

      public VTMatchTag getMatchTag(long key)
    • getOrCreateMatchTagDB

      public VTMatchTagDB getOrCreateMatchTagDB(VTMatchTag tag)
    • endTransaction

      public void endTransaction(int transactionID, boolean commit)
      Specified by:
      endTransaction in interface ghidra.framework.model.DomainObject
      Overrides:
      endTransaction in class ghidra.framework.data.DomainObjectAdapterDB
    • addAssociationHook

      public void addAssociationHook(AssociationHook hook)
      Description copied from interface: VTSession
      Adds an Association hook that will be called whenever an association is accepted or cleared.
      Specified by:
      addAssociationHook in interface VTSession
      Parameters:
      hook - the callback hook.
    • removeAssociationHook

      public void removeAssociationHook(AssociationHook hook)
      Description copied from interface: VTSession
      Removes the given Association hook.
      Specified by:
      removeAssociationHook in interface VTSession
      Parameters:
      hook - the callback hook to remove.
    • close

      protected void close()
      Overrides:
      close in class ghidra.framework.data.DomainObjectAdapterDB