Class SimilarFunctionQueryService
java.lang.Object
ghidra.features.bsim.query.facade.SimilarFunctionQueryService
- All Implemented Interfaces:
AutoCloseable
A simple class that allows the user to query a server for functions that match a given
set of functions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchangePassword
(String username, char[] newPassword) Deprecated.void
close()
protected FunctionDatabase
createDatabase
(String urlString) void
dispose()
generateQueryNearest
(SFQueryInfo queryInfo, TaskMonitor monitor) Given a list of functions to query, prepare the final QueryNearest object which will be marshalled to the server.generateQueryNearestVector
(SFOverviewInfo overviewInfo, TaskMonitor monitor) Returns a string explaining the database compatibility between this client and the server.Return theserver info object
for this databasevoid
initializeDatabase
(String serverURLString) overviewSimilarFunctions
(SFOverviewInfo overviewInfo, SFResultsUpdateListener<ResponseNearestVector> listener, TaskMonitor monitor) Query the given server for similar function overview informationqueryRaw
(BSimQuery<?> query, StagingManager stagingManager, SFResultsUpdateListener<QueryResponseRecord> listener, TaskMonitor monitor) A lower-level (more flexible) query of the database.querySimilarFunctions
(SFQueryInfo queryInfo, SFResultsUpdateListener<SFQueryResult> listener, TaskMonitor monitor) Query the given server with the parameters provider by queryInfo.void
setNumberOfStages
(int val) void
updateProgram
(Program newProgram)
-
Constructor Details
-
Method Details
-
generateQueryNearest
public QueryNearest generateQueryNearest(SFQueryInfo queryInfo, TaskMonitor monitor) throws QueryDatabaseException Given a list of functions to query, prepare the final QueryNearest object which will be marshalled to the server. This involves generating the signatures for each of the function and accumulating their FunctionDescriptions- Parameters:
queryInfo
- is the high-level form of query, with the list of FunctionSymbols and other parametersmonitor
- the task monitor- Returns:
- the QueryNearest object ready for the queryStaged method
- Throws:
QueryDatabaseException
- if transferring functions fails
-
generateQueryNearestVector
public QueryNearestVector generateQueryNearestVector(SFOverviewInfo overviewInfo, TaskMonitor monitor) throws QueryDatabaseException - Throws:
QueryDatabaseException
-
changePassword
Deprecated.Issue password change request to the server- Parameters:
username
- to changenewPassword
- is password data- Returns:
- null if change was successful, or the error message
-
querySimilarFunctions
public SFQueryResult querySimilarFunctions(SFQueryInfo queryInfo, SFResultsUpdateListener<SFQueryResult> listener, TaskMonitor monitor) throws QueryDatabaseException, CancelledException Query the given server with the parameters provider by queryInfo.- Parameters:
queryInfo
- a query info object containing the settings for the querylistener
- is the listener to be informed of the query status and incremental results coming back, may be nullmonitor
- the task monitor to use; can be null- Returns:
- the result object containing the retrieved similar functions; null if the query was cancelled
- Throws:
QueryDatabaseException
- if the query execution failsCancelledException
- if the query is cancelled by the user
-
overviewSimilarFunctions
public ResponseNearestVector overviewSimilarFunctions(SFOverviewInfo overviewInfo, SFResultsUpdateListener<ResponseNearestVector> listener, TaskMonitor monitor) throws QueryDatabaseException, CancelledException Query the given server for similar function overview information- Parameters:
overviewInfo
- is details of the overview querylistener
- is the listener to be informed of the query status and incremental results coming back, may be nullmonitor
- the task monitor- Returns:
- the ResponseNearestVector
- Throws:
QueryDatabaseException
- if the database connection cannot be establishedCancelledException
- if the query is cancelled by the user
-
queryRaw
public QueryResponseRecord queryRaw(BSimQuery<?> query, StagingManager stagingManager, SFResultsUpdateListener<QueryResponseRecord> listener, TaskMonitor monitor) throws QueryDatabaseException, CancelledException A lower-level (more flexible) query of the database. The query is not staged.- Parameters:
query
- is the raw query informationstagingManager
- is how to split up the query, can be nulllistener
- is the listener to be informed of the query status and incremental results coming back, may be nullmonitor
- the task monitor- Returns:
- the raw response record from the database
- Throws:
QueryDatabaseException
- if the database connection cannot be establishedCancelledException
- if the query is cancelled by the user
-
dispose
public void dispose() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
setNumberOfStages
public void setNumberOfStages(int val) -
updateProgram
-
getServerInfo
Return theserver info object
for this database- Returns:
- the server info object or null if not currently associated with
a
FunctionDatabase
.
-
getDatabaseStatus
-
getDatabaseConnectionType
-
getDatabaseInformation
-
getUserName
-
getLSHVectorFactory
-
getLastError
-
getDatabaseCompatibility
Returns a string explaining the database compatibility between this client and the server.- Returns:
- a string explaining the compatibility, or null if it could not be determined
-
createDatabase
- Throws:
MalformedURLException
-
initializeDatabase
- Throws:
QueryDatabaseException
-