Class List Method List File List

# Class: VertxStomp::Acknowledgement

Inherits:
  Object
  - Object
  - VertxStomp::Acknowledgement
  show all
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-stomp/src/main/resources/vertx-stomp/acknowledgement.rb

## Overview

Structure passed to acknowledgement handler called when a `ACK` or `NACK` frame is received. The handler receives an instance of Acknowledgement with the subscription Hash and the impacted messages. The list of messages depends on the type of acknowledgment used by the subscription.

Subscriptions using the `client` mode receives all messages that were waiting for acknowledgment that were sent before the acknowledged messages. The list also contains the acknowledged message. This is a cumulative acknowledgement. Subscriptions using the `client-individual` mode receives a singleton list containing only the acknowledged message.

## Instance Method Summary (collapse)

- - (Array<Hash>) frames
  @return the list of frames that have been acknowledged / not-acknowledged.
- - (Hash) subscription
  @return the subscription frame.

## Instance Method Details

### - (`Array<Hash>`) frames

@return the list of frames that have been acknowledged / not-acknowledged. The content of the list depends on the type of subscription.

Returns:

- (`Array<Hash>`)

Raises:

- (`ArgumentError`)

    34
    35
    36
    37
    38
    39
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-stomp/src/main/resources/vertx-stomp/acknowledgement.rb', line 34

    def frames
      if !block_given?
        return @j_del.java_method(:frames, []).call().to_a.map { |elt| elt != nil ? JSON.parse(elt.toJson.encode) : nil }
      end
      raise ArgumentError, "Invalid arguments when calling frames()"
    end

### - (`Hash`) subscription

@return the subscription frame

Returns:

- (`Hash`)

Raises:

- (`ArgumentError`)

    25
    26
    27
    28
    29
    30
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-stomp/src/main/resources/vertx-stomp/acknowledgement.rb', line 25

    def subscription
      if !block_given?
        return @j_del.java_method(:subscription, []).call() != nil ? JSON.parse(@j_del.java_method(:subscription, []).call().toJson.encode) : nil
      end
      raise ArgumentError, "Invalid arguments when calling subscription()"
    end