Class Bind

java.lang.Object
io.r2dbc.postgresql.message.frontend.Bind
All Implemented Interfaces:
FrontendMessage, FrontendMessage.DirectEncoder

public final class Bind extends Object implements FrontendMessage, FrontendMessage.DirectEncoder
The Bind message.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface FrontendMessage

    FrontendMessage.DirectEncoder
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final io.netty.buffer.ByteBuf
    A marker indicating a NULL value.
    static final String
    The unnamed portal.
    static final String
    The unnamed statement.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Bind(String name, List<io.r2dbc.postgresql.message.Format> parameterFormats, List<io.netty.buffer.ByteBuf> parameters, Collection<io.r2dbc.postgresql.message.Format> resultFormats, String source)
    Create a new message.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Release any resources (such as bound parameter buffers) held by this message without encoding it.
    void
    encode(io.netty.buffer.ByteBuf byteBuf)
    Encode a message directly by writing its content to a ByteBuf.
    Publisher<io.netty.buffer.ByteBuf>
    encode(io.netty.buffer.ByteBufAllocator byteBufAllocator)
    Encode a message into a ByteBuf.
    boolean
     
    int
     
     

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • NULL_VALUE

      public static final io.netty.buffer.ByteBuf NULL_VALUE
      A marker indicating a NULL value.
    • UNNAMED_PORTAL

      public static final String UNNAMED_PORTAL
      The unnamed portal.
      See Also:
    • UNNAMED_STATEMENT

      public static final String UNNAMED_STATEMENT
      The unnamed statement.
      See Also:
  • Constructor Details

    • Bind

      public Bind(String name, List<io.r2dbc.postgresql.message.Format> parameterFormats, List<io.netty.buffer.ByteBuf> parameters, Collection<io.r2dbc.postgresql.message.Format> resultFormats, String source)
      Create a new message.
      Parameters:
      name - the name of the destination portal (an empty string selects the unnamed portal)
      parameterFormats - the parameter formats
      parameters - the value of the parameters, in the format indicated by the associated format
      resultFormats - the result formats
      source - the name of the source prepared statement (an empty string selects the unnamed prepared statement)
      Throws:
      IllegalArgumentException - if name, parameterFormats, parameters, resultFormats, or source is null
      See Also:
  • Method Details

    • encode

      public Publisher<io.netty.buffer.ByteBuf> encode(io.netty.buffer.ByteBufAllocator byteBufAllocator)
      Description copied from interface: FrontendMessage
      Encode a message into a ByteBuf.
      Specified by:
      encode in interface FrontendMessage
      Parameters:
      byteBufAllocator - the byteBufAllocator to use to get a ByteBuf to write into
      Returns:
      a Publisher that produces the ByteBuf containing the encoded message
    • encode

      public void encode(io.netty.buffer.ByteBuf byteBuf)
      Description copied from interface: FrontendMessage.DirectEncoder
      Encode a message directly by writing its content to a ByteBuf.
      Specified by:
      encode in interface FrontendMessage.DirectEncoder
      Parameters:
      byteBuf - the target ByteBuf to write into
    • dispose

      public void dispose()
      Description copied from interface: FrontendMessage
      Release any resources (such as bound parameter buffers) held by this message without encoding it. Invoked when a message is discarded before reaching the wire, e.g. when the connection is closed or the conversation is cancelled while the message is still queued. The default implementation does nothing. Implementations that own reference-counted buffers must release them here and must be idempotent so that disposal is safe regardless of whether the message was already encoded.
      Specified by:
      dispose in interface FrontendMessage
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object