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
public class FBServiceManager extends java.lang.Object implements ServiceManager
An implementation of the basic Firebird Service API functionality.- Author:
- Roman Rokytskyy, Mark Rotteveel
-
-
Field Summary
Fields Modifier and Type Field Description static intBUFFER_SIZE
-
Constructor Summary
Constructors Constructor Description FBServiceManager()Create a new instance ofFBServiceManagerbased on the default GDSType.FBServiceManager(java.lang.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
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected FbDatabaseattachDatabase()FbServiceattachServiceManager()protected ServiceRequestBuffercreateRequestBuffer(FbService service, int operation, int options)protected voidexecuteServicesOperation(FbService service, ServiceRequestBuffer srb)protected voidexecuteServicesOperation(ServiceRequestBuffer srb)Deprecated.java.lang.StringgetAuthPlugins()Get the list of authentication plugins to try.java.lang.StringgetCharSet()java.lang.StringgetDatabase()Returns the database path for the connection to the service manager.java.lang.StringgetDbCryptConfig()Get the database encryption plugin configuration.java.lang.StringgetHost()Returns the host for the connection to the service manager.java.io.OutputStreamgetLogger()Returns the logger for the connection to the service manager.java.lang.StringgetPassword()Returns the password for the connection to the service manager.intgetPort()Returns the port for the connection to the service manager.GDSServerVersiongetServerVersion()Obtains the server version through a service call.java.lang.StringgetServiceName()java.lang.StringgetUser()Get name of the user that performs the operation.WireCryptgetWireCrypt()Get the wire encryption level.booleanisWireCompression()Get if wire compression should be enabled.voidqueueService(FbService service)voidsetAuthPlugins(java.lang.String authPlugins)Sets the authentication plugins to try.voidsetCharSet(java.lang.String charSet)Sets the encoding used for encoding or decoding string values.voidsetDatabase(java.lang.String database)Sets the database path for the connection to the service manager.voidsetDbCryptConfig(java.lang.String dbCryptConfig)Sets the database encryption plugin configuration.voidsetHost(java.lang.String host)Sets the host for the connection to the service manager.voidsetLogger(java.io.OutputStream logger)Sets the logger for the connection to the service manager.voidsetPassword(java.lang.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.voidsetUser(java.lang.String user)Set 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 Detail
-
BUFFER_SIZE
public static final int BUFFER_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FBServiceManager
public FBServiceManager()
Create a new instance ofFBServiceManagerbased on the default GDSType.
-
FBServiceManager
public FBServiceManager(java.lang.String gdsType)
Create a new instance ofFBServiceManagerbased on a given GDSType.- Parameters:
gdsType- type must be PURE_JAVA, EMBEDDED, or NATIVE
-
FBServiceManager
public FBServiceManager(GDSType gdsType)
Create a new instance ofFBServiceManagerbased on a given GDSType.- Parameters:
gdsType- The GDS implementation type to use
-
-
Method Detail
-
setCharSet
public void setCharSet(java.lang.String charSet)
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
public java.lang.String getCharSet()
- Specified by:
getCharSetin interfaceServiceManager
-
setUser
public void setUser(java.lang.String user)
Set the name of the user that performs the operation.- Specified by:
setUserin interfaceServiceManager- Parameters:
user- name of the user.
-
getUser
public java.lang.String getUser()
Get name of the user that performs the operation.- Specified by:
getUserin interfaceServiceManager- Returns:
- name of the user that performs the operation.
-
setPassword
public void setPassword(java.lang.String password)
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
public java.lang.String getPassword()
Description copied from interface:ServiceManagerReturns the password for the connection to the service manager.- Specified by:
getPasswordin interfaceServiceManager- Returns:
- Returns the password.
-
setDatabase
public void setDatabase(java.lang.String database)
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
public java.lang.String 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
public java.lang.String getHost()
Description copied from interface:ServiceManagerReturns the host for the connection to the service manager.- Specified by:
getHostin interfaceServiceManager- Returns:
- Returns the host.
-
setHost
public void setHost(java.lang.String host)
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
public WireCrypt getWireCrypt()
Description copied from interface:ServiceManagerGet the wire encryption level.- Specified by:
getWireCryptin interfaceServiceManager- Returns:
- Wire encryption level
-
setWireCrypt
public void setWireCrypt(WireCrypt wireCrypt)
Description copied from interface:ServiceManagerSet the wire encryption level.- Specified by:
setWireCryptin interfaceServiceManager- Parameters:
wireCrypt- Wire encryption level (nullnot allowed)
-
getDbCryptConfig
public java.lang.String getDbCryptConfig()
Description copied from interface:ServiceManagerGet the database encryption plugin configuration.- Specified by:
getDbCryptConfigin interfaceServiceManager- Returns:
- Database encryption plugin configuration, meaning plugin specific
-
setDbCryptConfig
public void setDbCryptConfig(java.lang.String dbCryptConfig)
Description copied from interface:ServiceManagerSets the database encryption plugin configuration.- Specified by:
setDbCryptConfigin interfaceServiceManager- Parameters:
dbCryptConfig- Database encryption plugin configuration, meaning plugin specific
-
getAuthPlugins
public java.lang.String 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
public void setAuthPlugins(java.lang.String authPlugins)
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:
ServiceManager.isWireCompression()
-
getLogger
public java.io.OutputStream getLogger()
Description copied from interface:ServiceManagerReturns the logger for the connection to the service manager.- Specified by:
getLoggerin interfaceServiceManager- Returns:
- Returns the out.
-
setLogger
public void setLogger(java.io.OutputStream logger)
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
public java.lang.String getServiceName()
-
attachServiceManager
public FbService attachServiceManager() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
attachDatabase
protected FbDatabase attachDatabase() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
queueService
public void queueService(FbService service) throws java.sql.SQLException, java.io.IOException
- Throws:
java.sql.SQLExceptionjava.io.IOException
-
executeServicesOperation
@Deprecated protected void executeServicesOperation(ServiceRequestBuffer srb) throws java.sql.SQLException
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:
java.sql.SQLException- if a database access error occurs or incorrect parameters are supplied
-
executeServicesOperation
protected final void executeServicesOperation(FbService service, ServiceRequestBuffer srb) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
createRequestBuffer
protected ServiceRequestBuffer createRequestBuffer(FbService service, int operation, int options)
-
getServerVersion
public GDSServerVersion getServerVersion() throws java.sql.SQLException
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:
java.sql.SQLException- For errors connecting to the service manager.
-
-