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 ofIAttachProperties.- 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 protectedAbstractAttachProperties()Default constructor for AbstractAttachPropertiesprotectedAbstractAttachProperties(IAttachProperties<T> src)Copy constructor for IAttachProperties.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voiddirtied()Called by setters if they have been called.java.lang.StringgetAuthPlugins()Get the list of authentication plugins to try.java.lang.StringgetCharSet()intgetConnectTimeout()Get the connect timeout in seconds.java.lang.StringgetDbCryptConfig()Get the database encryption plugin configuration.java.lang.StringgetEncoding()java.lang.StringgetPassword()intgetPortNumber()Get the portnumber of the server.java.lang.StringgetRoleName()java.lang.StringgetServerName()Get the hostname or IP address of the Firebird server.intgetSocketBufferSize()Get the socket buffer size.intgetSoTimeout()Get the initial Socket blocking timeout (SoTimeout).java.lang.StringgetUser()WireCryptgetWireCrypt()Get the wire encryption level.booleanisWireCompression()Get if wire compression should be enabled.voidsetAuthPlugins(java.lang.String authPlugins)Sets the authentication plugins to try.voidsetCharSet(java.lang.String charSet)Set the Java character set for the connection.voidsetConnectTimeout(int connectTimeout)Set the connect timeout in seconds.voidsetDbCryptConfig(java.lang.String dbCryptConfig)Sets the database encryption plugin configuration.voidsetEncoding(java.lang.String encoding)Set the Firebird character set for the connection.voidsetPassword(java.lang.String password)voidsetPortNumber(int portNumber)Set the port number of the server.voidsetRoleName(java.lang.String roleName)voidsetServerName(java.lang.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).voidsetUser(java.lang.String user)voidsetWireCompression(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, 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
IAttachPropertiesare copied fromsrcto 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: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
public void setServerName(java.lang.String serverName)
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
public java.lang.String getUser()
- Specified by:
getUserin interfaceIAttachProperties<T extends IAttachProperties<T>>- Returns:
- Name of the user to authenticate to the server.
-
setUser
public void setUser(java.lang.String user)
- Specified by:
setUserin interfaceIAttachProperties<T extends IAttachProperties<T>>- Parameters:
user- Name of the user to authenticate to the server.
-
getPassword
public java.lang.String getPassword()
- Specified by:
getPasswordin interfaceIAttachProperties<T extends IAttachProperties<T>>- Returns:
- Password to authenticate to the server.
-
setPassword
public void setPassword(java.lang.String password)
- Specified by:
setPasswordin interfaceIAttachProperties<T extends IAttachProperties<T>>- Parameters:
password- Password to authenticate to the server.
-
getRoleName
public java.lang.String getRoleName()
- Specified by:
getRoleNamein interfaceIAttachProperties<T extends IAttachProperties<T>>- Returns:
- SQL role to use.
-
setRoleName
public void setRoleName(java.lang.String roleName)
- Specified by:
setRoleNamein interfaceIAttachProperties<T extends IAttachProperties<T>>- Parameters:
roleName- SQL role to use.
-
getCharSet
public java.lang.String getCharSet()
- Specified by:
getCharSetin interfaceIAttachProperties<T extends IAttachProperties<T>>- Returns:
- Java character set for the connection.
-
setCharSet
public void setCharSet(java.lang.String charSet)
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:
IAttachProperties.setEncoding(String)
-
getEncoding
public java.lang.String getEncoding()
- Specified by:
getEncodingin interfaceIAttachProperties<T extends IAttachProperties<T>>- Returns:
- Firebird character encoding for the connection.
-
setEncoding
public void setEncoding(java.lang.String encoding)
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
public WireCrypt 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
public void setWireCrypt(WireCrypt wireCrypt)
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
public java.lang.String 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
public void setDbCryptConfig(java.lang.String dbCryptConfig)
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
public java.lang.String 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
public void setAuthPlugins(java.lang.String authPlugins)
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:
IAttachProperties.isWireCompression()
-
dirtied
protected abstract void dirtied()
Called by setters if they have been called.
-
-