Class AbstractImmutableAttachProperties<T extends IAttachProperties<T>>
- All Implemented Interfaces:
IAttachProperties<T>
- Direct Known Subclasses:
FbImmutableConnectionProperties,FbImmutableServiceProperties
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
ConstructorsModifierConstructorDescriptionprotectedCopy constructor for IAttachProperties. -
Method Summary
Modifier and TypeMethodDescriptionGet the list of authentication plugins to try.intGet the connect timeout in seconds.Get the database encryption plugin configuration.intGet the portnumber of the server.Get the hostname or IP address of the Firebird server.intGet the socket buffer size.intGet the initial Socket blocking timeout (SoTimeout).getUser()Get the wire encryption level.protected final voidThrows an UnsupportedOperationExceptionbooleanGet if wire compression should be enabled.voidsetAuthPlugins(String authPlugins) Sets the authentication plugins to try.voidsetCharSet(String charSet) Set the Java character set for the connection.voidsetConnectTimeout(int connectTimeout) Set the connect timeout in seconds.voidsetDbCryptConfig(String dbCryptConfig) Sets the database encryption plugin configuration.voidsetEncoding(String encoding) Set the Firebird character set for the connection.voidsetPassword(String password) voidsetPortNumber(int portNumber) Set the port number of the server.voidsetRoleName(String roleName) voidsetServerName(String serverName) Set the hostname or IP address of the Firebird server.voidsetSocketBufferSize(int socketBufferSize) Set the socket buffer size.voidsetSoTimeout(int soTimeout) Set the initial Socket blocking timeout (SoTimeout).voidvoidsetWireCompression(boolean wireCompression) Sets if the connection should try to enable wire compression.voidsetWireCrypt(WireCrypt wireCrypt) Set the wire encryption level.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.firebirdsql.gds.ng.IAttachProperties
asImmutable, asNewMutable, getAttachObjectName
-
Constructor Details
-
AbstractImmutableAttachProperties
Copy constructor for IAttachProperties.All properties defined in
IAttachPropertiesare copied fromsrcto the new instance.- Parameters:
src- Source to copy from
-
-
Method Details
-
getServerName
Description copied from interface:IAttachPropertiesGet the hostname or IP address of the Firebird server.NOTE: Implementer should take care to return
IAttachProperties.DEFAULT_SERVER_NAMEif value hasn't been set yet.- Specified by:
getServerNamein interfaceIAttachProperties<T extends IAttachProperties<T>>- Returns:
- Hostname or IP address of the server
-
setServerName
Description copied from interface:IAttachPropertiesSet the hostname or IP address of the Firebird server.NOTE: Implementer should take care to use
IAttachProperties.DEFAULT_SERVER_NAMEif value hasn't been set yet.- Specified by:
setServerNamein interfaceIAttachProperties<T extends IAttachProperties<T>>- Parameters:
serverName- Hostname or IP address of the server
-
getPortNumber
public int getPortNumber()Description copied from interface:IAttachPropertiesGet the portnumber of the server.NOTE: Implementer should take care to return
IAttachProperties.DEFAULT_PORTif value hasn't been set yet.- Specified by:
getPortNumberin interfaceIAttachProperties<T extends IAttachProperties<T>>- Returns:
- Portnumber of the server
-
setPortNumber
public void setPortNumber(int portNumber) Description copied from interface:IAttachPropertiesSet the port number of the server.NOTE: Implementer should take care to use the
IAttachProperties.DEFAULT_PORTif this method hasn't been called yet.- Specified by:
setPortNumberin interfaceIAttachProperties<T extends IAttachProperties<T>>- Parameters:
portNumber- Port number of the server
-
getUser
- Specified by:
getUserin interfaceIAttachProperties<T extends IAttachProperties<T>>- Returns:
- Name of the user to authenticate to the server.
-
setUser
- Specified by:
setUserin interfaceIAttachProperties<T extends IAttachProperties<T>>- Parameters:
user- Name of the user to authenticate to the server.
-
getPassword
- Specified by:
getPasswordin interfaceIAttachProperties<T extends IAttachProperties<T>>- Returns:
- Password to authenticate to the server.
-
setPassword
- Specified by:
setPasswordin interfaceIAttachProperties<T extends IAttachProperties<T>>- Parameters:
password- Password to authenticate to the server.
-
getRoleName
- Specified by:
getRoleNamein interfaceIAttachProperties<T extends IAttachProperties<T>>- Returns:
- SQL role to use.
-
setRoleName
- Specified by:
setRoleNamein interfaceIAttachProperties<T extends IAttachProperties<T>>- Parameters:
roleName- SQL role to use.
-
getCharSet
- Specified by:
getCharSetin interfaceIAttachProperties<T extends IAttachProperties<T>>- Returns:
- Java character set for the connection.
-
setCharSet
Description copied from interface:IAttachPropertiesSet the Java character set for the connection.Contrary to other parts of the codebase, the value of
encodingshould not be changed whencharSetis set.- Specified by:
setCharSetin interfaceIAttachProperties<T extends IAttachProperties<T>>- Parameters:
charSet- Character set for the connection. Similar toencodingproperty, but accepts Java names instead of Firebird ones.- See Also:
-
getEncoding
- Specified by:
getEncodingin interfaceIAttachProperties<T extends IAttachProperties<T>>- Returns:
- Firebird character encoding for the connection.
-
setEncoding
Description copied from interface:IAttachPropertiesSet the Firebird character set for the connection.Contrary to other parts of the codebase, the value of
charSetshould not be changed whenencodingis set.- Specified by:
setEncodingin interfaceIAttachProperties<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:IAttachPropertiesGet the socket buffer size.NOTE: Implementer should take care to return
IAttachProperties.DEFAULT_SOCKET_BUFFER_SIZEif the value hasn't been set yet.- Specified by:
getSocketBufferSizein interfaceIAttachProperties<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:IAttachPropertiesSet the socket buffer size.NOTE: Implementer should take care to use
IAttachProperties.DEFAULT_SOCKET_BUFFER_SIZEif the value hasn't been set yet.- Specified by:
setSocketBufferSizein interfaceIAttachProperties<T extends IAttachProperties<T>>- Parameters:
socketBufferSize- socket buffer size in bytes.
-
getSoTimeout
public int getSoTimeout()Description copied from interface:IAttachPropertiesGet the initial Socket blocking timeout (SoTimeout).NOTE: Implementer should take care to return
IAttachProperties.DEFAULT_SO_TIMEOUTif the value hasn't been set yet.- Specified by:
getSoTimeoutin interfaceIAttachProperties<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:IAttachPropertiesSet the initial Socket blocking timeout (SoTimeout).NOTE: Implementer should take care to use
IAttachProperties.DEFAULT_SO_TIMEOUTif the value hasn't been set yet.- Specified by:
setSoTimeoutin interfaceIAttachProperties<T extends IAttachProperties<T>>- Parameters:
soTimeout- Timeout in milliseconds (0 is 'infinite')
-
getConnectTimeout
public int getConnectTimeout()Description copied from interface:IAttachPropertiesGet the connect timeout in seconds.NOTE: Implementer should take care to return
IAttachProperties.DEFAULT_CONNECT_TIMEOUTif the value hasn't been set yet.- Specified by:
getConnectTimeoutin interfaceIAttachProperties<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:IAttachPropertiesSet the connect timeout in seconds.NOTE: Implementer should take care to use
IAttachProperties.DEFAULT_CONNECT_TIMEOUTif the value hasn't been set yet.- Specified by:
setConnectTimeoutin interfaceIAttachProperties<T extends IAttachProperties<T>>- Parameters:
connectTimeout- Connect timeout in seconds (0 is 'infinite', or better: OS specific timeout)
-
getWireCrypt
Description copied from interface:IAttachPropertiesGet the wire encryption level.NOTE: Implementer should take care to return
WireCrypt.DEFAULTif the value hasn't been set yet.- Specified by:
getWireCryptin interfaceIAttachProperties<T extends IAttachProperties<T>>- Returns:
- Wire encryption level
-
setWireCrypt
Description copied from interface:IAttachPropertiesSet the wire encryption level.NOTE: Implementer should take care to use
WireCrypt.DEFAULTif the value hasn't been set yet.- Specified by:
setWireCryptin interfaceIAttachProperties<T extends IAttachProperties<T>>- Parameters:
wireCrypt- Wire encryption level (nullnot allowed)
-
getDbCryptConfig
Description copied from interface:IAttachPropertiesGet the database encryption plugin configuration.- Specified by:
getDbCryptConfigin interfaceIAttachProperties<T extends IAttachProperties<T>>- Returns:
- Database encryption plugin configuration, meaning plugin specific
-
setDbCryptConfig
Description copied from interface:IAttachPropertiesSets the database encryption plugin configuration.- Specified by:
setDbCryptConfigin interfaceIAttachProperties<T extends IAttachProperties<T>>- Parameters:
dbCryptConfig- Database encryption plugin configuration, meaning plugin specific
-
getAuthPlugins
Description copied from interface:IAttachPropertiesGet the list of authentication plugins to try.- Specified by:
getAuthPluginsin interfaceIAttachProperties<T extends IAttachProperties<T>>- Returns:
- comma-separated list of authentication plugins, or
nullfor driver default
-
setAuthPlugins
Description copied from interface:IAttachPropertiesSets the authentication plugins to try.Invalid names are skipped during authentication.
- Specified by:
setAuthPluginsin interfaceIAttachProperties<T extends IAttachProperties<T>>- Parameters:
authPlugins- comma-separated list of authentication plugins, ornullfor driver default
-
isWireCompression
public boolean isWireCompression()Description copied from interface:IAttachPropertiesGet 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.confread by the client library will be used.- Specified by:
isWireCompressionin interfaceIAttachProperties<T extends IAttachProperties<T>>- Returns:
truewire compression enabled
-
setWireCompression
public void setWireCompression(boolean wireCompression) Description copied from interface:IAttachPropertiesSets if the connection should try to enable wire compression.- Specified by:
setWireCompressionin interfaceIAttachProperties<T extends IAttachProperties<T>>- Parameters:
wireCompression-trueenable wire compression,falsedisable wire compression (the default)- See Also:
-
immutable
protected final void immutable()Throws an UnsupportedOperationException
-