public class FBServiceManager extends java.lang.Object implements ServiceManager
| Modifier and Type | Field and Description |
|---|---|
static int |
BUFFER_SIZE |
| Constructor and Description |
|---|
FBServiceManager()
Create a new instance of
FBServiceManager based on
the default GDSType. |
FBServiceManager(GDSType gdsType)
Create a new instance of
FBServiceManager based on
a given GDSType. |
FBServiceManager(java.lang.String gdsType)
Create a new instance of
FBServiceManager based on
a given GDSType. |
| Modifier and Type | Method and Description |
|---|---|
protected FbDatabase |
attachDatabase() |
FbService |
attachServiceManager() |
java.util.Map<ConnectionProperty,java.lang.Object> |
connectionPropertyValues()
An unmodifiable view on the connection properties held by this BaseProperties implementation.
|
protected ServiceRequestBuffer |
createRequestBuffer(FbService service,
int operation,
int options) |
protected void |
executeServicesOperation(FbService service,
ServiceRequestBuffer srb) |
protected void |
executeServicesOperation(ServiceRequestBuffer srb)
Deprecated.
|
java.lang.String |
getAuthPlugins()
Get the list of authentication plugins to try.
|
java.lang.Boolean |
getBooleanProperty(java.lang.String name)
Retrieves a
boolean property value by name. |
java.lang.String |
getCharSet()
Java character set configured for the connection.
|
java.lang.String |
getDatabase()
Returns the database path for the connection to the service manager.
|
java.lang.String |
getDbCryptConfig()
Get the database encryption plugin configuration.
|
java.lang.String |
getExpectedDb()
Gets the expected db (
isc_spb_expected_db; defaults to null). |
java.lang.String |
getHost()
Deprecated.
|
java.lang.Integer |
getIntProperty(java.lang.String name)
Retrieves an
int property value by name. |
java.io.OutputStream |
getLogger()
Returns the logger for the connection to the service manager.
|
java.lang.String |
getPassword() |
int |
getPort()
Deprecated.
|
int |
getPortNumber()
Get the port number of the server.
|
java.lang.String |
getProperty(java.lang.String name)
Retrieves a string property value by name.
|
java.lang.String |
getServerName()
Get the hostname or IP address of the Firebird server.
|
GDSServerVersion |
getServerVersion()
Obtains the server version through a service call.
|
java.lang.String |
getServiceName()
Gets the service name (defaults to
"service_mgr"). |
java.lang.String |
getUser() |
java.lang.String |
getWireCrypt()
Get the wire encryption level.
|
WireCrypt |
getWireCryptAsEnum()
Get the wire encryption level.
|
boolean |
isWireCompression()
Get if wire compression should be enabled.
|
void |
queueService(FbService service) |
void |
setAuthPlugins(java.lang.String authPlugins)
Sets the authentication plugins to try.
|
void |
setBooleanProperty(java.lang.String name,
java.lang.Boolean value)
Sets a
boolean property by name. |
void |
setCharSet(java.lang.String charSet)
Set the Java character set for the connection.
|
void |
setDatabase(java.lang.String database)
Sets the database path for the connection to the service manager.
|
void |
setDbCryptConfig(java.lang.String dbCryptConfig)
Sets the database encryption plugin configuration.
|
void |
setExpectedDb(java.lang.String expectedDb)
Filename or alias of the database expected to be accessed by the service operation (
isc_spb_expected_db). |
void |
setHost(java.lang.String host)
Deprecated.
|
void |
setIntProperty(java.lang.String name,
java.lang.Integer value)
Sets an
int property by name. |
void |
setLogger(java.io.OutputStream logger)
Sets the logger for the connection to the service manager.
|
void |
setPassword(java.lang.String password) |
void |
setPort(int port)
Deprecated.
|
void |
setPortNumber(int portNumber)
Set the port number of the server.
|
void |
setProperty(java.lang.String name,
java.lang.String value)
Sets a property by name.
|
void |
setServerName(java.lang.String serverName)
Set the hostname or IP address of the Firebird server.
|
void |
setServiceName(java.lang.String serviceName)
Sets the service name
|
void |
setType(java.lang.String type) |
void |
setUser(java.lang.String user) |
void |
setWireCompression(boolean wireCompression)
Sets if the connection should try to enable wire compression.
|
void |
setWireCryptAsEnum(WireCrypt wireCrypt)
Set the wire encryption level.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetConnectTimeout, getEncoding, getParallelWorkers, getProcessId, getProcessName, getRoleName, getSocketBufferSize, getSoTimeout, getType, setConnectTimeout, setEncoding, setParallelWorkers, setProcessId, setProcessName, setRoleName, setSocketBufferSize, setSoTimeout, setWireCryptgetBooleanProperty, getIntProperty, getPropertypublic static final int BUFFER_SIZE
public FBServiceManager()
FBServiceManager based on
the default GDSType.public FBServiceManager(java.lang.String gdsType)
FBServiceManager based on
a given GDSType.gdsType - type must be PURE_JAVA, EMBEDDED, or NATIVEpublic FBServiceManager(GDSType gdsType)
FBServiceManager based on
a given GDSType.gdsType - The GDS implementation type to usepublic final void setType(java.lang.String type)
setType in interface AttachmentPropertiestype - type of the connection, for example, "PURE_JAVA", "NATIVE", "EMBEDDED", depends on the GDS
implementations installed in the system.public void setCharSet(java.lang.String charSet)
AttachmentProperties
It is possible to set both the charSet and encoding to achieve a character set conversion effect,
but in general only one of both properties should be set.
setCharSet in interface AttachmentPropertiescharSet - Character set for the connection. Similar to encoding property, but accepts Java names instead
of Firebird ones.AttachmentProperties.setEncoding(String)public java.lang.String getCharSet()
AttachmentProperties
After connect, the actual Java character set applied can be obtained from
FbAttachment.getEncoding() (property charsetName), or FbAttachment.getEncodingFactory()
(properties defaultEncoding.charsetName or {code defaultEncodingDefinition.javaCharset}).
getCharSet in interface AttachmentPropertiesnull when not explicitly configured).public void setUser(java.lang.String user)
setUser in interface AttachmentPropertiesuser - Name of the user to authenticate to the server.public java.lang.String getUser()
getUser in interface AttachmentPropertiespublic void setPassword(java.lang.String password)
setPassword in interface AttachmentPropertiespassword - Password to authenticate to the server.public java.lang.String getPassword()
getPassword in interface AttachmentPropertiespublic java.lang.String getServerName()
AttachmentPropertiesgetServerName in interface AttachmentPropertiesAttachmentProperties.setServerName(String)public void setServerName(java.lang.String serverName)
AttachmentProperties
When set to null (the default), the databaseName or serviceName is used as the full
identification of the database host, port and database path/alias. Protocol implementations, for example
PURE_JAVA, may default to localhost when this property is null, but
databaseName/serviceName does not (seem to) contain a host name.
setServerName in interface AttachmentPropertiesserverName - Hostname or IP address of the serverpublic int getPortNumber()
AttachmentPropertiesgetPortNumber in interface AttachmentPropertiesAttachmentProperties.setPortNumber(int)public void setPortNumber(int portNumber)
AttachmentProperties
Defaults to 3050. This property value will be ignored if serverName is null, unless the
protocol implementation needs a hostname, but cannot find a hostname in databaseName/serviceName.
setPortNumber in interface AttachmentPropertiesportNumber - Port number of the serverAttachmentProperties.setServerName(String)public java.lang.String getServiceName()
ServiceConnectionProperties"service_mgr").getServiceName in interface ServiceConnectionPropertiesServiceConnectionProperties.setServiceName(String)public void setServiceName(java.lang.String serviceName)
ServiceConnectionProperties
When serverName is null, then the value is taken as the URL of the service, and exact
interpretation depends on the protocol implementation (type). Examples:
serverName, depending on the Firebird version and platform, NATIVE may use Firebird Embedded)xnet) TODO: Check if actually validfbclient connection URLs — NATIVE, (EMBEDDED will behave as NATIVE, protocols
like PURE_JAVA may interpret the protocol name as a host nametype implementations may support other URL formats
Some protocols, for example PURE_JAVA, when serverName is not set, but serviceName doesn't seem
to contain a host name, may default to attempting to connect to localhost with serviceName as the
service.
When serverName is set, the value is taken as the database path or alias. Examples:
nullsetServiceName in interface ServiceConnectionPropertiesserviceName - service namepublic void setExpectedDb(java.lang.String expectedDb)
isc_spb_expected_db).
For Firebird 3.0 and higher when using a non-default security database, so Firebird knows which database to use to authenticate. When using the default security database, this property does not need to be set.
Some service implementations (e.g. BackupManager)
may explicitly set this as part of their operation when its current value is null.
NOTE: The setDatabase(String) property will also set this property, so in general this property doesn't
need to be set explicitly.
setExpectedDb in interface ServiceConnectionPropertiesexpectedDb - Expected databasepublic java.lang.String getExpectedDb()
ServiceConnectionPropertiesisc_spb_expected_db; defaults to null).getExpectedDb in interface ServiceConnectionPropertiesServiceConnectionProperties.setExpectedDb(String)public void setDatabase(java.lang.String database)
ServiceManager
Will also set the expectedDb property. If a different value must be used, it must be set after
calling this method.
setDatabase in interface ServiceManagerdatabase - path for the connection to the service manager.public java.lang.String getDatabase()
ServiceManagergetDatabase in interface ServiceManager@Deprecated public java.lang.String getHost()
ServiceManagergetHost in interface ServiceManager@Deprecated public void setHost(java.lang.String host)
ServiceManager
See AttachmentProperties.setServerName(String) for details.
setHost in interface ServiceManagerhost - for the connection to the service manager.@Deprecated public int getPort()
ServiceManagergetPort in interface ServiceManager@Deprecated public void setPort(int port)
ServiceManagersetPort in interface ServiceManagerport - for the connection to the service manager.public java.lang.String getWireCrypt()
AttachmentPropertiesgetWireCrypt in interface AttachmentPropertiespublic WireCrypt getWireCryptAsEnum()
ServiceManagergetWireCryptAsEnum in interface ServiceManagerpublic void setWireCryptAsEnum(WireCrypt wireCrypt)
ServiceManagersetWireCryptAsEnum in interface ServiceManagerwireCrypt - Wire encryption level (null not allowed)public java.lang.String getDbCryptConfig()
AttachmentPropertiesgetDbCryptConfig in interface AttachmentPropertiespublic void setDbCryptConfig(java.lang.String dbCryptConfig)
AttachmentPropertiessetDbCryptConfig in interface AttachmentPropertiesdbCryptConfig - Database encryption plugin configuration, meaning plugin specificpublic java.lang.String getAuthPlugins()
AttachmentPropertiesgetAuthPlugins in interface AttachmentPropertiespublic void setAuthPlugins(java.lang.String authPlugins)
AttachmentPropertiesInvalid names are skipped during authentication.
setAuthPlugins in interface AttachmentPropertiesauthPlugins - comma-separated list of authentication pluginspublic boolean isWireCompression()
AttachmentPropertiesWire 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.conf read by the client library will be used.
isWireCompression in interface AttachmentPropertiestrue wire compression enabledpublic void setWireCompression(boolean wireCompression)
AttachmentPropertiessetWireCompression in interface AttachmentPropertieswireCompression - true enable wire compression, false disable wire compression (the default)AttachmentProperties.isWireCompression()public java.lang.String getProperty(java.lang.String name)
BaseProperties
For properties with an explicit default, this method should return the string presentation of that default, not
null. For int or boolean the string equivalent is returned.
getProperty in interface BasePropertiesname - Property name (not null or empty)null when not set or not a known propertypublic void setProperty(java.lang.String name,
java.lang.String value)
BaseProperties
This method can be used to set all defined properties, but also properties not known by Jaybird. When setting
int or boolean properties, the appropriate conversions are applied. Using null will
reset to the default value. For boolean properties, an empty string is taken to mean true.
setProperty in interface BasePropertiesname - Property name (not null or empty)value - Property value (use null to apply default)public java.lang.Integer getIntProperty(java.lang.String name)
BasePropertiesint property value by name.
For properties with an explicit default, this method should return the integer presentation of that default. For
implementation simplicity, it is allowed to convert any string property to int instead of checking if
something is actually an int property
getIntProperty in interface BasePropertiesname - Property name (not null or empty)null when not setpublic void setIntProperty(java.lang.String name,
java.lang.Integer value)
BasePropertiesint property by name.
For implementation simplicity, it is allowed to also set string properties. The value set will be the string equivalent.
setIntProperty in interface BasePropertiesname - Property name (not null or empty)value - Property value (use null to apply default)public java.lang.Boolean getBooleanProperty(java.lang.String name)
BasePropertiesboolean property value by name.
For properties with an explicit default, this method should return the boolean presentation of that default. For
implementation simplicity, it is allowed to convert any string property to boolean instead of checking
if something is actually an int property
getBooleanProperty in interface BasePropertiesname - Property name (not null or empty)null when not setpublic void setBooleanProperty(java.lang.String name,
java.lang.Boolean value)
BasePropertiesboolean property by name.
For implementation simplicity, it is allowed to also set string properties. The value set will be the string equivalent.
setBooleanProperty in interface BasePropertiesname - Property name (not null or empty)value - Property value (use null to apply default)public java.util.Map<ConnectionProperty,java.lang.Object> connectionPropertyValues()
BaseProperties
Be aware, implementations can have additional properties that are not mapped from ConnectionProperty.
Such properties will need to be retrieved in an implementation-specific manner.
connectionPropertyValues in interface BasePropertiespublic java.io.OutputStream getLogger()
ServiceManagergetLogger in interface ServiceManagerpublic void setLogger(java.io.OutputStream logger)
ServiceManagersetLogger in interface ServiceManagerlogger - The out to set.public FbService attachServiceManager() throws java.sql.SQLException
java.sql.SQLExceptionprotected FbDatabase attachDatabase() throws java.sql.SQLException
java.sql.SQLExceptionpublic void queueService(FbService service) throws java.sql.SQLException, java.io.IOException
java.sql.SQLExceptionjava.io.IOException@Deprecated protected void executeServicesOperation(ServiceRequestBuffer srb) throws java.sql.SQLException
executeServicesOperation(FbService, ServiceRequestBuffer).ServiceManager's logger.srb - The buffer containing the task requestjava.sql.SQLException - if a database access error occurs or
incorrect parameters are suppliedprotected final void executeServicesOperation(FbService service, ServiceRequestBuffer srb) throws java.sql.SQLException
java.sql.SQLExceptionprotected ServiceRequestBuffer createRequestBuffer(FbService service, int operation, int options)
public GDSServerVersion getServerVersion() throws java.sql.SQLException
ServiceManagergetServerVersion in interface ServiceManagerGDSServerVersion.INVALID_VERSION if parsing
failed.java.sql.SQLException - For errors connecting to the service manager.Copyright © 2001-2023 Jaybird (Firebird JDBC) team. All rights reserved.