Package org.firebirdsql.management
Class FBServiceManager
java.lang.Object
org.firebirdsql.management.FBServiceManager
- All Implemented Interfaces:
ServiceManager
- Direct Known Subclasses:
FBBackupManagerBase,FBMaintenanceManager,FBNBackupManager,FBStatisticsManager,FBTraceManager,FBUserManager
An implementation of the basic Firebird Service API functionality.
- Author:
- Roman Rokytskyy, Mark Rotteveel
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance ofFBServiceManagerbased on the default GDSType.FBServiceManager(String gdsType) Create a new instance ofFBServiceManagerbased on a given GDSType.FBServiceManager(GDSType gdsType) Create a new instance ofFBServiceManagerbased on a given GDSType. -
Method Summary
Modifier and TypeMethodDescriptionprotected FbDatabaseprotected ServiceRequestBuffercreateRequestBuffer(FbService service, int operation, int options) protected final voidexecuteServicesOperation(FbService service, ServiceRequestBuffer srb) protected voidDeprecated.Get the list of authentication plugins to try.Returns the database path for the connection to the service manager.Get the database encryption plugin configuration.getHost()Returns the host for the connection to the service manager.Returns the logger for the connection to the service manager.Returns the password for the connection to the service manager.intgetPort()Returns the port for the connection to the service manager.Obtains the server version through a service call.getUser()Get name of the user that performs the operation.Get the wire encryption level.booleanGet if wire compression should be enabled.voidqueueService(FbService service) voidsetAuthPlugins(String authPlugins) Sets the authentication plugins to try.voidsetCharSet(String charSet) Sets the encoding used for encoding or decoding string values.voidsetDatabase(String database) Sets the database path for the connection to the service manager.voidsetDbCryptConfig(String dbCryptConfig) Sets the database encryption plugin configuration.voidSets the host for the connection to the service manager.voidsetLogger(OutputStream logger) Sets the logger for the connection to the service manager.voidsetPassword(String password) Sets the password for the connection to the service manager.voidsetPort(int port) Sets the port for the connection to the service manager.voidSet the name of the user that performs the operation.voidsetWireCompression(boolean wireCompression) Sets if the connection should try to enable wire compression.voidsetWireCrypt(WireCrypt wireCrypt) Set the wire encryption level.
-
Field Details
-
BUFFER_SIZE
public static final int BUFFER_SIZE- See Also:
-
-
Constructor Details
-
FBServiceManager
public FBServiceManager()Create a new instance ofFBServiceManagerbased on the default GDSType. -
FBServiceManager
Create a new instance ofFBServiceManagerbased on a given GDSType.- Parameters:
gdsType- type must be PURE_JAVA, EMBEDDED, or NATIVE
-
FBServiceManager
Create a new instance ofFBServiceManagerbased on a given GDSType.- Parameters:
gdsType- The GDS implementation type to use
-
-
Method Details
-
setCharSet
Description copied from interface:ServiceManagerSets the encoding used for encoding or decoding string values.If not set (or null), defaults to the value of system property
file.encoding/- Specified by:
setCharSetin interfaceServiceManager- Parameters:
charSet- Java charset name.
-
getCharSet
- Specified by:
getCharSetin interfaceServiceManager
-
setUser
Set the name of the user that performs the operation.- Specified by:
setUserin interfaceServiceManager- Parameters:
user- name of the user.
-
getUser
Get name of the user that performs the operation.- Specified by:
getUserin interfaceServiceManager- Returns:
- name of the user that performs the operation.
-
setPassword
Description copied from interface:ServiceManagerSets the password for the connection to the service manager.- Specified by:
setPasswordin interfaceServiceManager- Parameters:
password- The password to set.
-
getPassword
Description copied from interface:ServiceManagerReturns the password for the connection to the service manager.- Specified by:
getPasswordin interfaceServiceManager- Returns:
- Returns the password.
-
setDatabase
Description copied from interface:ServiceManagerSets the database path for the connection to the service manager.- Specified by:
setDatabasein interfaceServiceManager- Parameters:
database- path for the connection to the service manager.
-
getDatabase
Description copied from interface:ServiceManagerReturns the database path for the connection to the service manager.- Specified by:
getDatabasein interfaceServiceManager- Returns:
- the database path for the connection to the service manager.
-
getHost
Description copied from interface:ServiceManagerReturns the host for the connection to the service manager.- Specified by:
getHostin interfaceServiceManager- Returns:
- Returns the host.
-
setHost
Description copied from interface:ServiceManagerSets the host for the connection to the service manager.- Specified by:
setHostin interfaceServiceManager- Parameters:
host- The host to set.
-
getPort
public int getPort()Description copied from interface:ServiceManagerReturns the port for the connection to the service manager.- Specified by:
getPortin interfaceServiceManager- Returns:
- Returns the port.
-
setPort
public void setPort(int port) Description copied from interface:ServiceManagerSets the port for the connection to the service manager.- Specified by:
setPortin interfaceServiceManager- Parameters:
port- The port to set.
-
getWireCrypt
Description copied from interface:ServiceManagerGet the wire encryption level.- Specified by:
getWireCryptin interfaceServiceManager- Returns:
- Wire encryption level
-
setWireCrypt
Description copied from interface:ServiceManagerSet the wire encryption level.- Specified by:
setWireCryptin interfaceServiceManager- Parameters:
wireCrypt- Wire encryption level (nullnot allowed)
-
getDbCryptConfig
Description copied from interface:ServiceManagerGet the database encryption plugin configuration.- Specified by:
getDbCryptConfigin interfaceServiceManager- Returns:
- Database encryption plugin configuration, meaning plugin specific
-
setDbCryptConfig
Description copied from interface:ServiceManagerSets the database encryption plugin configuration.- Specified by:
setDbCryptConfigin interfaceServiceManager- Parameters:
dbCryptConfig- Database encryption plugin configuration, meaning plugin specific
-
getAuthPlugins
Description copied from interface:ServiceManagerGet the list of authentication plugins to try.- Specified by:
getAuthPluginsin interfaceServiceManager- Returns:
- comma-separated list of authentication plugins, or
nullfor driver default
-
setAuthPlugins
Description copied from interface:ServiceManagerSets the authentication plugins to try.Invalid names are skipped during authentication.
- Specified by:
setAuthPluginsin interfaceServiceManager- Parameters:
authPlugins- comma-separated list of authentication plugins, ornullfor driver default
-
isWireCompression
public boolean isWireCompression()Description copied from interface:ServiceManagerGet if wire compression should be enabled.Wire compression requires Firebird 3 or higher, and the server must have the zlib library. If compression cannot be negotiated, the connection will be made without wire compression.
This property will be ignored for native connections. For native connections, the configuration in
firebird.confread by the client library will be used.- Specified by:
isWireCompressionin interfaceServiceManager- Returns:
truewire compression enabled
-
setWireCompression
public void setWireCompression(boolean wireCompression) Description copied from interface:ServiceManagerSets if the connection should try to enable wire compression.- Specified by:
setWireCompressionin interfaceServiceManager- Parameters:
wireCompression-trueenable wire compression,falsedisable wire compression (the default)- See Also:
-
getLogger
Description copied from interface:ServiceManagerReturns the logger for the connection to the service manager.- Specified by:
getLoggerin interfaceServiceManager- Returns:
- Returns the out.
-
setLogger
Description copied from interface:ServiceManagerSets the logger for the connection to the service manager.- Specified by:
setLoggerin interfaceServiceManager- Parameters:
logger- The out to set.
-
getServiceName
-
attachServiceManager
- Throws:
SQLException
-
attachDatabase
- Throws:
SQLException
-
queueService
- Throws:
SQLExceptionIOException
-
executeServicesOperation
Deprecated.Execute a Services API operation in the database. All output from the operation is sent to thisServiceManager's logger.- Parameters:
srb- The buffer containing the task request- Throws:
SQLException- if a database access error occurs or incorrect parameters are supplied
-
executeServicesOperation
protected final void executeServicesOperation(FbService service, ServiceRequestBuffer srb) throws SQLException - Throws:
SQLException
-
createRequestBuffer
-
getServerVersion
Description copied from interface:ServiceManagerObtains the server version through a service call.- Specified by:
getServerVersionin interfaceServiceManager- Returns:
- Parsed server version, or
GDSServerVersion.INVALID_VERSIONif parsing failed. - Throws:
SQLException- For errors connecting to the service manager.
-
executeServicesOperation(FbService, ServiceRequestBuffer).