Package: io.vertx.groovy.ext.stomp

## [Groovy] Class StompClient

- io.vertx.groovy.ext.stomp.StompClient

- Defines a STOMP client.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `StompClient (java.lang.Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `close()` Closes the client.
    `StompClient` | `connect(int port, java.lang.String host, io.vertx.core.Handler<io.vertx.core.AsyncResult<StompClientConnection>> resultHandler)` Connects to the server.
    `StompClient` | `connect(NetClient net, io.vertx.core.Handler<io.vertx.core.AsyncResult<StompClientConnection>> resultHandler)` Connects to the server.
    `StompClient` | `connect(int port, java.lang.String host, NetClient net, io.vertx.core.Handler<io.vertx.core.AsyncResult<StompClientConnection>> resultHandler)` Connects to the server.
    `StompClient` | `connect(io.vertx.core.Handler<io.vertx.core.AsyncResult<StompClientConnection>> resultHandler)` Connects to the server using the host and port configured in the client's options.
    `static StompClient` | `create(Vertx vertx)` Creates a StompClient using the default implementation.
    `static StompClient` | `create(Vertx vertx, java.util.Map<java.lang.String, java.lang.Object> options)` Creates a StompClient using the default implementation.
    `StompClient` | `errorFrameHandler(io.vertx.core.Handler<java.util.Map<java.lang.String, java.lang.Object>> handler)` A general error frame handler.
    `java.lang.Object` | `getDelegate()`
    `boolean` | `isClosed()` @return whether or not the client is connected to the server.
    `java.util.Map<java.lang.String, java.lang.Object>` | `options()` Returns: the client's options.
    `StompClient` | `receivedFrameHandler(io.vertx.core.Handler<java.util.Map<java.lang.String, java.lang.Object>> handler)` Configures a received handler that gets notified when a STOMP frame is received by the client.
    `Vertx` | `vertx()` @return the vert.x instance used by the client.
    `StompClient` | `writingFrameHandler(io.vertx.core.Handler<java.util.Map<java.lang.String, java.lang.Object>> handler)` Configures a writing handler that gets notified when a STOMP frame is written on the wire.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### StompClient(java.lang.Object delegate)

  - ### Method Detail

    - #### void close()

      Closes the client.

    - #### StompClient connect(int port, java.lang.String host, io.vertx.core.Handler<io.vertx.core.AsyncResult<StompClientConnection>> resultHandler)

      Connects to the server.

      Returns:
        the current StompClient
      Parameters:
        `port` - the server port
        `host` - the server host
        `resultHandler` - handler called with the connection result

    - #### StompClient connect(NetClient net, io.vertx.core.Handler<io.vertx.core.AsyncResult<StompClientConnection>> resultHandler)

      Connects to the server.

      Returns:
        the current StompClient
      Parameters:
        `net` - the NET client to use
        `resultHandler` - handler called with the connection result

    - #### StompClient connect(int port, java.lang.String host, NetClient net, io.vertx.core.Handler<io.vertx.core.AsyncResult<StompClientConnection>> resultHandler)

      Connects to the server.

      Returns:
        the current StompClient
      Parameters:
        `port` - the server port
        `host` - the server host
        `net` - the NET client to use
        `resultHandler` - handler called with the connection result

    - #### StompClient connect(io.vertx.core.Handler<io.vertx.core.AsyncResult<StompClientConnection>> resultHandler)

      Connects to the server using the host and port configured in the client's options.

      Returns:
        the current StompClient
      Parameters:
        `resultHandler` - handler called with the connection result

    - #### static StompClient create(Vertx vertx)

      Creates a StompClient using the default implementation.

      Returns:
        the created StompClient
      Parameters:
        `vertx` - the vert.x instance to use

    - #### static StompClient create(Vertx vertx, java.util.Map<java.lang.String, java.lang.Object> options)

      Creates a StompClient using the default implementation.

      Returns:
        the created StompClient
      Parameters:
        `vertx` - the vert.x instance to use
        `options` - the options (see StompClientOptions)

    - #### StompClient errorFrameHandler(io.vertx.core.Handler<java.util.Map<java.lang.String, java.lang.Object>> handler)

      A general error frame handler. It can be used to catch `ERROR` frame emitted during the connection process (wrong authentication). This error handler will be pass to all StompClientConnection created from this client. Obviously, the client can override it when the connection is established.

      Returns:
        the current StompClient
      Parameters:
        `handler` - the handler

    - #### java.lang.Object getDelegate()

    - #### boolean isClosed()

      Returns:
        whether or not the client is connected to the server.

    - #### java.util.Map<java.lang.String, java.lang.Object> options()

      Returns:
        the client's options. (see StompClientOptions)

    - #### StompClient receivedFrameHandler(io.vertx.core.Handler<java.util.Map<java.lang.String, java.lang.Object>> handler)

      Configures a received handler that gets notified when a STOMP frame is received by the client. This handler can be used for logging, debugging or ad-hoc behavior. The frame can still be modified at the time.

      When a connection is created, the handler is used as StompClientConnection.receivedFrameHandler.

      Returns:
        the current StompClient
      Parameters:
        `handler` - the handler

    - #### Vertx vertx()

      Returns:
        the vert.x instance used by the client.

    - #### StompClient writingFrameHandler(io.vertx.core.Handler<java.util.Map<java.lang.String, java.lang.Object>> handler)

      Configures a writing handler that gets notified when a STOMP frame is written on the wire. This handler can be used for logging, debugging or ad-hoc behavior. The frame can still be modified at the time.

      When a connection is created, the handler is used as StompClientConnection.writingFrameHandler.

      Returns:
        the current StompClient
      Parameters:
        `handler` - the handler