Package org.firebirdsql.gds.ng

## Class AbstractAttachProperties<T extends IAttachProperties<T>>

- java.lang.Object
- - org.firebirdsql.gds.ng.AbstractAttachProperties<T>

- All Implemented Interfaces:
    `IAttachProperties<T>`
  Direct Known Subclasses:
    `FbConnectionProperties`, `FbServiceProperties`

      public abstract class AbstractAttachProperties<T extends IAttachProperties<T>>
      extends java.lang.Object
      implements IAttachProperties<T>

  Abstract mutable implementation of `IAttachProperties`.
  Since:
    3.0
  Author:
    Mark Rotteveel

- - ### Field Summary

    - ### Fields inherited from interface org.firebirdsql.gds.ng.IAttachProperties

      `DEFAULT_CONNECT_TIMEOUT, DEFAULT_PORT, DEFAULT_SERVER_NAME, DEFAULT_SO_TIMEOUT, DEFAULT_SOCKET_BUFFER_SIZE`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `AbstractAttachProperties()` | Default constructor for AbstractAttachProperties
    `protected` | `AbstractAttachProperties​(IAttachProperties<T> src)` | Copy constructor for IAttachProperties.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected abstract void` | `dirtied()` | Called by setters if they have been called.
    `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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.firebirdsql.gds.ng.IAttachProperties

      `asImmutable, asNewMutable, getAttachObjectName`

- - ### Constructor Detail

    - #### AbstractAttachProperties

          protected AbstractAttachProperties​(IAttachProperties<T> src)

      Copy constructor for IAttachProperties.

      All properties defined in `IAttachProperties` are copied from `src` to the new instance.

      Parameters:
        `src` - Source to copy from

    - #### AbstractAttachProperties

          protected AbstractAttachProperties()

      Default constructor for AbstractAttachProperties

  - ### Method Detail

    - #### getServerName

          public java.lang.String getServerName()

      Description copied from interface: `IAttachProperties`
      Get the hostname or IP address of the Firebird server.

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

      Specified by:
        `getServerName` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Returns:
        Hostname or IP address of the server

    - #### setServerName

          public void setServerName​(java.lang.String serverName)

      Description copied from interface: `IAttachProperties`
      Set the hostname or IP address of the Firebird server.

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

      Specified by:
        `setServerName` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Parameters:
        `serverName` - Hostname or IP address of the server

    - #### getPortNumber

          public int getPortNumber()

      Description copied from interface: `IAttachProperties`
      Get the portnumber of the server.

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

      Specified by:
        `getPortNumber` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Returns:
        Portnumber of the server

    - #### setPortNumber

          public void setPortNumber​(int portNumber)

      Description copied from interface: `IAttachProperties`
      Set the port number of the server.

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

      Specified by:
        `setPortNumber` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Parameters:
        `portNumber` - Port number of the server

    - #### getUser

          public java.lang.String getUser()

      Specified by:
        `getUser` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Returns:
        Name of the user to authenticate to the server.

    - #### setUser

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

      Specified by:
        `setUser` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Parameters:
        `user` - Name of the user to authenticate to the server.

    - #### getPassword

          public java.lang.String getPassword()

      Specified by:
        `getPassword` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Returns:
        Password to authenticate to the server.

    - #### setPassword

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

      Specified by:
        `setPassword` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Parameters:
        `password` - Password to authenticate to the server.

    - #### getRoleName

          public java.lang.String getRoleName()

      Specified by:
        `getRoleName` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Returns:
        SQL role to use.

    - #### setRoleName

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

      Specified by:
        `setRoleName` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Parameters:
        `roleName` - SQL role to use.

    - #### getCharSet

          public java.lang.String getCharSet()

      Specified by:
        `getCharSet` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Returns:
        Java character set for the connection.

    - #### setCharSet

          public void setCharSet​(java.lang.String charSet)

      Description copied from interface: `IAttachProperties`
      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.

      Specified by:
        `setCharSet` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Parameters:
        `charSet` - Character set for the connection. Similar to `encoding` property, but accepts Java names instead of Firebird ones.
      See Also:
        `IAttachProperties.setEncoding(String)`

    - #### getEncoding

          public java.lang.String getEncoding()

      Specified by:
        `getEncoding` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Returns:
        Firebird character encoding for the connection.

    - #### setEncoding

          public void setEncoding​(java.lang.String encoding)

      Description copied from interface: `IAttachProperties`
      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.

      Specified by:
        `setEncoding` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Parameters:
        `encoding` - Firebird character encoding for the connection. See Firebird documentation for more information.

    - #### getSocketBufferSize

          public int getSocketBufferSize()

      Description copied from interface: `IAttachProperties`
      Get the socket buffer size.

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

      Specified by:
        `getSocketBufferSize` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Returns:
        socket buffer size in bytes, or -1 if not specified.

    - #### setSocketBufferSize

          public void setSocketBufferSize​(int socketBufferSize)

      Description copied from interface: `IAttachProperties`
      Set the socket buffer size.

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

      Specified by:
        `setSocketBufferSize` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Parameters:
        `socketBufferSize` - socket buffer size in bytes.

    - #### getSoTimeout

          public int getSoTimeout()

      Description copied from interface: `IAttachProperties`
      Get the initial Socket blocking timeout (SoTimeout).

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

      Specified by:
        `getSoTimeout` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Returns:
        The initial socket blocking timeout in milliseconds (0 is 'infinite')

    - #### setSoTimeout

          public void setSoTimeout​(int soTimeout)

      Description copied from interface: `IAttachProperties`
      Set the initial Socket blocking timeout (SoTimeout).

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

      Specified by:
        `setSoTimeout` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Parameters:
        `soTimeout` - Timeout in milliseconds (0 is 'infinite')

    - #### getConnectTimeout

          public int getConnectTimeout()

      Description copied from interface: `IAttachProperties`
      Get the connect timeout in seconds.

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

      Specified by:
        `getConnectTimeout` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Returns:
        Connect timeout in seconds (0 is 'infinite', or better: OS specific timeout)

    - #### setConnectTimeout

          public void setConnectTimeout​(int connectTimeout)

      Description copied from interface: `IAttachProperties`
      Set the connect timeout in seconds.

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

      Specified by:
        `setConnectTimeout` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Parameters:
        `connectTimeout` - Connect timeout in seconds (0 is 'infinite', or better: OS specific timeout)

    - #### getWireCrypt

          public WireCrypt getWireCrypt()

      Description copied from interface: `IAttachProperties`
      Get the wire encryption level.

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

      Specified by:
        `getWireCrypt` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Returns:
        Wire encryption level

    - #### setWireCrypt

          public void setWireCrypt​(WireCrypt wireCrypt)

      Description copied from interface: `IAttachProperties`
      Set the wire encryption level.

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

      Specified by:
        `setWireCrypt` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Parameters:
        `wireCrypt` - Wire encryption level (`null` not allowed)

    - #### getDbCryptConfig

          public java.lang.String getDbCryptConfig()

      Description copied from interface: `IAttachProperties`
      Get the database encryption plugin configuration.
      Specified by:
        `getDbCryptConfig` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Returns:
        Database encryption plugin configuration, meaning plugin specific

    - #### setDbCryptConfig

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

      Description copied from interface: `IAttachProperties`
      Sets the database encryption plugin configuration.
      Specified by:
        `setDbCryptConfig` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Parameters:
        `dbCryptConfig` - Database encryption plugin configuration, meaning plugin specific

    - #### getAuthPlugins

          public java.lang.String getAuthPlugins()

      Description copied from interface: `IAttachProperties`
      Get the list of authentication plugins to try.
      Specified by:
        `getAuthPlugins` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Returns:
        comma-separated list of authentication plugins, or `null` for driver default

    - #### setAuthPlugins

          public void setAuthPlugins​(java.lang.String authPlugins)

      Description copied from interface: `IAttachProperties`
      Sets the authentication plugins to try.

      Invalid names are skipped during authentication.

      Specified by:
        `setAuthPlugins` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Parameters:
        `authPlugins` - comma-separated list of authentication plugins, or `null` for driver default

    - #### isWireCompression

          public boolean isWireCompression()

      Description copied from interface: `IAttachProperties`
      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.

      Specified by:
        `isWireCompression` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Returns:
        `true` wire compression enabled

    - #### setWireCompression

          public void setWireCompression​(boolean wireCompression)

      Description copied from interface: `IAttachProperties`
      Sets if the connection should try to enable wire compression.
      Specified by:
        `setWireCompression` in interface `IAttachProperties<T extends IAttachProperties<T>>`
      Parameters:
        `wireCompression` - `true` enable wire compression, `false` disable wire compression (the default)
      See Also:
        `IAttachProperties.isWireCompression()`

    - #### dirtied

          protected abstract void dirtied()

      Called by setters if they have been called.