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 class
static enum
static class
static enum
static enum
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
changePassword
(char[] newPassword) Issue password change request to the server.static boolean
checkSettingsForInsert
(DescriptionManager manage, DatabaseInformation info) static void
checkSettingsForQuery
(DescriptionManager manage, DatabaseInformation info) void
close()
Close down (the connection with) the databaseint
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 samestatic String
constructFatalError
(int flags, ExecutableRecord newrec, ExecutableRecord orig) static String
constructNonfatalError
(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 int
Get the maximum number of functions to be queried per staged query when performing an overview query.default int
Get the maximum number of functions to be queried per staged query when searching for similar functions.Return theserver info object
for this databaseDeprecated.boolean
Initialize (a connection with) the database.static boolean
isConfigTemplate
(File file) Determines if a given xml file is a config template.default boolean
Determine if the connected database supports a user password change.static Configuration
loadConfigurationTemplate
(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 object
for 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:
close
in 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
.
-