Class FBConnectionRequestInfo

java.lang.Object
org.firebirdsql.jca.FBConnectionRequestInfo
All Implemented Interfaces:
Serializable, Iterable<Parameter>, javax.resource.cci.ConnectionSpec, javax.resource.spi.ConnectionRequestInfo, ConnectionParameterBuffer, DatabaseParameterBuffer, DatabaseParameterBufferExtension, ParameterBuffer

public class FBConnectionRequestInfo extends Object implements DatabaseParameterBufferExtension, javax.resource.spi.ConnectionRequestInfo, javax.resource.cci.ConnectionSpec, Serializable
The class FBConnectionRequestInfo holds a clumplet that is used to store and transfer connection-specific information such as user, password, and other dpb information..
Version:
2.0
Author:
David Jencks, Roman Rokytskyy
See Also:
  • Constructor Details

  • Method Details

    • deepCopy

      public DatabaseParameterBuffer deepCopy()
      Perform a deep copy of this object, returning the copied instance.
      Specified by:
      deepCopy in interface DatabaseParameterBuffer
      Returns:
      A deep-copied copy of this FBConnectionRequestInfo object
    • getDpb

      public DatabaseParameterBuffer getDpb()
      Get the underlying Database Parameter Buffer for this object.
      Returns:
      The underlying dpb for this object
    • addArgument

      public void addArgument(int argumentType, byte[] content)
      Description copied from interface: ParameterBuffer
      Add array of bytes.
      Specified by:
      addArgument in interface ParameterBuffer
      Parameters:
      argumentType - type of argument.
      content - content of argument.
    • addArgument

      public void addArgument(int argumentType, int value)
      Description copied from interface: ParameterBuffer
      Add integer argument.
      Specified by:
      addArgument in interface ParameterBuffer
      Parameters:
      argumentType - type of argument.
      value - integer value to add.
    • addArgument

      public void addArgument(int argumentType, long value)
      Description copied from interface: ParameterBuffer
      Add long argument.
      Specified by:
      addArgument in interface ParameterBuffer
      Parameters:
      argumentType - type of argument.
      value - long value to add.
    • addArgument

      public void addArgument(int argumentType, String value)
      Description copied from interface: ParameterBuffer
      Add string argument with the default encoding.
      Specified by:
      addArgument in interface ParameterBuffer
      Parameters:
      argumentType - type of argument.
      value - string value to add.
    • addArgument

      public void addArgument(int argumentType, String value, Encoding encoding)
      Description copied from interface: ParameterBuffer
      Add string argument.
      Specified by:
      addArgument in interface ParameterBuffer
      Parameters:
      argumentType - type of argument.
      value - string value to add.
      encoding - encoding to use for conversion to bytes
    • getType

      public int getType()
      Specified by:
      getType in interface ParameterBuffer
      Returns:
      The parameter buffer type identifier
    • addArgument

      public void addArgument(int argumentType)
      Description copied from interface: ParameterBuffer
      Add argument with no parameters.
      Specified by:
      addArgument in interface ParameterBuffer
      Parameters:
      argumentType - type of argument.
    • getArgumentAsInt

      public int getArgumentAsInt(int argumentType)
      Description copied from interface: ParameterBuffer
      Get argument as int.
      Specified by:
      getArgumentAsInt in interface ParameterBuffer
      Parameters:
      argumentType - type of argument to find.
      Returns:
      argument as string or 0 if nothing found.
    • getArgumentAsString

      public String getArgumentAsString(int argumentType)
      Description copied from interface: ParameterBuffer
      Get argument as string.
      Specified by:
      getArgumentAsString in interface ParameterBuffer
      Parameters:
      argumentType - type of argument to find.
      Returns:
      argument as string or null if nothing found.
    • hasArgument

      public boolean hasArgument(int argumentType)
      Description copied from interface: ParameterBuffer
      Check if this parameter buffer has specified argument.
      Specified by:
      hasArgument in interface ParameterBuffer
      Parameters:
      argumentType - type of argument to find.
      Returns:
      true if this buffer contains specified argument.
    • removeArgument

      public void removeArgument(int argumentType)
      Description copied from interface: ParameterBuffer
      Remove specified argument.
      Specified by:
      removeArgument in interface ParameterBuffer
      Parameters:
      argumentType - type of argument to remove.
    • removeExtensionParams

      public DatabaseParameterBuffer removeExtensionParams()
      Description copied from interface: DatabaseParameterBufferExtension
      Remove extension parameters in the newly created deep copy of this class.
      Specified by:
      removeExtensionParams in interface DatabaseParameterBufferExtension
      Returns:
      a deep copy of this class where all extension parameters are removed; needed to filter Jaybird extensions that are not understood by Firebird.
    • iterator

      public Iterator<Parameter> iterator()
      Description copied from interface: ParameterBuffer
      Returns an iterator over a copy of the parameters in this parameter buffer.

      It is safe to iterate over this iterator while modifying the parameter buffer. Changes will not be reflected in the iterator.

      Specified by:
      iterator in interface Iterable<Parameter>
      Specified by:
      iterator in interface ParameterBuffer
      Returns:
      Iterator over the parameters in this parameter buffer.
    • writeArgumentsTo

      public void writeArgumentsTo(OutputStream outputStream) throws IOException
      Description copied from interface: ParameterBuffer
      Writes the arguments in the implementation specific serialization into the OutputStream.
      Specified by:
      writeArgumentsTo in interface ParameterBuffer
      Parameters:
      outputStream - The OutputStream to write to
      Throws:
      IOException - Errors produced by the output stream during writes
    • toXdrable

      public Xdrable toXdrable()
      Specified by:
      toXdrable in interface ParameterBuffer
      Returns:
      Xdrable to write (and optionally read) this instance as Xdr.
    • toBytes

      public byte[] toBytes()
      Description copied from interface: ParameterBuffer
      Converts this parameter buffer to a byte array.

      This byte array includes the extra header-bytes (if any), but does not include the type information

      Specified by:
      toBytes in interface ParameterBuffer
      Returns:
      Byte array with serialization of this parameter buffer
      See Also:
    • toBytesWithType

      public byte[] toBytesWithType()
      Description copied from interface: ParameterBuffer
      Converts this parameter buffer to a byte array with type information.

      This byte array includes the type information and the extra header bytes (if any).

      Specified by:
      toBytesWithType in interface ParameterBuffer
      Returns:
      Byte array with serialization of this parameter buffer
      See Also:
    • size

      public int size()
      Specified by:
      size in interface ParameterBuffer
      Returns:
      the number of parameters stored.
    • setUserName

      public void setUserName(String userName)
    • setPassword

      public void setPassword(String password)
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface javax.resource.spi.ConnectionRequestInfo
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface javax.resource.spi.ConnectionRequestInfo
      Overrides:
      hashCode in class Object
    • getTagMapping

      public ParameterTagMapping getTagMapping()
      Specified by:
      getTagMapping in interface ConnectionParameterBuffer
      Returns:
      The tag mapping.
    • getDefaultEncoding

      public Encoding getDefaultEncoding()
      Specified by:
      getDefaultEncoding in interface ConnectionParameterBuffer
      Returns:
      The default encoding of string properties in this parameter buffer.