Package org.firebirdsql.gds.ng

## Interface IAttachProperties<T extends IAttachProperties>

- All Known Subinterfaces:
    `IConnectionProperties`, `IServiceProperties`
  All Known Implementing Classes:
    `AbstractAttachProperties`, `AbstractImmutableAttachProperties`, `FbConnectionProperties`, `FbImmutableConnectionProperties`, `FbImmutableServiceProperties`, `FbServiceProperties`

      public interface IAttachProperties<T extends IAttachProperties>

  Common properties for database and service attach.
  Since:
    3.0
  Author:
    Mark Rotteveel

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static int` | `DEFAULT_CONNECT_TIMEOUT` |
    `static int` | `DEFAULT_PORT` |
    `static java.lang.String` | `DEFAULT_SERVER_NAME` |
    `static int` | `DEFAULT_SO_TIMEOUT` |
    `static int` | `DEFAULT_SOCKET_BUFFER_SIZE` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `T` | `asImmutable()` |
    `T` | `asNewMutable()` |
    `java.lang.String` | `getAttachObjectName()` |
    `java.lang.String` | `getAuthPlugins()` | Get the list of authentication plugins to try.
    `java.lang.String` | `getCharSet()` |
    `int` | `getConnectTimeout()` | Get the connect timeout in seconds.
    `java.lang.String` | `getDbCryptConfig()` | Get the database encryption plugin configuration.
    `java.lang.String` | `getEncoding()` |
    `java.lang.String` | `getPassword()` |
    `int` | `getPortNumber()` | Get the portnumber of the server.
    `java.lang.String` | `getRoleName()` |
    `java.lang.String` | `getServerName()` | Get the hostname or IP address of the Firebird server.
    `int` | `getSocketBufferSize()` | Get the socket buffer size.
    `int` | `getSoTimeout()` | Get the initial Socket blocking timeout (SoTimeout).
    `java.lang.String` | `getUser()` |
    `WireCrypt` | `getWireCrypt()` | Get the wire encryption level.
    `boolean` | `isWireCompression()` | Get if wire compression should be enabled.
    `void` | `setAuthPlugins​(java.lang.String authPlugins)` | Sets the authentication plugins to try.
    `void` | `setCharSet​(java.lang.String charSet)` | Set the Java character set for the connection.
    `void` | `setConnectTimeout​(int connectTimeout)` | Set the connect timeout in seconds.
    `void` | `setDbCryptConfig​(java.lang.String dbCryptConfig)` | Sets the database encryption plugin configuration.
    `void` | `setEncoding​(java.lang.String encoding)` | Set the Firebird character set for the connection.
    `void` | `setPassword​(java.lang.String password)` |
    `void` | `setPortNumber​(int portNumber)` | Set the port number of the server.
    `void` | `setRoleName​(java.lang.String roleName)` |
    `void` | `setServerName​(java.lang.String serverName)` | Set the hostname or IP address of the Firebird server.
    `void` | `setSocketBufferSize​(int socketBufferSize)` | Set the socket buffer size.
    `void` | `setSoTimeout​(int soTimeout)` | Set the initial Socket blocking timeout (SoTimeout).
    `void` | `setUser​(java.lang.String user)` |
    `void` | `setWireCompression​(boolean wireCompression)` | Sets if the connection should try to enable wire compression.
    `void` | `setWireCrypt​(WireCrypt wireCrypt)` | Set the wire encryption level.

- - ### Field Detail

    - #### DEFAULT_PORT

          static final int DEFAULT_PORT

      See Also:
        Constant Field Values

    - #### DEFAULT_SERVER_NAME

          static final java.lang.String DEFAULT_SERVER_NAME

      See Also:
        Constant Field Values

    - #### DEFAULT_SOCKET_BUFFER_SIZE

          static final int DEFAULT_SOCKET_BUFFER_SIZE

      See Also:
        Constant Field Values

    - #### DEFAULT_SO_TIMEOUT

          static final int DEFAULT_SO_TIMEOUT

      See Also:
        Constant Field Values

    - #### DEFAULT_CONNECT_TIMEOUT

          static final int DEFAULT_CONNECT_TIMEOUT

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getAttachObjectName

          java.lang.String getAttachObjectName()

      Returns:
        The name of the object to attach to (either a database or service name).

    - #### getServerName

          java.lang.String getServerName()

      Get the hostname or IP address of the Firebird server.

      NOTE: Implementer should take care to return `DEFAULT_SERVER_NAME` if value hasn't been set yet.

      Returns:
        Hostname or IP address of the server

    - #### setServerName

          void setServerName​(java.lang.String serverName)

      Set the hostname or IP address of the Firebird server.

      NOTE: Implementer should take care to use `DEFAULT_SERVER_NAME` if value hasn't been set yet.

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

    - #### getPortNumber

          int getPortNumber()

      Get the portnumber of the server.

      NOTE: Implementer should take care to return `DEFAULT_PORT` if value hasn't been set yet.

      Returns:
        Portnumber of the server

    - #### setPortNumber

          void setPortNumber​(int portNumber)

      Set the port number of the server.

      NOTE: Implementer should take care to use the `DEFAULT_PORT` if this method hasn't been called yet.

      Parameters:
        `portNumber` - Port number of the server

    - #### getUser

          java.lang.String getUser()

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

    - #### setUser

          void setUser​(java.lang.String user)

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

    - #### getPassword

          java.lang.String getPassword()

      Returns:
        Password to authenticate to the server.

    - #### setPassword

          void setPassword​(java.lang.String password)

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

    - #### getRoleName

          java.lang.String getRoleName()

      Returns:
        SQL role to use.

    - #### setRoleName

          void setRoleName​(java.lang.String roleName)

      Parameters:
        `roleName` - SQL role to use.

    - #### getCharSet

          java.lang.String getCharSet()

      Returns:
        Java character set for the connection.

    - #### setCharSet

          void setCharSet​(java.lang.String charSet)

      Set the Java character set for the connection.

      Contrary to other parts of the codebase, the value of `encoding` should not be changed when `charSet` is 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

          java.lang.String getEncoding()

      Returns:
        Firebird character encoding for the connection.

    - #### setEncoding

          void setEncoding​(java.lang.String encoding)

      Set the Firebird character set for the connection.

      Contrary to other parts of the codebase, the value of `charSet` should not be changed when `encoding` is set.

      Parameters:
        `encoding` - Firebird character encoding for the connection. See Firebird documentation for more information.

    - #### getSocketBufferSize

          int getSocketBufferSize()

      Get the socket buffer size.

      NOTE: Implementer should take care to return `DEFAULT_SOCKET_BUFFER_SIZE` if the value hasn't been set yet.

      Returns:
        socket buffer size in bytes, or -1 if not specified.

    - #### setSocketBufferSize

          void setSocketBufferSize​(int socketBufferSize)

      Set the socket buffer size.

      NOTE: Implementer should take care to use `DEFAULT_SOCKET_BUFFER_SIZE` if the value hasn't been set yet.

      Parameters:
        `socketBufferSize` - socket buffer size in bytes.

    - #### getSoTimeout

          int getSoTimeout()

      Get the initial Socket blocking timeout (SoTimeout).

      NOTE: Implementer should take care to return `DEFAULT_SO_TIMEOUT` if the value hasn't been set yet.

      Returns:
        The initial socket blocking timeout in milliseconds (0 is 'infinite')

    - #### setSoTimeout

          void setSoTimeout​(int soTimeout)

      Set the initial Socket blocking timeout (SoTimeout).

      NOTE: Implementer should take care to use `DEFAULT_SO_TIMEOUT` if the value hasn't been set yet.

      Parameters:
        `soTimeout` - Timeout in milliseconds (0 is 'infinite')

    - #### getConnectTimeout

          int getConnectTimeout()

      Get the connect timeout in seconds.

      NOTE: Implementer should take care to return `DEFAULT_CONNECT_TIMEOUT` if the value hasn't been set yet.

      Returns:
        Connect timeout in seconds (0 is 'infinite', or better: OS specific timeout)

    - #### setConnectTimeout

          void setConnectTimeout​(int connectTimeout)

      Set the connect timeout in seconds.

      NOTE: Implementer should take care to use `DEFAULT_CONNECT_TIMEOUT` if the value hasn't been set yet.

      Parameters:
        `connectTimeout` - Connect timeout in seconds (0 is 'infinite', or better: OS specific timeout)

    - #### getWireCrypt

          WireCrypt getWireCrypt()

      Get the wire encryption level.

      NOTE: Implementer should take care to return `WireCrypt.DEFAULT` if the value hasn't been set yet.

      Returns:
        Wire encryption level
      Since:
        4.0

    - #### setWireCrypt

          void setWireCrypt​(WireCrypt wireCrypt)

      Set the wire encryption level.

      NOTE: Implementer should take care to use `WireCrypt.DEFAULT` if the value hasn't been set yet.

      Parameters:
        `wireCrypt` - Wire encryption level (`null` not allowed)
      Since:
        4.0

    - #### getDbCryptConfig

          java.lang.String getDbCryptConfig()

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

    - #### setDbCryptConfig

          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

          java.lang.String getAuthPlugins()

      Get the list of authentication plugins to try.
      Returns:
        comma-separated list of authentication plugins, or `null` for driver default
      Since:
        4.0

    - #### setAuthPlugins

          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, or `null` for driver default
      Since:
        4.0

    - #### isWireCompression

          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

          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()`

    - #### asImmutable

          T asImmutable()

      Returns:
        An immutable version of this instance as an implementation of `IAttachProperties`

    - #### asNewMutable

          T asNewMutable()

      Returns:
        A new, mutable, instance as an implementation of `IAttachProperties` with all properties copied.