Class VTAssociationDB

java.lang.Object
ghidra.program.database.DatabaseObject
ghidra.feature.vt.api.db.VTAssociationDB
All Implemented Interfaces:
VTAssociation

public class VTAssociationDB extends ghidra.program.database.DatabaseObject implements VTAssociation
  • Field Details

  • Constructor Details

  • Method Details

    • setInvalid

      public void setInvalid()
      Overrides:
      setInvalid in class ghidra.program.database.DatabaseObject
    • getAssociationManager

      public VTAssociationManager getAssociationManager()
    • getAssociationDatabaseManager

      public AssociationDatabaseManager getAssociationDatabaseManager()
    • getAssociationManagerDB

      public AssociationDatabaseManager getAssociationManagerDB()
    • getSession

      public VTSession getSession()
      Description copied from interface: VTAssociation
      Returns the VTSession that this association belongs to.
      Specified by:
      getSession in interface VTAssociation
      Returns:
      the VTSession that this association belongs to.
    • getRelatedAssociations

      public Collection<VTAssociation> getRelatedAssociations()
      Description copied from interface: VTAssociation
      Returns a collection of VTAssociations that have either the same source address or the same destination address.
      Specified by:
      getRelatedAssociations in interface VTAssociation
      Returns:
      a collection of VTAssociations that have either the same source address or the same destination address.
    • refresh

      protected boolean refresh()
      Specified by:
      refresh in class ghidra.program.database.DatabaseObject
    • refresh

      protected boolean refresh(db.DBRecord associationRecord)
      Overrides:
      refresh in class ghidra.program.database.DatabaseObject
    • getSourceAddress

      public ghidra.program.model.address.Address getSourceAddress()
      Description copied from interface: VTAssociation
      Returns the address of the function or data item in the source program for this association.
      Specified by:
      getSourceAddress in interface VTAssociation
      Returns:
      the address of the function or data item in the source program for this association.
    • getDestinationAddress

      public ghidra.program.model.address.Address getDestinationAddress()
      Description copied from interface: VTAssociation
      Returns the address of the function or data item in the source program for this association.
      Specified by:
      getDestinationAddress in interface VTAssociation
      Returns:
      the address of the function or data item in the source program for this association.
    • getType

      public VTAssociationType getType()
      Description copied from interface: VTAssociation
      Returns the type of the association. Either Function or Data.
      Specified by:
      getType in interface VTAssociation
      Returns:
      the type of the association. Either Function or Data.
    • markupItemStatusChanged

      public void markupItemStatusChanged(VTMarkupItem markupItem)
    • getStatus

      public VTAssociationStatus getStatus()
      Description copied from interface: VTAssociation
      Returns the current status of this association. One of AVAILABLE, ACCEPTED, BLOCKED, or REJECTED. See VTAssociationStatus for details.
      Specified by:
      getStatus in interface VTAssociation
      Returns:
      the current status of this association. One of AVAILABLE, ACCEPTED, BLOCKED, or REJECTED.
    • getMarkupStatus

      public VTAssociationMarkupStatus getMarkupStatus()
      Description copied from interface: VTAssociation
      Returns the status of the markup items for this association. See VTAssociationMarkupStatus for details.
      Specified by:
      getMarkupStatus in interface VTAssociation
      Returns:
      the status of the markup items for this association.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • setAccepted

      public void setAccepted() throws VTAssociationStatusException
      Description copied from interface: VTAssociation
      A convenience method to accept the given association without actually performing an apply.
      Specified by:
      setAccepted in interface VTAssociation
      Throws:
      VTAssociationStatusException - if the given association is VTAssociationStatus.BLOCKED
    • setRejected

      public void setRejected() throws VTAssociationStatusException
      Description copied from interface: VTAssociation
      Sets the status of this association to VTAssociationStatus.REJECTED.
      Specified by:
      setRejected in interface VTAssociation
      Throws:
      VTAssociationStatusException - if the association is accepted.
    • clearStatus

      public void clearStatus() throws VTAssociationStatusException
      Description copied from interface: VTAssociation
      Clears the state of the given association from VTAssociationStatus.ACCEPTED or VTAssociationStatus.REJECTED to VTAssociationStatus.AVAILABLE. This method will throw an exception if called while the given assocation's markup items have been applied. That is, you must first unapply any applied markup items before calling this method.
      Specified by:
      clearStatus in interface VTAssociation
      Throws:
      VTAssociationStatusException - if the given association's status is not VTAssociationStatus.ACCEPTED/VTAssociationStatus.REJECTED or if the given assocation's markup item manager contains markup items that have been applied.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getVoteCount

      public int getVoteCount()
      Description copied from interface: VTAssociation
      Returns the current vote count which is an application settable field which should generally be used to indicate a number of supporting facts. For example, other accepted associations may have matching call references to this association, each of those matching calls should have incremented the votes.
      Specified by:
      getVoteCount in interface VTAssociation
      Returns:
      the current number of facts that support this association
    • setMarkupStatus

      public void setMarkupStatus(VTAssociationMarkupStatus status)
      Description copied from interface: VTAssociation
      Sets the markup status of this association. This method is used by the VTAssociationManager to update the association with information about the state of its markup items.
      Specified by:
      setMarkupStatus in interface VTAssociation
      Parameters:
      status - the markup items
    • setStatus

      public void setStatus(VTAssociationStatus status)
    • setVoteCount

      public void setVoteCount(int voteCount)
      Description copied from interface: VTAssociation
      Sets the vote count for this association which should be used to indicate the number of supporting facts for this association
      Specified by:
      setVoteCount in interface VTAssociation
      Parameters:
      voteCount - the new vote count for this association.
    • getMarkupItems

      public Collection<VTMarkupItem> getMarkupItems(ghidra.util.task.TaskMonitor monitor) throws ghidra.util.exception.CancelledException
      Description copied from interface: VTAssociation
      Returns a list of markup items for this association.
      Specified by:
      getMarkupItems in interface VTAssociation
      Parameters:
      monitor - a task monitor used to monitor and control this operation.
      Returns:
      a list of markup items for this association.
      Throws:
      ghidra.util.exception.CancelledException - if the operation was cancelled via the monitor.
    • hasAppliedMarkupItems

      public boolean hasAppliedMarkupItems()
      Description copied from interface: VTAssociation
      Returns true if this association is accepted and has one or more markup items that have been applied.
      Specified by:
      hasAppliedMarkupItems in interface VTAssociation
      Returns:
      true if this association is accepted and has one or more markup items that have been applied.