Package ghidra.features.bsim.query
Interface FunctionDatabase
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
SQLFunctionDatabase
- All Known Implementing Classes:
AbstractSQLFunctionDatabase,ElasticDatabase,FunctionDatabaseProxy,H2FileFunctionDatabase,PostgresFunctionDatabase
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic enumstatic classstatic enumstatic enum -
Method Summary
Modifier and TypeMethodDescriptiondefault StringchangePassword(char[] newPassword) Issue password change request to the server.static booleancheckSettingsForInsert(DescriptionManager manage, DatabaseInformation info) static voidcheckSettingsForQuery(DescriptionManager manage, DatabaseInformation info) voidclose()Close down (the connection with) the databaseintReturn -1 if info layout version is earlier than current client expectation Return 1 if info layout version is later than current client expectation Return 0 if info version and client version are the samestatic StringconstructFatalError(int flags, ExecutableRecord newrec, ExecutableRecord orig) static StringconstructNonfatalError(int flags, ExecutableRecord newrec, ExecutableRecord orig) Central location for building vector factory used by FunctionDatabaseReturns a list of all configuration template files.getInfo()If the last query failed to produce a response, use this method to recover the error messagedefault intGet the maximum number of functions to be queried per staged query when performing an overview query.default intGet the maximum number of functions to be queried per staged query when searching for similar functions.Return theserver info objectfor this databaseDeprecated.booleanInitialize (a connection with) the database.static booleanisConfigTemplate(File file) Determines if a given xml file is a config template.default booleanDetermine if the connected database supports a user password change.static ConfigurationloadConfigurationTemplate(String configname) Send a query to the database.
-
Method Details
-
isPasswordChangeAllowed
default boolean isPasswordChangeAllowed()Determine if the connected database supports a user password change.- Returns:
- true if a password change is permitted, else false.
-
changePassword
Issue password change request to the server. The methodisPasswordChangeAllowed()must be invoked first to ensure that the user password may be changed.- Parameters:
newPassword- is password data- Returns:
- null if change was successful, or the error message
-
getStatus
FunctionDatabase.Status getStatus()- Returns:
- the status of the current connection with this database
-
getConnectionType
FunctionDatabase.ConnectionType getConnectionType()- Returns:
- the type of connection
-
getUserName
String getUserName()- Returns:
- username (being used to establish connection)
-
getLSHVectorFactory
LSHVectorFactory getLSHVectorFactory()- Returns:
- factory the database is using to create LSHVector objects
-
getInfo
DatabaseInformation getInfo()- Returns:
- an information object giving general characteristics and descriptions of this database
-
compareLayout
int compareLayout()Return -1 if info layout version is earlier than current client expectation Return 1 if info layout version is later than current client expectation Return 0 if info version and client version are the same- Returns:
- comparison of actual database layout with layout expected by client
-
getServerInfo
BSimServerInfo getServerInfo()Return theserver info objectfor this database- Returns:
- the server info object
-
getURLString
Deprecated. -
initialize
boolean initialize()Initialize (a connection with) the database. If initialization is not successful, this routine will return false and an error description can be obtained using getLastError- Returns:
- true if the database ready for querying
-
close
void close()Close down (the connection with) the database- Specified by:
closein interfaceAutoCloseable
-
getLastError
FunctionDatabase.BSimError getLastError()If the last query failed to produce a response, use this method to recover the error message- Returns:
- a String describing the error
-
query
Send a query to the database. The response is returned as a QueryResponseRecord. If this is null, an error has occurred and an error message can be obtained from getLastError- Parameters:
query- an object describing the query- Returns:
- the response object or null if there is an error
-
checkSettingsForQuery
static void checkSettingsForQuery(DescriptionManager manage, DatabaseInformation info) throws LSHException - Throws:
LSHException
-
checkSettingsForInsert
static boolean checkSettingsForInsert(DescriptionManager manage, DatabaseInformation info) throws LSHException, FunctionDatabase.DatabaseNonFatalException -
constructFatalError
-
constructNonfatalError
-
loadConfigurationTemplate
- Throws:
LSHException
-
generateLSHVectorFactory
Central location for building vector factory used by FunctionDatabase- Returns:
- the LSHVectorFactory object
-
getConfigurationTemplates
Returns a list of all configuration template files.- Returns:
- list of template files
-
isConfigTemplate
Determines if a given xml file is a config template. This is done by opening the file and checking for the presence of a<dbconfig>root tag.- Parameters:
file- the file to inspect- Returns:
- true if the file is config template
-
getQueriedFunctionsPerStage
default int getQueriedFunctionsPerStage()Get the maximum number of functions to be queried per staged query when searching for similar functions.- Returns:
- maximum number of functions to be queried per staged query, or 0 for default
which is generally ten (10) per stage. See
SFQueryInfo.DEFAULT_QUERIES_PER_STAGE.
-
getOverviewFunctionsPerStage
default int getOverviewFunctionsPerStage()Get the maximum number of functions to be queried per staged query when performing an overview query.- Returns:
- maximum number of functions to be queried per staged query, or 0 for default
which is generally ten (10) per stage. See
SFOverviewInfo.DEFAULT_QUERIES_PER_STAGE.
-