Class AbstractAttachProperties<T extends IAttachProperties<T>>
- All Implemented Interfaces:
IAttachProperties<T>,AttachmentProperties,BaseProperties
- Direct Known Subclasses:
FbConnectionProperties,FbServiceProperties
IAttachProperties.- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceProperty update listener. -
Field Summary
Fields inherited from interface org.firebirdsql.gds.ng.IAttachProperties
DEFAULT_CONNECT_TIMEOUT, DEFAULT_SO_TIMEOUT, DEFAULT_SOCKET_BUFFER_SIZE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor for AbstractAttachPropertiesprotectedCopy constructor for IAttachProperties. -
Method Summary
Modifier and TypeMethodDescriptionfinal Map<ConnectionProperty,Object> An unmodifiable view on the connection properties held by this BaseProperties implementation.protected abstract voiddirtied()Called by setters if they have been called.booleanfinal BooleangetBooleanProperty(String name) Retrieves abooleanproperty value by name.final IntegergetIntProperty(String name) Retrieves anintproperty value by name.final StringgetProperty(String name) Retrieves a string property value by name.inthashCode()final booleanprotected final ConnectionPropertyReturns the property of the specified name.voidRegisters an update listener that is notified when a connection property is modified.protected ObjectresolveStoredDefaultValue(ConnectionProperty property) Resolve the default value for the specified connection property.final voidsetBooleanProperty(String name, Boolean value) Sets abooleanproperty by name.final voidsetIntProperty(String name, Integer value) Sets anintproperty by name.final voidsetProperty(String name, String value) Sets a property by name.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.firebirdsql.jaybird.props.AttachmentProperties
getAuthPlugins, getCharSet, getConnectTimeout, getDbCryptConfig, getEnableProtocol, getEncoding, getParallelWorkers, getPassword, getPortNumber, getProcessId, getProcessName, getRoleName, getServerName, getSocketBufferSize, getSocketFactory, getSoTimeout, getType, getUser, getWireCrypt, isWireCompression, setAuthPlugins, setCharSet, setConnectTimeout, setDbCryptConfig, setEnableProtocol, setEncoding, setParallelWorkers, setPassword, setPortNumber, setProcessId, setProcessName, setRoleName, setServerName, setSocketBufferSize, setSocketFactory, setSoTimeout, setType, setUser, setWireCompression, setWireCryptMethods inherited from interface org.firebirdsql.jaybird.props.BaseProperties
getBooleanProperty, getIntProperty, getPropertyMethods inherited from interface org.firebirdsql.gds.ng.IAttachProperties
asImmutable, asNewMutable, getAttachObjectName, getWireCryptAsEnum, setAttachObjectName, setWireCryptAsEnum
-
Constructor Details
-
AbstractAttachProperties
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 Details
-
setProperty
Description copied from interface:BasePropertiesSets a property by name.This method can be used to set all defined properties, but also properties not known by Jaybird. When setting
intorbooleanproperties, the appropriate conversions are applied. Usingnullwill reset to the default value. Forbooleanproperties, an empty string is taken to meantrue.- Specified by:
setPropertyin interfaceBaseProperties- Parameters:
name- Property name (notnullor empty)value- Property value (usenullto apply default)
-
getProperty
Description copied from interface:BasePropertiesRetrieves a string property value by name.For properties with an explicit default, this method should return the string presentation of that default, not
null. Forintorbooleanthe string equivalent is returned.- Specified by:
getPropertyin interfaceBaseProperties- Parameters:
name- Property name (notnullor empty)- Returns:
- Value of the property, or
nullwhen not set or not a known property
-
setIntProperty
Description copied from interface:BasePropertiesSets anintproperty by name.For implementation simplicity, it is allowed to also set string properties. The value set will be the string equivalent.
- Specified by:
setIntPropertyin interfaceBaseProperties- Parameters:
name- Property name (notnullor empty)value- Property value (usenullto apply default)
-
getIntProperty
Description copied from interface:BasePropertiesRetrieves anintproperty value by name.For properties with an explicit default, this method should return the integer presentation of that default. For implementation simplicity, it is allowed to convert any string property to
intinstead of checking if something is actually anintproperty- Specified by:
getIntPropertyin interfaceBaseProperties- Parameters:
name- Property name (notnullor empty)- Returns:
- Integer with value of the property, or
nullwhen not set
-
setBooleanProperty
Description copied from interface:BasePropertiesSets abooleanproperty by name.For implementation simplicity, it is allowed to also set string properties. The value set will be the string equivalent.
- Specified by:
setBooleanPropertyin interfaceBaseProperties- Parameters:
name- Property name (notnullor empty)value- Property value (usenullto apply default)
-
getBooleanProperty
Description copied from interface:BasePropertiesRetrieves abooleanproperty value by name.For properties with an explicit default, this method should return the boolean presentation of that default. For implementation simplicity, it is allowed to convert any string property to
booleaninstead of checking if something is actually abooleanproperty- Specified by:
getBooleanPropertyin interfaceBaseProperties- Parameters:
name- Property name (notnullor empty)- Returns:
- Integer with value of the property, or
nullwhen not set
-
resolveStoredDefaultValue
Resolve the default value for the specified connection property.This method is only used for properties that must have a stored default value to function correctly.
- Parameters:
property- Connection property- Returns:
- Default value to apply (usually
null)
-
property
Returns the property of the specified name.When the property is not a known property, an unknown variant is returned.
- Parameters:
name- Property name- Returns:
- A connection property instance, never
null
-
connectionPropertyValues
Description copied from interface:BasePropertiesAn unmodifiable view on the connection properties held by this BaseProperties implementation.Be aware, implementations can have additional properties that are not mapped from
ConnectionProperty. Such properties will need to be retrieved in an implementation-specific manner.- Specified by:
connectionPropertyValuesin interfaceBaseProperties- Returns:
- An unmodifiable view on the property values held in this properties instance
-
isImmutable
public final boolean isImmutable()- Specified by:
isImmutablein interfaceIAttachProperties<T extends IAttachProperties<T>>- Returns:
trueif this is an immutable implementation,falseif mutable
-
registerPropertyUpdateListener
@InternalApi public void registerPropertyUpdateListener(AbstractAttachProperties.PropertyUpdateListener listener) Registers an update listener that is notified when a connection property is modified.This method is only for internal use within Jaybird.
- Parameters:
listener- Listener to register ornullto unregister- Throws:
IllegalStateException- When a property update listener was already registered
-
equals
-
hashCode
public int hashCode() -
dirtied
protected abstract void dirtied()Called by setters if they have been called.
-