Class: VertxStomp::Destination

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination.rb

Overview

Represents a STOMP destination. Depending on the implementation, the message delivery is different. Queue are sending message to only one subscribers, while topics are broadcasting the message to all subscribers.

Implementations must be thread-safe.

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


24
25
26
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination.rb', line 24

def @@j_api_type.accept?(obj)
  obj.class == Destination
end

+ (::VertxStomp::Destination) bridge(vertx, options)

Parameters:

Returns:



173
174
175
176
177
178
179
180
181
182
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination.rb', line 173

def self.bridge(*args)
  if args[0].class.method_defined?(:j_del) && args[1].class == Hash && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtStomp::Destination.java_method(:bridge, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtStomp::BridgeOptions.java_class]).call(args[0].j_del,Java::IoVertxExtStomp::BridgeOptions.new(::Vertx::Util::Utils.to_json_object(args[1]))),::VertxStomp::Destination)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling bridge(#{args[0]},#{args[1]})"
  end
end

+ (Object) j_api_type



33
34
35
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination.rb', line 33

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



36
37
38
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination.rb', line 36

def self.j_class
  Java::IoVertxExtStomp::Destination.java_class
end

+ (::VertxStomp::Destination) queue(vertx, destination)

Parameters:

Returns:



216
217
218
219
220
221
222
223
224
225
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination.rb', line 216

def self.queue(*args)
  if args[0].class.method_defined?(:j_del) && args[1].class == String && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtStomp::Destination.java_method(:queue, [Java::IoVertxCore::Vertx.java_class,Java::java.lang.String.java_class]).call(args[0].j_del,args[1]),::VertxStomp::Destination)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling queue(#{args[0]},#{args[1]})"
  end
end

+ (::VertxStomp::Destination) topic(vertx, destination)

Parameters:

Returns:



159
160
161
162
163
164
165
166
167
168
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination.rb', line 159

def self.topic(*args)
  if args[0].class.method_defined?(:j_del) && args[1].class == String && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtStomp::Destination.java_method(:topic, [Java::IoVertxCore::Vertx.java_class,Java::java.lang.String.java_class]).call(args[0].j_del,args[1]),::VertxStomp::Destination)
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling topic(#{args[0]},#{args[1]})"
  end
end

+ (Object) unwrap(obj)



30
31
32
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination.rb', line 30

def @@j_api_type.unwrap(obj)
  obj.j_del
end

+ (Object) wrap(obj)



27
28
29
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination.rb', line 27

def @@j_api_type.wrap(obj)
  Destination.new(obj)
end

Instance Method Details

- (true, false) ack(connection, frame)

Handles a ACK frame.

Parameters:

Returns:

  • (true, false)
    true if the destination has handled the frame (meaning it has sent the message with id)


133
134
135
136
137
138
139
140
141
142
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination.rb', line 133

def ack?(*args)
  if args[0].class.method_defined?(:j_del) && args[1].class == Hash && !block_given?
    return @j_del.java_method(:ack, [Java::IoVertxExtStomp::StompServerConnection.java_class,Java::IoVertxExtStomp::Frame.java_class]).call(args[0].j_del,Java::IoVertxExtStomp::Frame.new(::Vertx::Util::Utils.to_json_object(args[1])))
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling ack?(#{args[0]},#{args[1]})"
  end
end

- (String) destination

Returns the destination address.

Returns:

  • (String)
    the destination address.


145
146
147
148
149
150
151
152
153
154
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination.rb', line 145

def destination
  if !block_given?
    return @j_del.java_method(:destination, []).call()
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling destination()"
  end
end

- (self) dispatch(connection, frame)

Dispatches the given frame.

Parameters:

Returns:

  • (self)


57
58
59
60
61
62
63
64
65
66
67
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination.rb', line 57

def dispatch(*args)
  if args[0].class.method_defined?(:j_del) && args[1].class == Hash && !block_given?
    @j_del.java_method(:dispatch, [Java::IoVertxExtStomp::StompServerConnection.java_class,Java::IoVertxExtStomp::Frame.java_class]).call(args[0].j_del,Java::IoVertxExtStomp::Frame.new(::Vertx::Util::Utils.to_json_object(args[1])))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling dispatch(#{args[0]},#{args[1]})"
  end
end

- (Array<String>) getSubscriptions(connection)

Gets all subscription ids for the given destination hold by the given client

Parameters:

Returns:

  • (Array<String>)
    the list of subscription id, empty if none


72
73
74
75
76
77
78
79
80
81
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination.rb', line 72

def get_subscriptions(*args)
  if args[0].class.method_defined?(:j_del) && !block_given?
    return @j_del.java_method(:getSubscriptions, [Java::IoVertxExtStomp::StompServerConnection.java_class]).call(args[0].j_del).to_a.map { |elt| elt }
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling get_subscriptions(#{args[0]})"
  end
end

- (true, false) matches(address)

Checks whether or not the given address matches with the current destination.

Parameters:

  • address (String)
    the address

Returns:

  • (true, false)
    true if it matches, false otherwise.


202
203
204
205
206
207
208
209
210
211
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination.rb', line 202

def matches?(*args)
  if args[0].class == String && !block_given?
    return @j_del.java_method(:matches, [Java::java.lang.String.java_class]).call(args[0])
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling matches?(#{args[0]})"
  end
end

- (true, false) nack(connection, frame)

Handles a NACK frame.

Parameters:

Returns:

  • (true, false)
    true if the destination has handled the frame (meaning it has sent the message with id)


118
119
120
121
122
123
124
125
126
127
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination.rb', line 118

def nack?(*args)
  if args[0].class.method_defined?(:j_del) && args[1].class == Hash && !block_given?
    return @j_del.java_method(:nack, [Java::IoVertxExtStomp::StompServerConnection.java_class,Java::IoVertxExtStomp::Frame.java_class]).call(args[0].j_del,Java::IoVertxExtStomp::Frame.new(::Vertx::Util::Utils.to_json_object(args[1])))
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling nack?(#{args[0]},#{args[1]})"
  end
end

- (Fixnum) numberOfSubscriptions

Gets the number of subscriptions attached to the current VertxStomp::Destination.

Returns:

  • (Fixnum)
    the number of subscriptions.


42
43
44
45
46
47
48
49
50
51
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination.rb', line 42

def number_of_subscriptions
  if !block_given?
    return @j_del.java_method(:numberOfSubscriptions, []).call()
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling number_of_subscriptions()"
  end
end

- (self) subscribe(connection, frame)

Handles a subscription request to the current VertxStomp::Destination.

Parameters:

Returns:

  • (self)


102
103
104
105
106
107
108
109
110
111
112
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination.rb', line 102

def subscribe(*args)
  if args[0].class.method_defined?(:j_del) && args[1].class == Hash && !block_given?
    @j_del.java_method(:subscribe, [Java::IoVertxExtStomp::StompServerConnection.java_class,Java::IoVertxExtStomp::Frame.java_class]).call(args[0].j_del,Java::IoVertxExtStomp::Frame.new(::Vertx::Util::Utils.to_json_object(args[1])))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling subscribe(#{args[0]},#{args[1]})"
  end
end

- (true, false) unsubscribe(connection, frame)

Handles a un-subscription request to the current VertxStomp::Destination.

Parameters:

Returns:

  • (true, false)
    true if the un-subscription has been handled, false otherwise.


87
88
89
90
91
92
93
94
95
96
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination.rb', line 87

def unsubscribe?(*args)
  if args[0].class.method_defined?(:j_del) && args[1].class == Hash && !block_given?
    return @j_del.java_method(:unsubscribe, [Java::IoVertxExtStomp::StompServerConnection.java_class,Java::IoVertxExtStomp::Frame.java_class]).call(args[0].j_del,Java::IoVertxExtStomp::Frame.new(::Vertx::Util::Utils.to_json_object(args[1])))
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling unsubscribe?(#{args[0]},#{args[1]})"
  end
end

- (self) unsubscribeConnection(connection)

Removes all subscriptions of the given connection

Parameters:

Returns:

  • (self)


187
188
189
190
191
192
193
194
195
196
197
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/destination.rb', line 187

def unsubscribe_connection(*args)
  if args[0].class.method_defined?(:j_del) && !block_given?
    @j_del.java_method(:unsubscribeConnection, [Java::IoVertxExtStomp::StompServerConnection.java_class]).call(args[0].j_del)
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling unsubscribe_connection(#{args[0]})"
  end
end