Module org.firebirdsql.jaybird
Package org.firebirdsql.jaybird.props

# Interface AttachmentProperties

All Superinterfaces:
  `BaseProperties`

All Known Subinterfaces:
  `BackupManager`, `DatabaseConnectionProperties`, `EventManager`, `FBManagerMBean`, `FirebirdConnectionProperties`, `IAttachProperties<T>`, `IConnectionProperties`, `IServiceProperties`, `MaintenanceManager`, `NBackupManager`, `ServiceConnectionProperties`, `ServiceManager`, `StatisticsManager`, `TraceManager`, `UserManager`

All Known Implementing Classes:
  `AbstractAttachProperties`, `AbstractConnectionPropertiesDataSource`, `AbstractImmutableAttachProperties`, `FBAbstractCommonDataSource`, `FBBackupManager`, `FBBackupManagerBase`, `FBConnectionPoolDataSource`, `FbConnectionProperties`, `FBConnectionProperties`, `FBEventManager`, `FbImmutableConnectionProperties`, `FbImmutableServiceProperties`, `FBMaintenanceManager`, `FBManagedConnectionFactory`, `FBManager`, `FBNBackupManager`, `FBServiceManager`, `FbServiceProperties`, `FBSimpleDataSource`, `FBStatisticsManager`, `FBStreamingBackupManager`, `FBTraceManager`, `FBUserManager`, `FBXADataSource`

public interface AttachmentProperties extends BaseProperties
Attachment properties shared by database and service connections.

Since:
  5
Author:
  Mark Rotteveel

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default String`
  `getAuthPlugins()`
  Get the list of authentication plugins to try.
  `default String`
  `getCharSet()`
  Java character set configured for the connection.
  `default int`
  `getConnectTimeout()`
  Get the connect timeout in seconds.
  `default String`
  `getDbCryptConfig()`
  Get the database encryption plugin configuration.
  `default String`
  `getEnableProtocol()`
  Comma-separated list of additionally enabled protocols.
  `default String`
  `getEncoding()`
  Firebird character set configured for the connection.
  `default int`
  `getParallelWorkers()`
  `default String`
  `getPassword()`
  `default int`
  `getPortNumber()`
  Get the port number of the server.
  `default Integer`
  `getProcessId()`
  `default String`
  `getProcessName()`
  `default String`
  `getRoleName()`
  `default String`
  `getServerName()`
  Get the hostname or IP address of the Firebird server.
  `default int`
  `getSocketBufferSize()`
  Get the socket buffer size.
  `default String`
  `getSocketFactory()`
  The class name of a custom socket factory to be used for pure Java connections.
  `default int`
  `getSoTimeout()`
  Get the initial Socket blocking timeout (SoTimeout).
  `default String`
  `getType()`
  `default String`
  `getUser()`
  `default String`
  `getWireCrypt()`
  Get the wire encryption level.
  `default boolean`
  `isWireCompression()`
  Get if wire compression should be enabled.
  `default void`
  `setAuthPlugins(String authPlugins)`
  Sets the authentication plugins to try.
  `default void`
  `setCharSet(String charSet)`
  Set the Java character set for the connection.
  `default void`
  `setConnectTimeout(int connectTimeout)`
  Set the connect timeout in seconds.
  `default void`
  `setDbCryptConfig(String dbCryptConfig)`
  Sets the database encryption plugin configuration.
  `default void`
  `setEnableProtocol(String enableProtocol)`
  Comma-separated list of additionally enabled protocols.
  `default void`
  `setEncoding(String encoding)`
  Set the Firebird character set for the connection.
  `default void`
  `setParallelWorkers(int parallelWorkers)`
  Sets the number of parallel workers of the connection.
  `default void`
  `setPassword(String password)`
  `default void`
  `setPortNumber(int portNumber)`
  Set the port number of the server.
  `default void`
  `setProcessId(Integer processId)`
  Sets a custom process id to send to Firebird on attach.
  `default void`
  `setProcessName(String processName)`
  Sets a custom process name to send to Firebird on attach
  `default void`
  `setRoleName(String roleName)`
  `default void`
  `setServerName(String serverName)`
  Set the hostname or IP address of the Firebird server.
  `default void`
  `setSocketBufferSize(int socketBufferSize)`
  Set the socket buffer size.
  `default void`
  `setSocketFactory(String socketFactory)`
  Sets the class name of a custom socket factory to be used for pure Java connections.
  `default void`
  `setSoTimeout(int soTimeout)`
  Set the initial Socket blocking timeout (SoTimeout).
  `default void`
  `setType(String type)`
  `default void`
  `setUser(String user)`
  `default void`
  `setWireCompression(boolean wireCompression)`
  Sets if the connection should try to enable wire compression.
  `default void`
  `setWireCrypt(String wireCrypt)`
  Set the wire encryption level.

  ### Methods inherited from interface org.firebirdsql.jaybird.props.BaseProperties

  `connectionPropertyValues, getBooleanProperty, getBooleanProperty, getIntProperty, getIntProperty, getProperty, getProperty, setBooleanProperty, setIntProperty, setProperty`

- ## Method Details

  - ### getServerName

    default String getServerName()
    Get the hostname or IP address of the Firebird server.
    Returns:
      Hostname or IP address of the server
    See Also:
      - `setServerName(String)`

  - ### setServerName

    default void setServerName(String serverName)
    Set the hostname or IP address of the Firebird server.

    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.

    Parameters:
      `serverName` - Hostname or IP address of the server

  - ### getPortNumber

    default int getPortNumber()
    Get the port number of the server.
    Returns:
      Port number of the server
    See Also:
      - `setPortNumber(int)`

  - ### setPortNumber

    default void setPortNumber(int portNumber)
    Set the port number of the server.

    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`.

    Parameters:
      `portNumber` - Port number of the server
    See Also:
      - `setServerName(String)`

  - ### getType

    default String getType()
    Returns:
      type of the connection, for example, "PURE_JAVA", "NATIVE", "EMBEDDED", depends on the GDS implementations installed in the system.

  - ### setType

    default void setType(String type)
    Parameters:
      `type` - type of the connection, for example, "PURE_JAVA", "NATIVE", "EMBEDDED", depends on the GDS implementations installed in the system.
    Throws:
      `IllegalStateException` - may be thrown when type cannot or can no longer be changed

  - ### getUser

    default String getUser()
    Returns:
      Name of the user to authenticate to the server.

  - ### setUser

    default void setUser(String user)
    Parameters:
      `user` - Name of the user to authenticate to the server.

  - ### getPassword

    default String getPassword()
    Returns:
      Password to authenticate to the server.

  - ### setPassword

    default void setPassword(String password)
    Parameters:
      `password` - Password to authenticate to the server.

  - ### getRoleName

    default String getRoleName()
    Returns:
      SQL role to use.

  - ### setRoleName

    default void setRoleName(String roleName)
    Parameters:
      `roleName` - SQL role to use.

  - ### getCharSet

    default String getCharSet()
    Java character set configured for the connection.

    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}).

    Returns:
      Java character set for the connection (`null` when not explicitly configured).

  - ### setCharSet

    default void setCharSet(String charSet)
    Set the Java character set for the connection.

    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.

    Parameters:
      `charSet` - Character set for the connection. Similar to `encoding` property, but accepts Java names instead of Firebird ones.
    See Also:
      - `setEncoding(String)`

  - ### getEncoding

    default String getEncoding()
    Firebird character set configured for the connection.

    After connect, the actual Firebird character set applied can be obtained from `FbAttachment.getEncodingFactory()`, property `defaultEncodingDefinition.firebirdEncodingName`.

    Returns:
      Firebird character encoding for the connection (`null` when not explicitly configured).

  - ### setEncoding

    default void setEncoding(String encoding)
    Set the Firebird character set for the connection.

    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.

    Parameters:
      `encoding` - Firebird character encoding for the connection. See Firebird documentation for more information.
    See Also:
      - `setCharSet(String)`

  - ### getProcessId

    default Integer getProcessId()
    Returns:
      Custom process id sent to Firebird on attach; `null` means the default is applied (read from system property `org.firebirdsql.jdbc.pid`, future versions may also determine the actual process id)

  - ### setProcessId

    default void setProcessId(Integer processId)
    Sets a custom process id to send to Firebird on attach.
    Parameters:
      `processId` - The process id to send; `null` to apply the default behaviour (see `getProcessId()`)

  - ### getProcessName

    default String getProcessName()
    Returns:
      Custom process name sent to Firebird on attach; `null` means the default is applied (read from system property `org.firebirdsql.jdbc.processName`)

  - ### setProcessName

    default void setProcessName(String processName)
    Sets a custom process name to send to Firebird on attach
    Parameters:
      `processName` - The process name to send; `null` to apply the default behaviour (see `getProcessName()`)

  - ### getSocketBufferSize

    default int getSocketBufferSize()
    Get the socket buffer size.
    Returns:
      socket buffer size in bytes, or `-1` if not set

  - ### setSocketBufferSize

    default void setSocketBufferSize(int socketBufferSize)
    Set the socket buffer size.
    Parameters:
      `socketBufferSize` - socket buffer size in bytes.

  - ### getSoTimeout

    default int getSoTimeout()
    Get the initial Socket blocking timeout (SoTimeout).
    Returns:
      The initial socket blocking timeout in milliseconds (0 is 'infinite'), or `-1` if not set

  - ### setSoTimeout

    default void setSoTimeout(int soTimeout)
    Set the initial Socket blocking timeout (SoTimeout).
    Parameters:
      `soTimeout` - Timeout in milliseconds (0 is 'infinite')

  - ### getConnectTimeout

    default int getConnectTimeout()
    Get the connect timeout in seconds.
    Returns:
      Connect timeout in seconds (0 is 'infinite', or better: OS specific timeout), or `-1` if not set

  - ### setConnectTimeout

    default void setConnectTimeout(int connectTimeout)
    Set the connect timeout in seconds.
    Parameters:
      `connectTimeout` - Connect timeout in seconds (0 is 'infinite', or better: OS specific timeout)

  - ### getWireCrypt

    default String getWireCrypt()
    Get the wire encryption level.
    Returns:
      Wire encryption level
    Since:
      4.0

  - ### setWireCrypt

    default void setWireCrypt(String wireCrypt)
    Set the wire encryption level.

    Values are defined by `WireCrypt`, values are handled case insensitive. Invalid values will throw an exception.

    Parameters:
      `wireCrypt` - Wire encryption level (`null` not allowed)
    Throws:
      `InvalidPropertyValueException` - If the value is not one of the allowed values
    Since:
      4.0

  - ### getDbCryptConfig

    default String getDbCryptConfig()
    Get the database encryption plugin configuration.
    Returns:
      Database encryption plugin configuration, meaning plugin specific
    Since:
      3.0.4

  - ### setDbCryptConfig

    default void setDbCryptConfig(String dbCryptConfig)
    Sets the database encryption plugin configuration.
    Parameters:
      `dbCryptConfig` - Database encryption plugin configuration, meaning plugin specific
    Since:
      3.0.4

  - ### getAuthPlugins

    default String getAuthPlugins()
    Get the list of authentication plugins to try.
    Returns:
      comma-separated list of authentication plugins
    Since:
      4.0

  - ### setAuthPlugins

    default void setAuthPlugins(String authPlugins)
    Sets the authentication plugins to try.

    Invalid names are skipped during authentication.

    Parameters:
      `authPlugins` - comma-separated list of authentication plugins
    Since:
      4.0

  - ### isWireCompression

    default boolean isWireCompression()
    Get 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.conf` read by the client library will be used.

    Returns:
      `true` wire compression enabled
    Since:
      4.0

  - ### setWireCompression

    default void setWireCompression(boolean wireCompression)
    Sets if the connection should try to enable wire compression.
    Parameters:
      `wireCompression` - `true` enable wire compression, `false` disable wire compression (the default)
    Since:
      4.0
    See Also:
      - `isWireCompression()`

  - ### getEnableProtocol

    default String getEnableProtocol()
    Comma-separated list of additionally enabled protocols.

    By default, pure Java connections of Jaybird only supports the protocol versions of supported Firebird versions. This property lists the additionally enabled unsupported protocol versions. If Jaybird does not have a listed protocol, it is silently ignored.

    This property is ignored for native connections.

    Returns:
      List of unsupported protocol versions to try in addition to the supported protocols. Comma-separated using only the version number (e.g. `"10,11"`). Both the unmasked and masked version are supported (e.g. `32780` for protocol `12`), but we recommend to use the unmasked version. The value `"*"` will try all available protocols.
    Since:
      6

  - ### setEnableProtocol

    default void setEnableProtocol(String enableProtocol)
    Comma-separated list of additionally enabled protocols.
    Parameters:
      `enableProtocol` - List of unsupported protocol versions to try in addition to the supported protocols.
    Since:
      6
    See Also:
      - `getEnableProtocol()`

  - ### getParallelWorkers

    default int getParallelWorkers()
    Returns:
      number of parallel workers, `-1` means no value was set (or it was explicitly set to `-1`)
    Since:
      5.0.2

  - ### setParallelWorkers

    default void setParallelWorkers(int parallelWorkers)
    Sets the number of parallel workers of the connection.

    Requires Firebird 5.0 or higher, and a Firebird server configured with `MaxParallelWorkers` higher than specified by `parallelWorkers`.

    NOTE: For service attachments, this property controls behaviour only for specific operations, and requires Jaybird to explicitly set the parallel workers for that operation.

    Parameters:
      `parallelWorkers` - number of parallel workers
    Since:
      5.0.2

  - ### getSocketFactory

    default String getSocketFactory()
    The class name of a custom socket factory to be used for pure Java connections.
    Returns:
      fully-qualified class name of a `SocketFactory` implementation, or (default) `null` for the default socket factory
    Since:
      6
    See Also:
      - `setSocketFactory(String)`

  - ### setSocketFactory

    default void setSocketFactory(String socketFactory)
    Sets the class name of a custom socket factory to be used for pure Java connections.

    The class must extend `SocketFactory` and have a public single-arg constructor accepting a `Properties`, or a public no-arg constructor. The `Properties` object passed in the first case contains custom connection properties with the suffix `@socketFactory`, and — possibly — other selected properties.

    Parameters:
      `socketFactory` - fully-qualified class name of a `SocketFactory` implementation, or `null` for the default socket factory
    Since:
      6