qpid_management 1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/.rspec +1 -0
- data/Gemfile +30 -0
- data/Gemfile.lock +55 -0
- data/Rakefile +27 -0
- data/lib/qpid_management/acl.rb +38 -0
- data/lib/qpid_management/binding.rb +31 -0
- data/lib/qpid_management/bridge.rb +39 -0
- data/lib/qpid_management/broker.rb +278 -0
- data/lib/qpid_management/broker_agent.rb +173 -0
- data/lib/qpid_management/broker_object.rb +126 -0
- data/lib/qpid_management/cluster.rb +26 -0
- data/lib/qpid_management/connection.rb +51 -0
- data/lib/qpid_management/errors.rb +28 -0
- data/lib/qpid_management/exchange.rb +44 -0
- data/lib/qpid_management/ha_broker.rb +26 -0
- data/lib/qpid_management/link.rb +35 -0
- data/lib/qpid_management/memory.rb +34 -0
- data/lib/qpid_management/queue.rb +97 -0
- data/lib/qpid_management/session.rb +38 -0
- data/lib/qpid_management/subscription.rb +35 -0
- data/lib/qpid_management.rb +81 -0
- data/qpid_management.gemspec +36 -0
- data/spec/broker_agent_spec.rb +43 -0
- data/spec/broker_spec.rb +373 -0
- data/spec/spec_helper.rb +21 -0
- metadata +87 -0
@@ -0,0 +1,126 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The ASF licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
module Qpid
|
20
|
+
module Management
|
21
|
+
# Representation of an object in the broker retrieved via QMF
|
22
|
+
class BrokerObject
|
23
|
+
attr_reader :content
|
24
|
+
|
25
|
+
# Creates a new BrokerObject
|
26
|
+
# @param [BrokerAgent] agent the agent used to query the data from the broker
|
27
|
+
# @param [Hash] content the raw QMF response data from the broker
|
28
|
+
def initialize(agent, content)
|
29
|
+
@agent = agent
|
30
|
+
@content = content
|
31
|
+
@values = content['_values']
|
32
|
+
end
|
33
|
+
|
34
|
+
# Refreshes the information associated with this instance by requerying the broker
|
35
|
+
# @raise [ObjectDeletedError] if the object has been deleted
|
36
|
+
def refresh!
|
37
|
+
refreshed = @agent.named_object(self.class, id)
|
38
|
+
if refreshed
|
39
|
+
@content = refreshed.content
|
40
|
+
@values = @content['_values']
|
41
|
+
else
|
42
|
+
raise ObjectDeletedError
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# Returns the full object id
|
47
|
+
# @return [String] the full object id
|
48
|
+
def id
|
49
|
+
@content['_object_id']['_object_name']
|
50
|
+
end
|
51
|
+
|
52
|
+
# Helper method to convert a Class to its QMF name counterpart. For
|
53
|
+
# example, QpidConfig::Connection will be converted to connection.
|
54
|
+
# @param [Class] clazz the Class to convert
|
55
|
+
# @return [String] the converted QMF name counterpart for this Class
|
56
|
+
def self.qmf_class(clazz)
|
57
|
+
clazz.name.split(/::/).last.downcase
|
58
|
+
end
|
59
|
+
|
60
|
+
# Returns the short object id, i.e. without the leading org.apache.qpid.broker:<class name>:
|
61
|
+
# @return [String] the short object id
|
62
|
+
def short_id
|
63
|
+
clazz = BrokerObject.qmf_class(self.class)
|
64
|
+
if id =~ /org.apache.qpid.broker:#{clazz}:(.*)/
|
65
|
+
return $1;
|
66
|
+
end
|
67
|
+
return nil
|
68
|
+
end
|
69
|
+
|
70
|
+
# Returns the time at which this object was created
|
71
|
+
# @return [Time] the time at which this object was created
|
72
|
+
def created_at
|
73
|
+
Time.at(content['_create_ts'] / 1000000000.0)
|
74
|
+
end
|
75
|
+
|
76
|
+
# Returns the time at which this object was deleted. Only ever applies to
|
77
|
+
# BrokerObject instances created from a QMF event.
|
78
|
+
# @return [Time] the time at which this object was deleted
|
79
|
+
def deleted_at
|
80
|
+
Time.at(content['_delete_ts'] / 1000000000.0)
|
81
|
+
end
|
82
|
+
|
83
|
+
# Returns the time at which this object was last updated
|
84
|
+
# @return [Time] the time at which this object was last updated
|
85
|
+
def updated_at
|
86
|
+
Time.at(content['_update_ts'] / 1000000000.0)
|
87
|
+
end
|
88
|
+
|
89
|
+
# Exposes data from the QMF response
|
90
|
+
# @param [String] key the key to look up a value, e.g. msgDepth for a queue
|
91
|
+
# @return the value associated with the key, or nil if not found
|
92
|
+
def [](key)
|
93
|
+
return nil unless @values.has_key?(key)
|
94
|
+
value = @values[key]
|
95
|
+
if value.is_a?(Hash) and value.has_key?('_object_name')
|
96
|
+
full_name = value['_object_name']
|
97
|
+
colon = full_name.index(':')
|
98
|
+
unless colon.nil?
|
99
|
+
full_name = full_name[colon+1..-1]
|
100
|
+
colon = full_name.index(':')
|
101
|
+
return full_name[colon+1..-1] unless colon.nil?
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
return value
|
106
|
+
end
|
107
|
+
|
108
|
+
# Exposes data from the QMF response via methods, e.g. queue.msgDepth
|
109
|
+
def method_missing(method, *args, &block)
|
110
|
+
key = method.to_s
|
111
|
+
return self[key] if args.empty? and not self[key].nil?
|
112
|
+
super
|
113
|
+
end
|
114
|
+
|
115
|
+
def to_s
|
116
|
+
@values.to_s
|
117
|
+
end
|
118
|
+
|
119
|
+
# Invokes a QMF method
|
120
|
+
# @see BrokerAgent#invoke_method
|
121
|
+
def invoke_method(*args)
|
122
|
+
@agent.invoke_method(*args)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
# or more contributor license agreements. See the NOTICE file
|
4
|
+
# distributed with this work for additional information
|
5
|
+
# regarding copyright ownership. The ASF licenses this file
|
6
|
+
# to you under the Apache License, Version 2.0 (the
|
7
|
+
# "License"); you may not use this file except in compliance
|
8
|
+
# with the License. You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing,
|
13
|
+
# software distributed under the License is distributed on an
|
14
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
# KIND, either express or implied. See the License for the
|
16
|
+
# specific language governing permissions and limitations
|
17
|
+
# under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
module Qpid
|
21
|
+
module Management
|
22
|
+
# Representation of a cluster
|
23
|
+
class Cluster < BrokerObject
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
#
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
# or more contributor license agreements. See the NOTICE file
|
4
|
+
# distributed with this work for additional information
|
5
|
+
# regarding copyright ownership. The ASF licenses this file
|
6
|
+
# to you under the Apache License, Version 2.0 (the
|
7
|
+
# "License"); you may not use this file except in compliance
|
8
|
+
# with the License. You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing,
|
13
|
+
# software distributed under the License is distributed on an
|
14
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
# KIND, either express or implied. See the License for the
|
16
|
+
# specific language governing permissions and limitations
|
17
|
+
# under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
module Qpid
|
21
|
+
module Management
|
22
|
+
# Representation of a client connection. Properties include:
|
23
|
+
# - SystemConnection
|
24
|
+
# - address
|
25
|
+
# - authIdentity
|
26
|
+
# - bytesFromClient
|
27
|
+
# - bytesToClient
|
28
|
+
# - closing
|
29
|
+
# - federationLink
|
30
|
+
# - framesFromClient
|
31
|
+
# - framesToClient
|
32
|
+
# - incoming
|
33
|
+
# - msgsFromClient
|
34
|
+
# - msgsToClient
|
35
|
+
# - remoteParentPid
|
36
|
+
# - remotePid
|
37
|
+
# - remoteProcessName
|
38
|
+
# - remoteProperties
|
39
|
+
# - saslMechanism
|
40
|
+
# - saslSsf
|
41
|
+
# - shadow
|
42
|
+
# - userProxyAuth
|
43
|
+
# - vhostRef
|
44
|
+
class Connection < BrokerObject
|
45
|
+
# Closes this connection to the broker
|
46
|
+
def close
|
47
|
+
invoke_method('close', {}, "org.apache.qpid.broker:connection:#{address}")
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
# or more contributor license agreements. See the NOTICE file
|
4
|
+
# distributed with this work for additional information
|
5
|
+
# regarding copyright ownership. The ASF licenses this file
|
6
|
+
# to you under the Apache License, Version 2.0 (the
|
7
|
+
# "License"); you may not use this file except in compliance
|
8
|
+
# with the License. You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing,
|
13
|
+
# software distributed under the License is distributed on an
|
14
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
# KIND, either express or implied. See the License for the
|
16
|
+
# specific language governing permissions and limitations
|
17
|
+
# under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
module Qpid
|
21
|
+
module Management
|
22
|
+
class ObjectNotFoundError < RuntimeError
|
23
|
+
end
|
24
|
+
|
25
|
+
class ObjectDeletedError < RuntimeError
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
# or more contributor license agreements. See the NOTICE file
|
4
|
+
# distributed with this work for additional information
|
5
|
+
# regarding copyright ownership. The ASF licenses this file
|
6
|
+
# to you under the Apache License, Version 2.0 (the
|
7
|
+
# "License"); you may not use this file except in compliance
|
8
|
+
# with the License. You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing,
|
13
|
+
# software distributed under the License is distributed on an
|
14
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
# KIND, either express or implied. See the License for the
|
16
|
+
# specific language governing permissions and limitations
|
17
|
+
# under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
module Qpid
|
21
|
+
module Management
|
22
|
+
# Representation of an exchange. Properties include:
|
23
|
+
# - arguments
|
24
|
+
# - autoDelete
|
25
|
+
# - bindingCount
|
26
|
+
# - bindingCountHigh
|
27
|
+
# - bindingCountLow
|
28
|
+
# - byteDrops
|
29
|
+
# - byteReceives
|
30
|
+
# - byteRoutes
|
31
|
+
# - durable
|
32
|
+
# - msgDrops
|
33
|
+
# - msgReceives
|
34
|
+
# - msgRoutes
|
35
|
+
# - name
|
36
|
+
# - producerCount
|
37
|
+
# - producerCountHigh
|
38
|
+
# - producerCountLow
|
39
|
+
# - type
|
40
|
+
# - vhostRef
|
41
|
+
class Exchange < BrokerObject
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
# or more contributor license agreements. See the NOTICE file
|
4
|
+
# distributed with this work for additional information
|
5
|
+
# regarding copyright ownership. The ASF licenses this file
|
6
|
+
# to you under the Apache License, Version 2.0 (the
|
7
|
+
# "License"); you may not use this file except in compliance
|
8
|
+
# with the License. You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing,
|
13
|
+
# software distributed under the License is distributed on an
|
14
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
# KIND, either express or implied. See the License for the
|
16
|
+
# specific language governing permissions and limitations
|
17
|
+
# under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
module Qpid
|
21
|
+
module Management
|
22
|
+
# Representation of an HA broker
|
23
|
+
class HaBroker < BrokerObject
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
# or more contributor license agreements. See the NOTICE file
|
4
|
+
# distributed with this work for additional information
|
5
|
+
# regarding copyright ownership. The ASF licenses this file
|
6
|
+
# to you under the Apache License, Version 2.0 (the
|
7
|
+
# "License"); you may not use this file except in compliance
|
8
|
+
# with the License. You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing,
|
13
|
+
# software distributed under the License is distributed on an
|
14
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
# KIND, either express or implied. See the License for the
|
16
|
+
# specific language governing permissions and limitations
|
17
|
+
# under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
module Qpid
|
21
|
+
module Management
|
22
|
+
# Representation of a link to a remote broker. Properties include:
|
23
|
+
# - connectionRef
|
24
|
+
# - durable
|
25
|
+
# - host
|
26
|
+
# - lastError
|
27
|
+
# - name
|
28
|
+
# - port
|
29
|
+
# - state
|
30
|
+
# - transport
|
31
|
+
# - vhostRef
|
32
|
+
class Link < BrokerObject
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
# or more contributor license agreements. See the NOTICE file
|
4
|
+
# distributed with this work for additional information
|
5
|
+
# regarding copyright ownership. The ASF licenses this file
|
6
|
+
# to you under the Apache License, Version 2.0 (the
|
7
|
+
# "License"); you may not use this file except in compliance
|
8
|
+
# with the License. You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing,
|
13
|
+
# software distributed under the License is distributed on an
|
14
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
# KIND, either express or implied. See the License for the
|
16
|
+
# specific language governing permissions and limitations
|
17
|
+
# under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
module Qpid
|
21
|
+
module Management
|
22
|
+
# Representation of the broker's memory. Properties include:
|
23
|
+
# - malloc_arena
|
24
|
+
# - malloc_fordblks
|
25
|
+
# - malloc_hblkhd
|
26
|
+
# - malloc_hblks
|
27
|
+
# - malloc_keepcost
|
28
|
+
# - malloc_ordblks
|
29
|
+
# - malloc_uordblks
|
30
|
+
# - name
|
31
|
+
class Memory < BrokerObject
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
#
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
# or more contributor license agreements. See the NOTICE file
|
4
|
+
# distributed with this work for additional information
|
5
|
+
# regarding copyright ownership. The ASF licenses this file
|
6
|
+
# to you under the Apache License, Version 2.0 (the
|
7
|
+
# "License"); you may not use this file except in compliance
|
8
|
+
# with the License. You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing,
|
13
|
+
# software distributed under the License is distributed on an
|
14
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
# KIND, either express or implied. See the License for the
|
16
|
+
# specific language governing permissions and limitations
|
17
|
+
# under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
module Qpid
|
21
|
+
module Management
|
22
|
+
# Representation of a queue. Properties include:
|
23
|
+
# - acquires
|
24
|
+
# - arguments
|
25
|
+
# - autoDelete
|
26
|
+
# - bindingCount
|
27
|
+
# - bindingCountHigh
|
28
|
+
# - bindingCountLow
|
29
|
+
# - byteDepth
|
30
|
+
# - byteFtdDepth
|
31
|
+
# - byteFtdDequeues
|
32
|
+
# - byteFtdEnqueues
|
33
|
+
# - bytePersistDequeues
|
34
|
+
# - bytePersistEnqueues
|
35
|
+
# - byteTotalDequeues
|
36
|
+
# - byteTotalEnqueues
|
37
|
+
# - byteTxnDequeues
|
38
|
+
# - byteTxnEnqueues
|
39
|
+
# - consumerCount
|
40
|
+
# - consumerCountHigh
|
41
|
+
# - consumerCountLow
|
42
|
+
# - discardsLvq
|
43
|
+
# - discardsOverflow
|
44
|
+
# - discardsPurge
|
45
|
+
# - discardsRing
|
46
|
+
# - discardsSubscriber
|
47
|
+
# - discardsTtl
|
48
|
+
# - durable
|
49
|
+
# - exclusive
|
50
|
+
# - flowStopped
|
51
|
+
# - flowStoppedCount
|
52
|
+
# - messageLatencyAvg
|
53
|
+
# - messageLatencyCount
|
54
|
+
# - messageLatencyMax
|
55
|
+
# - messageLatencyMin
|
56
|
+
# - msgDepth
|
57
|
+
# - msgFtdDepth
|
58
|
+
# - msgFtdDequeues
|
59
|
+
# - msgFtdEnqueues
|
60
|
+
# - msgPersistDequeues
|
61
|
+
# - msgPersistEnqueues
|
62
|
+
# - msgTotalDequeues
|
63
|
+
# - msgTotalEnqueues
|
64
|
+
# - msgTxnDequeues
|
65
|
+
# - msgTxnEnqueues
|
66
|
+
# - name
|
67
|
+
# - releases
|
68
|
+
# - reroutes
|
69
|
+
# - unackedMessages
|
70
|
+
# - unackedMessagesHigh
|
71
|
+
# - unackedMessagesLow
|
72
|
+
# - vhostRef
|
73
|
+
class Queue < BrokerObject
|
74
|
+
# Purges (removes) messages from this queue
|
75
|
+
# @param [Fixnum] message_count number of messages to remove from the queue, or 0 for all messages
|
76
|
+
# @param [Hash] filter an optional filter to use when removing messages
|
77
|
+
def purge(message_count, filter={})
|
78
|
+
invoke_method('purge', {'request' => message_count, 'filter' => filter}, "org.apache.qpid.broker:queue:#{name}")
|
79
|
+
end
|
80
|
+
|
81
|
+
# Reroutes messages from this queue to an exchange, either the queue's
|
82
|
+
# alternate exchange, or the specified exchange
|
83
|
+
# @param [Fixnum] message_count number of messages to reroute from the queue, or 0 for all messages
|
84
|
+
# @param [Boolean] use_alternate_exchange whether to use the queue's alternate exchange as the destination
|
85
|
+
# @param [String] exchange name of destination exchange
|
86
|
+
# @param [Hash] filter an optional filter to use when rerouting messages
|
87
|
+
def reroute(message_count, use_alternate_exchange, exchange, filter)
|
88
|
+
args = {'request' => message_count,
|
89
|
+
'useAltExchange' => use_alternate_exchange,
|
90
|
+
'exchange' => exchange,
|
91
|
+
'filter' => filter}
|
92
|
+
|
93
|
+
invoke_method('reroute', args, "org.apache.qpid.broker:queue:#{name}")
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
#
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
# or more contributor license agreements. See the NOTICE file
|
4
|
+
# distributed with this work for additional information
|
5
|
+
# regarding copyright ownership. The ASF licenses this file
|
6
|
+
# to you under the Apache License, Version 2.0 (the
|
7
|
+
# "License"); you may not use this file except in compliance
|
8
|
+
# with the License. You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing,
|
13
|
+
# software distributed under the License is distributed on an
|
14
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
# KIND, either express or implied. See the License for the
|
16
|
+
# specific language governing permissions and limitations
|
17
|
+
# under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
module Qpid
|
21
|
+
module Management
|
22
|
+
# Representation of a session to the broker. Properties include:
|
23
|
+
# - TxnCommits
|
24
|
+
# - TxnCount
|
25
|
+
# - TxnRejects
|
26
|
+
# - TxnStarts
|
27
|
+
# - attached
|
28
|
+
# - channelId
|
29
|
+
# - clientCredit
|
30
|
+
# - connectionRef
|
31
|
+
# - detachedLifespan
|
32
|
+
# - name
|
33
|
+
# - unackedMessages
|
34
|
+
# - vhostRef
|
35
|
+
class Session < BrokerObject
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
# or more contributor license agreements. See the NOTICE file
|
4
|
+
# distributed with this work for additional information
|
5
|
+
# regarding copyright ownership. The ASF licenses this file
|
6
|
+
# to you under the Apache License, Version 2.0 (the
|
7
|
+
# "License"); you may not use this file except in compliance
|
8
|
+
# with the License. You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing,
|
13
|
+
# software distributed under the License is distributed on an
|
14
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
# KIND, either express or implied. See the License for the
|
16
|
+
# specific language governing permissions and limitations
|
17
|
+
# under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
module Qpid
|
21
|
+
module Management
|
22
|
+
# Representation of a subscription. Properties include:
|
23
|
+
# - acknowledged
|
24
|
+
# - arguments
|
25
|
+
# - browsing
|
26
|
+
# - creditMode
|
27
|
+
# - delivered
|
28
|
+
# - exclusive
|
29
|
+
# - name
|
30
|
+
# - queueRef
|
31
|
+
# - sessionRef
|
32
|
+
class Subscription < BrokerObject
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
#
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
# or more contributor license agreements. See the NOTICE file
|
4
|
+
# distributed with this work for additional information
|
5
|
+
# regarding copyright ownership. The ASF licenses this file
|
6
|
+
# to you under the Apache License, Version 2.0 (the
|
7
|
+
# "License"); you may not use this file except in compliance
|
8
|
+
# with the License. You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing,
|
13
|
+
# software distributed under the License is distributed on an
|
14
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
# KIND, either express or implied. See the License for the
|
16
|
+
# specific language governing permissions and limitations
|
17
|
+
# under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
require 'qpid_management/broker_agent'
|
21
|
+
require 'qpid_management/broker_object'
|
22
|
+
require 'qpid_management/acl'
|
23
|
+
require 'qpid_management/binding'
|
24
|
+
require 'qpid_management/bridge'
|
25
|
+
require 'qpid_management/broker'
|
26
|
+
require 'qpid_management/cluster'
|
27
|
+
require 'qpid_management/connection'
|
28
|
+
require 'qpid_management/errors'
|
29
|
+
require 'qpid_management/exchange'
|
30
|
+
require 'qpid_management/ha_broker'
|
31
|
+
require 'qpid_management/link'
|
32
|
+
require 'qpid_management/memory'
|
33
|
+
require 'qpid_management/queue'
|
34
|
+
require 'qpid_management/session'
|
35
|
+
require 'qpid_management/subscription'
|
36
|
+
|
37
|
+
module Qpid
|
38
|
+
# The Qpid Management framework is a management framework for Qpid brokers
|
39
|
+
# that uses QMF2.
|
40
|
+
#
|
41
|
+
# ==== Example Usage
|
42
|
+
#
|
43
|
+
# Here is a simple example. It TODO.
|
44
|
+
#
|
45
|
+
# require 'rubygems'
|
46
|
+
# require 'qpid_messaging'
|
47
|
+
# require 'qpid_management'
|
48
|
+
#
|
49
|
+
# # create a connection and open it
|
50
|
+
# conn = Qpid::Messaging::Connection.new(:url => "broker.myqpiddomain.com")
|
51
|
+
# conn.open()
|
52
|
+
#
|
53
|
+
# # create a broker agent
|
54
|
+
# agent = Qpid::Management::BrokerAgent.new(conn)
|
55
|
+
#
|
56
|
+
# # get a reference to the broker
|
57
|
+
# broker = agent.broker
|
58
|
+
#
|
59
|
+
# # print out all exchange names
|
60
|
+
# puts broker.exchanges.map(&:name)
|
61
|
+
#
|
62
|
+
# # print out info about a single exchange
|
63
|
+
# amq_direct = broker.exchange('amq.direct')
|
64
|
+
# puts amq_direct
|
65
|
+
# puts amq_direct.msgDrops
|
66
|
+
#
|
67
|
+
# # create an exchange
|
68
|
+
# broker.add_exchange('topic', 'myexchange')
|
69
|
+
#
|
70
|
+
# # print out all queue names
|
71
|
+
# puts broker.queues.map(&:name)
|
72
|
+
#
|
73
|
+
# # create a queue
|
74
|
+
# broker.add_queue('myqueue')
|
75
|
+
#
|
76
|
+
# # print out info about a single queue
|
77
|
+
# myqueue = broker.queue('myqueue')
|
78
|
+
# puts myqueue.msgDepth
|
79
|
+
module Management
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
# or more contributor license agreements. See the NOTICE file
|
4
|
+
# distributed with this work for additional information
|
5
|
+
# regarding copyright ownership. The ASF licenses this file
|
6
|
+
# to you under the Apache License, Version 2.0 (the
|
7
|
+
# "License"); you may not use this file except in compliance
|
8
|
+
# with the License. You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing,
|
13
|
+
# software distributed under the License is distributed on an
|
14
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
# KIND, either express or implied. See the License for the
|
16
|
+
# specific language governing permissions and limitations
|
17
|
+
# under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
# -*- encoding: utf-8 -*-
|
21
|
+
$:.push File.expand_path("../lib", __FILE__)
|
22
|
+
|
23
|
+
Gem::Specification.new do |s|
|
24
|
+
s.name = "qpid_management"
|
25
|
+
s.version = "1.0"
|
26
|
+
s.authors = ["Apache Qpid Project"]
|
27
|
+
s.email = ["dev@qpid.apache.org"]
|
28
|
+
s.homepage = "http://qpid.apache.org"
|
29
|
+
s.summary = %q{Qpid management library}
|
30
|
+
s.description = %q{Qpid management library}
|
31
|
+
s.files = `git ls-files`.split("\n")
|
32
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
33
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
34
|
+
s.require_paths = ["lib"]
|
35
|
+
s.add_runtime_dependency 'qpid_messaging'
|
36
|
+
end
|