Package org.firebirdsql.jaybird.props

## Interface AttachmentProperties

- All Superinterfaces:
    `BaseProperties`
  All Known Subinterfaces:
    `BackupManager`, `DatabaseConnectionProperties`, `EventManager`, `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`, `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

    All Methods Instance Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `default java.lang.String` | `getAuthPlugins()` | Get the list of authentication plugins to try.
    `default java.lang.String` | `getCharSet()` | Java character set configured for the connection.
    `default int` | `getConnectTimeout()` | Get the connect timeout in seconds.
    `default java.lang.String` | `getDbCryptConfig()` | Get the database encryption plugin configuration.
    `default java.lang.String` | `getEncoding()` | Firebird character set configured for the connection.
    `default java.lang.String` | `getPassword()` |
    `default int` | `getPortNumber()` | Get the port number of the server.
    `default java.lang.Integer` | `getProcessId()` |
    `default java.lang.String` | `getProcessName()` |
    `default java.lang.String` | `getRoleName()` |
    `default java.lang.String` | `getServerName()` | Get the hostname or IP address of the Firebird server.
    `default int` | `getSocketBufferSize()` | Get the socket buffer size.
    `default int` | `getSoTimeout()` | Get the initial Socket blocking timeout (SoTimeout).
    `default java.lang.String` | `getType()` |
    `default java.lang.String` | `getUser()` |
    `default java.lang.String` | `getWireCrypt()` | Get the wire encryption level.
    `default boolean` | `isWireCompression()` | Get if wire compression should be enabled.
    `default void` | `setAuthPlugins​(java.lang.String authPlugins)` | Sets the authentication plugins to try.
    `default void` | `setCharSet​(java.lang.String charSet)` | Set the Java character set for the connection.
    `default void` | `setConnectTimeout​(int connectTimeout)` | Set the connect timeout in seconds.
    `default void` | `setDbCryptConfig​(java.lang.String dbCryptConfig)` | Sets the database encryption plugin configuration.
    `default void` | `setEncoding​(java.lang.String encoding)` | Set the Firebird character set for the connection.
    `default void` | `setPassword​(java.lang.String password)` |
    `default void` | `setPortNumber​(int portNumber)` | Set the port number of the server.
    `default void` | `setProcessId​(java.lang.Integer processId)` | Sets a custom process id to send to Firebird on attach.
    `default void` | `setProcessName​(java.lang.String processName)` | Sets a custom process name to send to Firebird on attach
    `default void` | `setRoleName​(java.lang.String roleName)` |
    `default void` | `setServerName​(java.lang.String serverName)` | Set the hostname or IP address of the Firebird server.
    `default void` | `setSocketBufferSize​(int socketBufferSize)` | Set the socket buffer size.
    `default void` | `setSoTimeout​(int soTimeout)` | Set the initial Socket blocking timeout (SoTimeout).
    `default void` | `setType​(java.lang.String type)` |
    `default void` | `setUser​(java.lang.String user)` |
    `default void` | `setWireCompression​(boolean wireCompression)` | Sets if the connection should try to enable wire compression.
    `default void` | `setWireCrypt​(java.lang.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 Detail

    - #### getServerName

          default java.lang.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​(java.lang.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 java.lang.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​(java.lang.String type)

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

    - #### getUser

          default java.lang.String getUser()

      Returns:
        Name of the user to authenticate to the server.

    - #### setUser

          default void setUser​(java.lang.String user)

      Parameters:
        `user` - Name of the user to authenticate to the server.

    - #### getPassword

          default java.lang.String getPassword()

      Returns:
        Password to authenticate to the server.

    - #### setPassword

          default void setPassword​(java.lang.String password)

      Parameters:
        `password` - Password to authenticate to the server.

    - #### getRoleName

          default java.lang.String getRoleName()

      Returns:
        SQL role to use.

    - #### setRoleName

          default void setRoleName​(java.lang.String roleName)

      Parameters:
        `roleName` - SQL role to use.

    - #### getCharSet

          default java.lang.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​(java.lang.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 java.lang.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​(java.lang.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 java.lang.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​(java.lang.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 java.lang.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​(java.lang.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 java.lang.String getWireCrypt()

      Get the wire encryption level.
      Returns:
        Wire encryption level
      Since:
        4.0

    - #### setWireCrypt

          default void setWireCrypt​(java.lang.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 java.lang.String getDbCryptConfig()

      Get the database encryption plugin configuration.
      Returns:
        Database encryption plugin configuration, meaning plugin specific
      Since:
        3.0.4

    - #### setDbCryptConfig

          default void setDbCryptConfig​(java.lang.String dbCryptConfig)

      Sets the database encryption plugin configuration.
      Parameters:
        `dbCryptConfig` - Database encryption plugin configuration, meaning plugin specific
      Since:
        3.0.4

    - #### getAuthPlugins

          default java.lang.String getAuthPlugins()

      Get the list of authentication plugins to try.
      Returns:
        comma-separated list of authentication plugins
      Since:
        4.0

    - #### setAuthPlugins

          default void setAuthPlugins​(java.lang.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()`