Package ghidra.features.bsim.query.protocol

# 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 Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final String`
  `name`
  `protected R`
  `response`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BSimQuery(String name)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `buildResponseTemplate()`
  `void`
  `clearResponse()`
  `final R`
  `execute(FunctionDatabase database)`
  Executes this query via the `FunctionDatabase.query(BSimQuery)` method.
  `DescriptionManager`
  `getDescriptionManager()`
  `BSimQuery<?>`
  `getLocalStagingCopy()`
  `String`
  `getName()`
  `R`
  `getResponse()`
  `static BSimQuery<?>`
  `restoreQuery(XmlPullParser parser, LSHVectorFactory vectorFactory)`
  Restore a query from a stream
  `abstract void`
  `restoreXml(XmlPullParser parser, LSHVectorFactory vectorFactory)`
  `abstract void`
  `saveXml(Writer fwrite)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### name

    protected final String name

  - ### response

    protected R extends QueryResponseRecord response

- ## 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