Class BSimQuery<R extends QueryResponseRecord>

java.lang.Object
ghidra.features.bsim.query.protocol.BSimQuery<R>
Type Parameters:
R - The QueryResponseRecord response implementation class
Direct Known Subclasses:
AdjustVectorIndex, CreateDatabase, DropDatabase, InsertOptionalValues, InsertRequest, InstallCategoryRequest, InstallMetadataRequest, InstallTagRequest, PasswordChange, PrewarmRequest, QueryChildren, QueryCluster, QueryDelete, QueryExeCount, QueryExeInfo, QueryInfo, QueryName, QueryNearest, QueryNearestVector, QueryOptionalExist, QueryOptionalValues, QueryPair, QueryUpdate, QueryVectorId, QueryVectorMatch

public abstract class BSimQuery<R extends QueryResponseRecord> extends Object
BSimQuery facilitates all BSim FunctionDatabase queries which when executed provide a specific QueryResponseRecord.
  • Field Details

  • Constructor Details

    • BSimQuery

      public BSimQuery(String name)
  • Method Details

    • execute

      public final R execute(FunctionDatabase database)
      Executes this query via the FunctionDatabase.query(BSimQuery) method. The use of this method is preferred due to its type enforcement on the returned response object.
      Parameters:
      database - BSim function database to be queried
      Returns:
      query response or null on error (see FunctionDatabase.getLastError()).
    • clearResponse

      public void clearResponse()
    • getResponse

      public R getResponse()
    • getName

      public String getName()
    • buildResponseTemplate

      public void buildResponseTemplate()
    • saveXml

      public abstract void saveXml(Writer fwrite) throws IOException
      Throws:
      IOException
    • restoreXml

      public abstract void restoreXml(XmlPullParser parser, LSHVectorFactory vectorFactory) throws LSHException
      Throws:
      LSHException
    • getDescriptionManager

      public DescriptionManager getDescriptionManager()
    • getLocalStagingCopy

      public BSimQuery<?> getLocalStagingCopy()
      Returns:
      a partial clone of this query suitable for holding local stages of the query via StagingManager
    • restoreQuery

      public static BSimQuery<?> restoreQuery(XmlPullParser parser, LSHVectorFactory vectorFactory) throws LSHException
      Restore a query from a stream
      Parameters:
      parser - is the XmlPullParser already queued up with the stream to process
      vectorFactory - is used to generate any vector objects from the XML
      Returns:
      one of the Query* instances derived from QueryResponseRecord
      Throws:
      LSHException - for errors creating the command