wise_omf 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wise_omf/client.rb +18 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f134731d915d3a0b06bf14096d2ebe949f25d43
|
4
|
+
data.tar.gz: 18621c348fbe8e54da487b0814026f77310947d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c951d8dab045782865627a396ddacad1f4de378b613d872ee6767e1a90a55b9664037d7d70e18f891787072f151b7a3a8c6e62a7058c78e175c99bd1e2024f7e
|
7
|
+
data.tar.gz: 2ce247b4388439eb5d7726157763685eed7bed4624242909358d5af3d927face855e3dc29ba8bdb33fb17164c1126538a8c323ce52e55d2012e20ebbf349f06c
|
data/lib/wise_omf/client.rb
CHANGED
@@ -67,12 +67,11 @@ module WiseOMF
|
|
67
67
|
# This method initializes the callback handler on the group topic.
|
68
68
|
# The topic might be nil direct after the intialization.
|
69
69
|
#
|
70
|
-
# @param block a block that should be called after initializing the topic callback
|
70
|
+
# @param &block a block that should be called after initializing the topic callback
|
71
71
|
def init_callback(&block)
|
72
72
|
if @group.topic.nil?
|
73
|
-
|
73
|
+
debug "Delaying callback creation for 1 seconds"
|
74
74
|
OmfCommon.el.after(1) {
|
75
|
-
info "Firing"
|
76
75
|
init_callback(&block)
|
77
76
|
}
|
78
77
|
return
|
@@ -93,7 +92,6 @@ module WiseOMF
|
|
93
92
|
end
|
94
93
|
end
|
95
94
|
}
|
96
|
-
info "Callback: #{block}"
|
97
95
|
block.call(self) if block
|
98
96
|
|
99
97
|
end
|
@@ -191,10 +189,20 @@ module WiseOMF
|
|
191
189
|
|
192
190
|
end
|
193
191
|
|
192
|
+
# Getter for the reservation group
|
193
|
+
#
|
194
|
+
# @return[WiseOMF::Client::WiseGroup] the group
|
194
195
|
def self.reservationGroup
|
195
196
|
@@reservationGroup
|
196
197
|
end
|
197
198
|
|
199
|
+
|
200
|
+
# Method for creating a group for an arbitrary subset of nodes
|
201
|
+
#
|
202
|
+
# @param nodeUrns [Array, Set] a set of node urns to create a group for.
|
203
|
+
# **Important:** the set must be a real subset of all nodes in the reservation.
|
204
|
+
# @param name [String] the groups name
|
205
|
+
# @param &block a block to perform after the creation was finished
|
198
206
|
def self.createGroupForNodes(nodeUrns, name = nil, &block)
|
199
207
|
groupId = WiseOMFUtils::UIDHelper.node_group_uid(@@reservation, nodeUrns)
|
200
208
|
if @@nodeGroups[groupId].nil?
|
@@ -219,13 +227,15 @@ module WiseOMF
|
|
219
227
|
@@reservationGroup.group.topic.create(:wisebed_node, {uid: groupId, urns: nodeUrns, membership: group.group.address})
|
220
228
|
}
|
221
229
|
|
222
|
-
|
230
|
+
else
|
231
|
+
block.call(@@nodeGroups[groupId]) if block
|
223
232
|
end
|
224
233
|
end
|
225
234
|
|
226
235
|
# Returns a group to use when interacting with an arbitrary subset of the all nodes set
|
227
236
|
#
|
228
237
|
# @param nodeUrns [Array, Set, #read] a list of nodes to get the group for.
|
238
|
+
#
|
229
239
|
# @return [WiseOMF::Client::WiseGroup] the WiseGroup for the node urns if one was found, nil otherwise
|
230
240
|
def self.groupForNodes(nodeUrns)
|
231
241
|
groupId = WiseOMFUtils::UIDHelper.node_group_uid(@@reservation, nodeUrns)
|
@@ -246,7 +256,8 @@ module WiseOMF
|
|
246
256
|
|
247
257
|
# Returns a WiseGroup to talk to. This group should be used for interacting with single nodes.
|
248
258
|
#
|
249
|
-
# @param[String
|
259
|
+
# @param nodeUrn [String] the node urn
|
260
|
+
#
|
250
261
|
# @return[WiseOMF::Client::WiseGroup] the group for a single resource
|
251
262
|
def self.groupForNode(nodeUrn)
|
252
263
|
groupId = WiseOMFUtils::UIDHelper.node_group_uid(@@reservation, [nodeUrn])
|
@@ -258,6 +269,7 @@ module WiseOMF
|
|
258
269
|
end
|
259
270
|
|
260
271
|
# Getter for the reservation id of the current reservation
|
272
|
+
#
|
261
273
|
# @return[String] the reservation id for this reservation
|
262
274
|
def self.reservationID
|
263
275
|
WiseOMFUtils::UIDHelper.reservation_uid(@@reservation)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wise_omf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Mende
|
@@ -12,7 +12,7 @@ date: 2013-11-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
13
13
|
description: This gem provides helpers for working with the testbed runtime via the
|
14
14
|
OMF (Orbit Measurement Framework)
|
15
|
-
email:
|
15
|
+
email: mendet@informatik.uni-luebeck.de
|
16
16
|
executables: []
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|