rubywmq 0.3.0-i386-mswin32-mq6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. data/LICENSE +13 -0
  2. data/README +73 -0
  3. data/doc/classes/WMQ.html +6300 -0
  4. data/doc/classes/WMQ/Message.html +376 -0
  5. data/doc/classes/WMQ/Message.src/M000001.html +77 -0
  6. data/doc/classes/WMQ/Message.src/M000002.html +27 -0
  7. data/doc/classes/WMQ/Queue.html +1459 -0
  8. data/doc/classes/WMQ/Queue.src/M000003.html +205 -0
  9. data/doc/classes/WMQ/Queue.src/M000004.html +107 -0
  10. data/doc/classes/WMQ/Queue.src/M000005.html +198 -0
  11. data/doc/classes/WMQ/Queue.src/M000006.html +66 -0
  12. data/doc/classes/WMQ/Queue.src/M000007.html +203 -0
  13. data/doc/classes/WMQ/Queue.src/M000008.html +265 -0
  14. data/doc/classes/WMQ/Queue.src/M000009.html +120 -0
  15. data/doc/classes/WMQ/Queue.src/M000010.html +28 -0
  16. data/doc/classes/WMQ/Queue.src/M000011.html +30 -0
  17. data/doc/classes/WMQ/Queue.src/M000012.html +31 -0
  18. data/doc/classes/WMQ/Queue.src/M000013.html +31 -0
  19. data/doc/classes/WMQ/Queue.src/M000014.html +31 -0
  20. data/doc/classes/WMQ/QueueManager.html +1529 -0
  21. data/doc/classes/WMQ/QueueManager.src/M000015.html +182 -0
  22. data/doc/classes/WMQ/QueueManager.src/M000016.html +194 -0
  23. data/doc/classes/WMQ/QueueManager.src/M000017.html +92 -0
  24. data/doc/classes/WMQ/QueueManager.src/M000018.html +70 -0
  25. data/doc/classes/WMQ/QueueManager.src/M000019.html +49 -0
  26. data/doc/classes/WMQ/QueueManager.src/M000020.html +49 -0
  27. data/doc/classes/WMQ/QueueManager.src/M000021.html +63 -0
  28. data/doc/classes/WMQ/QueueManager.src/M000022.html +61 -0
  29. data/doc/classes/WMQ/QueueManager.src/M000023.html +65 -0
  30. data/doc/classes/WMQ/QueueManager.src/M000024.html +232 -0
  31. data/doc/classes/WMQ/QueueManager.src/M000025.html +30 -0
  32. data/doc/classes/WMQ/QueueManager.src/M000026.html +31 -0
  33. data/doc/classes/WMQ/QueueManager.src/M000027.html +31 -0
  34. data/doc/classes/WMQ/QueueManager.src/M000028.html +38 -0
  35. data/doc/classes/WMQ/QueueManager.src/M000029.html +33 -0
  36. data/doc/classes/WMQ/QueueManager.src/M000030.html +21 -0
  37. data/doc/classes/WMQ/QueueManager.src/M000031.html +284 -0
  38. data/doc/classes/WMQ/QueueManager.src/M000032.html +24 -0
  39. data/doc/classes/WMQ/QueueManager.src/M000033.html +18 -0
  40. data/doc/classes/WMQ/QueueManager.src/M000034.html +46 -0
  41. data/doc/classes/WMQ/QueueManager.src/M000035.html +27 -0
  42. data/doc/classes/WMQ/WMQException.html +111 -0
  43. data/doc/created.rid +1 -0
  44. data/doc/files/ext/lib/wmq_const_admin_rb.html +128 -0
  45. data/doc/files/ext/lib/wmq_const_rb.html +128 -0
  46. data/doc/files/ext/lib/wmq_temp_rb.html +122 -0
  47. data/doc/files/ext/wmq_c.html +101 -0
  48. data/doc/files/ext/wmq_message_c.html +101 -0
  49. data/doc/files/ext/wmq_queue_c.html +101 -0
  50. data/doc/files/ext/wmq_queue_manager_c.html +101 -0
  51. data/doc/fr_class_index.html +31 -0
  52. data/doc/fr_file_index.html +33 -0
  53. data/doc/fr_method_index.html +61 -0
  54. data/doc/index.html +24 -0
  55. data/doc/rdoc-style.css +208 -0
  56. data/examples/each_a.rb +31 -0
  57. data/examples/each_b.rb +40 -0
  58. data/examples/each_header.rb +37 -0
  59. data/examples/files_to_q.cfg +24 -0
  60. data/examples/files_to_q.rb +46 -0
  61. data/examples/get_a.rb +34 -0
  62. data/examples/get_client.rb +50 -0
  63. data/examples/put1_a.rb +24 -0
  64. data/examples/put1_b.rb +32 -0
  65. data/examples/put1_c.rb +31 -0
  66. data/examples/put_a.rb +34 -0
  67. data/examples/put_b.rb +42 -0
  68. data/examples/put_dlh.rb +40 -0
  69. data/examples/put_dynamic_q.rb +37 -0
  70. data/examples/put_rfh.rb +66 -0
  71. data/examples/put_rfh2_a.rb +42 -0
  72. data/examples/put_rfh2_b.rb +42 -0
  73. data/examples/put_xmit_q.rb +32 -0
  74. data/examples/q_to_files.cfg +17 -0
  75. data/examples/q_to_files.rb +47 -0
  76. data/examples/request.rb +59 -0
  77. data/examples/server.rb +96 -0
  78. data/lib/wmq.rb +25 -0
  79. data/lib/wmq/wmq.so +0 -0
  80. data/lib/wmq/wmq_const.rb +745 -0
  81. data/lib/wmq/wmq_const_admin.rb +555 -0
  82. data/lib/wmq/wmq_temp.rb +197 -0
  83. data/tests/test.rb +299 -0
  84. metadata +131 -0
@@ -0,0 +1,30 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>comp_code (WMQ::QueueManager)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre>/*
14
+ * Return the completion code for the last MQ operation
15
+ *
16
+ * Returns =&gt; FixNum
17
+ * * WMQ::MQCC_OK 0
18
+ * * WMQ::MQCC_WARNING 1
19
+ * * WMQ::MQCC_FAILED 2
20
+ * * WMQ::MQCC_UNKNOWN -1
21
+ *
22
+ */
23
+ VALUE QueueManager_comp_code(VALUE self)
24
+ {
25
+ PQUEUE_MANAGER pqm;
26
+ Data_Get_Struct(self, QUEUE_MANAGER, pqm);
27
+ return LONG2NUM(pqm-&gt;comp_code);
28
+ }</pre>
29
+ </body>
30
+ </html>
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>reason_code (WMQ::QueueManager)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre>/*
14
+ * Return the reason code for the last MQ operation
15
+ *
16
+ * Returns =&gt; FixNum
17
+ * * For a complete list of reason codes, please see WMQ Constants or
18
+ * the WebSphere MQ documentation for Reason Codes
19
+ *
20
+ * Note
21
+ * * The list of Reason Codes varies depending on the version of WebSphere MQ
22
+ * and the operating system on which Ruby WMQ was compiled
23
+ */
24
+ VALUE QueueManager_reason_code(VALUE self)
25
+ {
26
+ PQUEUE_MANAGER pqm;
27
+ Data_Get_Struct(self, QUEUE_MANAGER, pqm);
28
+ return LONG2NUM(pqm-&gt;reason_code);
29
+ }</pre>
30
+ </body>
31
+ </html>
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>reason (WMQ::QueueManager)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre>/*
14
+ * Returns a textual representation of the reason_code for the last MQ operation
15
+ *
16
+ * Returns =&gt; String
17
+ * * For a complete list of reasons, please see WMQ Constants or
18
+ * the WebSphere MQ documentation for Reason Codes
19
+ *
20
+ * Note
21
+ * * The list of Reason Codes varies depending on the version of WebSphere MQ
22
+ * and the operating system on which Ruby WMQ was compiled
23
+ */
24
+ VALUE QueueManager_reason(VALUE self)
25
+ {
26
+ PQUEUE_MANAGER pqm;
27
+ Data_Get_Struct(self, QUEUE_MANAGER, pqm);
28
+ return rb_str_new2(wmq_reason(pqm-&gt;reason_code));
29
+ }</pre>
30
+ </body>
31
+ </html>
@@ -0,0 +1,38 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>exception_on_error (WMQ::QueueManager)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre>/*
14
+ * Returns whether this QueueManager instance is set
15
+ * to throw a WMQ::WMQException whenever an MQ operation fails
16
+ *
17
+ * Returns:
18
+ * * true : This QueueManager instance will throw a WMQ::WMQException whenever
19
+ * an MQ operation fails. I.e. if comp_code != WMQ::OK.
20
+ * * false: WMQ::WMQException will not be thrown
21
+ *
22
+ * Note:
23
+ * * RuntimeError and ArgumentError exceptions are always thrown regardless of the
24
+ * value of exception_on_error
25
+ */
26
+ VALUE QueueManager_exception_on_error(VALUE self)
27
+ {
28
+ PQUEUE_MANAGER pqm;
29
+ Data_Get_Struct(self, QUEUE_MANAGER, pqm);
30
+ if (pqm-&gt;exception_on_error)
31
+ {
32
+ return Qtrue;
33
+ }
34
+
35
+ return Qfalse;
36
+ }</pre>
37
+ </body>
38
+ </html>
@@ -0,0 +1,33 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>connected? (WMQ::QueueManager)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre>/*
14
+ * Returns whether this QueueManager instance is currently
15
+ * connected to a WebSphere MQ queue manager
16
+ *
17
+ * Returns:
18
+ * * true : This QueueManager instance is connected to a local or remote queue manager
19
+ * * false: This QueueManager instance is not currently connected to a local or
20
+ * remote queue manager
21
+ */
22
+ VALUE QueueManager_connected_q(VALUE self)
23
+ {
24
+ PQUEUE_MANAGER pqm;
25
+ Data_Get_Struct(self, QUEUE_MANAGER, pqm);
26
+ if (pqm-&gt;hcon)
27
+ {
28
+ return Qtrue;
29
+ }
30
+ return Qfalse;
31
+ }</pre>
32
+ </body>
33
+ </html>
@@ -0,0 +1,21 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>name (WMQ::QueueManager)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre>/*
14
+ * Returns the QueueManager name =&gt; String
15
+ */
16
+ VALUE QueueManager_name(VALUE self)
17
+ {
18
+ return rb_iv_get(self,&quot;@name&quot;);
19
+ }</pre>
20
+ </body>
21
+ </html>
@@ -0,0 +1,284 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>execute (WMQ::QueueManager)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre>/*
14
+ * call-seq:
15
+ * execute(...)
16
+ *
17
+ * Execute an Administration command against the local queue manager
18
+ *
19
+ * Parameters:
20
+ * * Since the number of parameters can vary dramatically, all parameters are passed by name in a hash
21
+ * * The entire MQ Administration interface has been implemented.
22
+ * Rather than re-documentation the hundreds of options, a standard
23
+ * convention has been used to map the MQ constants to Symbols in Ruby.
24
+ *
25
+ * For all MQ Admin commands, just drop the MQAI_ off the front and
26
+ * convert the command name to lower case.
27
+ * * E.g. MQAI_INQUIRE_Q becomes inquire_q
28
+ *
29
+ * For the hundreds of parameters, a similiar technique is followed.
30
+ * Remove the prefixes: MQCA_, MQIA_, etc.. and convert to lowercase
31
+ * * E.g. MQCA_Q_NAME becomes :q_name
32
+ *
33
+ * Example
34
+ * WMQ::QueueManager.connect do |qmgr|
35
+ * result = qmgr.execute(
36
+ * :command =&gt; :inquire_q,
37
+ * :q_name =&gt; 'MY.LOCAL.QUEUE',
38
+ * :q_type =&gt; WMQ::MQQT_LOCAL,
39
+ * :current_q_depth =&gt; nil
40
+ * )
41
+ * # OR, we can replace the method name execute with the MQAI command:
42
+ * result = qmgr.inquire_q(
43
+ * :q_name =&gt; 'MY.LOCAL.QUEUE',
44
+ * :q_type =&gt; WMQ::MQQT_LOCAL,
45
+ * :current_q_depth =&gt; nil
46
+ * )
47
+ *
48
+ * Complete Example:
49
+ * require 'wmq/wmq'
50
+ * require 'wmq/wmq_const_admin'
51
+ * WMQ::QueueManager.connect(:q_mgr_name=&gt;'REID', :connection_name=&gt;'localhost(1414)') do |qmgr|
52
+ * qmgr.reset_q_stats(:q_name=&gt;'*').each {|item| p item }
53
+ * end
54
+ *
55
+ * Some one line examples
56
+ * qmgr.inquire_q(:q_name=&gt;'TEST*').each {|item| p item }
57
+ *
58
+ * qmgr.inquire_q(:q_name=&gt;'TEST*', :q_type=&gt;WMQ::MQQT_LOCAL, :current_q_depth=&gt;nil).each {|item| p item }
59
+ *
60
+ * qmgr.inquire_process(:process_name=&gt;'*').each {|item| p item }
61
+ *
62
+ * qmgr.ping_q_mgr.each {|item| p item }
63
+ *
64
+ * qmgr.refresh_security.each {|item| p item }
65
+ *
66
+ * qmgr.inquire_q_status(:q_name=&gt;'TEST*', :q_status_type=&gt;:q_status, :q_status_attrs=&gt;:process_id).each {|item| p item }
67
+ *
68
+ * qmgr.start_channel_listener.each {|item| p item }
69
+ *
70
+ * qmgr.inquire_channel_status(:channel_name=&gt;'*').each {|item| p item }
71
+ */
72
+ VALUE QueueManager_execute(VALUE self, VALUE hash)
73
+ {
74
+ #ifdef MQHB_UNUSABLE_HBAG
75
+ VALUE val, str;
76
+ PQUEUE_MANAGER pqm;
77
+ Data_Get_Struct(self, QUEUE_MANAGER, pqm);
78
+
79
+ Check_Type(hash, T_HASH);
80
+
81
+ if (pqm-&gt;admin_bag == MQHB_UNUSABLE_HBAG) /* Lazy create admin bag */
82
+ {
83
+ pqm-&gt;mqCreateBag(MQCBO_ADMIN_BAG, &amp;pqm-&gt;admin_bag, &amp;pqm-&gt;comp_code, &amp;pqm-&gt;reason_code);
84
+ CHECK_COMPLETION_CODE(&quot;Creating the admin bag&quot;)
85
+ }
86
+ else
87
+ {
88
+ pqm-&gt;mqClearBag(pqm-&gt;admin_bag, &amp;pqm-&gt;comp_code, &amp;pqm-&gt;reason_code);
89
+ CHECK_COMPLETION_CODE(&quot;Clearing the admin bag&quot;)
90
+ }
91
+
92
+ if (pqm-&gt;reply_bag == MQHB_UNUSABLE_HBAG) /* Lazy create reply bag */
93
+ {
94
+ pqm-&gt;mqCreateBag(MQCBO_ADMIN_BAG, &amp;pqm-&gt;reply_bag, &amp;pqm-&gt;comp_code, &amp;pqm-&gt;reason_code);
95
+ CHECK_COMPLETION_CODE(&quot;Creating the reply bag&quot;)
96
+ }
97
+ else
98
+ {
99
+ pqm-&gt;mqClearBag(pqm-&gt;reply_bag, &amp;pqm-&gt;comp_code, &amp;pqm-&gt;reason_code);
100
+ CHECK_COMPLETION_CODE(&quot;Clearing the reply bag&quot;)
101
+ }
102
+
103
+ val = rb_hash_aref(hash, ID2SYM(ID_command)); /* :command */
104
+ if (NIL_P(val))
105
+ {
106
+ rb_raise(rb_eArgError, &quot;WMQ::QueueManager#execute Mandatory parameter :command missing&quot;);
107
+ }
108
+ #if RUBY_VERSION_CODE &gt; 183
109
+ rb_hash_foreach(hash, QueueManager_execute_each, (VALUE)pqm);
110
+ #else
111
+ rb_iterate (rb_each, hash, QueueManager_execute_each, (VALUE)pqm);
112
+ #endif
113
+ if(pqm-&gt;trace_level) printf (&quot;WMQ::QueueManager#execute() Queue Manager Handle:%ld\n&quot;, pqm-&gt;hcon);
114
+
115
+ pqm-&gt;mqExecute(
116
+ pqm-&gt;hcon, /* MQ connection handle */
117
+ wmq_command_lookup(rb_to_id(val)), /* Command to be executed */
118
+ MQHB_NONE, /* No options bag */
119
+ pqm-&gt;admin_bag, /* Handle to bag containing commands */
120
+ pqm-&gt;reply_bag, /* Handle to bag to receive the response*/
121
+ MQHO_NONE, /* Put msg on SYSTEM.ADMIN.COMMAND.QUEUE*/
122
+ MQHO_NONE, /* Create a dynamic q for the response */
123
+ &amp;pqm-&gt;comp_code, /* Completion code from the mqexecute */
124
+ &amp;pqm-&gt;reason_code); /* Reason code from mqexecute call */
125
+
126
+ if(pqm-&gt;trace_level) printf(&quot;WMQ::QueueManager#execute() completed with reason:%s\n&quot;, wmq_reason(pqm-&gt;reason_code));
127
+
128
+ if (pqm-&gt;comp_code == MQCC_OK)
129
+ {
130
+ MQLONG numberOfBags; /* number of bags in response bag */
131
+ MQHBAG qAttrsBag; /* bag containing q attributes */
132
+ VALUE array;
133
+ MQLONG size;
134
+ MQLONG length;
135
+ MQCHAR inquiry_buffer[WMQ_EXEC_STRING_INQ_BUFFER_SIZE];
136
+ PMQCHAR pChar;
137
+
138
+ MQLONG qDepth; /* depth of queue */
139
+ MQLONG item_type;
140
+ MQLONG selector;
141
+ MQLONG number_of_items;
142
+ int bag_index, items, k;
143
+
144
+ pqm-&gt;mqCountItems(pqm-&gt;reply_bag, MQHA_BAG_HANDLE, &amp;numberOfBags, &amp;pqm-&gt;comp_code, &amp;pqm-&gt;reason_code);
145
+ CHECK_COMPLETION_CODE(&quot;Counting number of bags returned from the command server&quot;)
146
+
147
+ if(pqm-&gt;trace_level &gt; 1) printf(&quot;WMQ::QueueManager#execute() %ld bags returned\n&quot;, numberOfBags);
148
+ array = rb_ary_new2(numberOfBags);
149
+
150
+ for ( bag_index=0; bag_index&lt;numberOfBags; bag_index++) /* For each bag, extract the queue depth */
151
+ {
152
+ hash = rb_hash_new();
153
+
154
+ pqm-&gt;mqInquireBag(pqm-&gt;reply_bag, MQHA_BAG_HANDLE, bag_index, &amp;qAttrsBag, &amp;pqm-&gt;comp_code, &amp;pqm-&gt;reason_code);
155
+ CHECK_COMPLETION_CODE(&quot;Inquiring for the attribute bag handle&quot;)
156
+
157
+ pqm-&gt;mqCountItems(qAttrsBag, MQSEL_ALL_SELECTORS, &amp;number_of_items, &amp;pqm-&gt;comp_code, &amp;pqm-&gt;reason_code);
158
+ CHECK_COMPLETION_CODE(&quot;Counting number of items in this bag&quot;)
159
+
160
+ if(pqm-&gt;trace_level &gt; 1) printf(&quot;WMQ::QueueManager#execute() Bag %ld contains %ld items\n&quot;, bag_index, number_of_items);
161
+
162
+ for (items=0; items&lt;number_of_items; items++) /* For each item, extract it's value */
163
+ {
164
+ pqm-&gt;mqInquireItemInfo(
165
+ qAttrsBag, /* I: Bag handle */
166
+ MQSEL_ANY_SELECTOR, /* I: Item selector */
167
+ items, /* I: Item index */
168
+ &amp;selector, /* O: Selector of item */
169
+ &amp;item_type, /* O: Data type of item */
170
+ &amp;pqm-&gt;comp_code,
171
+ &amp;pqm-&gt;reason_code);
172
+ CHECK_COMPLETION_CODE(&quot;Inquiring Item details&quot;)
173
+
174
+ if (selector &gt; 0) /* Skip system selectors */
175
+ {
176
+ switch (item_type)
177
+ {
178
+ case MQIT_INTEGER:
179
+ pqm-&gt;mqInquireInteger(qAttrsBag, MQSEL_ALL_SELECTORS, items, &amp;qDepth, &amp;pqm-&gt;comp_code, &amp;pqm-&gt;reason_code);
180
+ CHECK_COMPLETION_CODE(&quot;Inquiring Integer item&quot;)
181
+
182
+ if(pqm-&gt;trace_level &gt; 1)
183
+ printf(&quot;WMQ::QueueManager#execute() Item %ld: Integer:%ld, selector:%ld\n&quot;, items, qDepth, selector);
184
+
185
+ rb_hash_aset(hash, ID2SYM(wmq_selector_id(selector)), LONG2NUM(qDepth));
186
+ break;
187
+
188
+ case MQIT_STRING:
189
+ pqm-&gt;mqInquireString(qAttrsBag, MQSEL_ALL_SELECTORS, items, WMQ_EXEC_STRING_INQ_BUFFER_SIZE-1, inquiry_buffer,
190
+ &amp;size, NULL, &amp;pqm-&gt;comp_code, &amp;pqm-&gt;reason_code);
191
+ if(pqm-&gt;trace_level &gt; 2)
192
+ printf(&quot;WMQ::QueueManager#execute() mqInquireString buffer size: %ld, string size:%ld\n&quot;,
193
+ WMQ_EXEC_STRING_INQ_BUFFER_SIZE,size);
194
+ CHECK_COMPLETION_CODE(&quot;Inquiring String item&quot;)
195
+
196
+ length = 0;
197
+ pChar = inquiry_buffer + size-1;
198
+ for (k = size; k &gt; 0; k--)
199
+ {
200
+ if (*pChar != ' ' &amp;&amp; *pChar != 0)
201
+ {
202
+ length = k;
203
+ break;
204
+ }
205
+ pChar--;
206
+ }
207
+ rb_hash_aset(hash, ID2SYM(wmq_selector_id(selector)), rb_str_new(inquiry_buffer, length));
208
+
209
+ if(pqm-&gt;trace_level &gt; 1)
210
+ {
211
+ inquiry_buffer[length] = '\0';
212
+ printf(&quot;WMQ::QueueManager#execute() Item %ld: String:'%s', selector:%ld\n&quot;,
213
+ items, inquiry_buffer, selector);
214
+ }
215
+ break;
216
+
217
+ case MQIT_BAG:
218
+ printf(&quot;Ignoring Bag at this level\n&quot;);
219
+ break;
220
+
221
+ default:
222
+ printf(&quot;Ignoring Unknown type:%ld\n&quot;, item_type);
223
+ break;
224
+ }
225
+ }
226
+ }
227
+ rb_ary_push(array, hash);
228
+ }
229
+ return array;
230
+ }
231
+ else
232
+ {
233
+ VALUE name = rb_iv_get(self,&quot;@name&quot;);
234
+ name = StringValue(name);
235
+
236
+ if (pqm-&gt;reason_code == MQRCCF_COMMAND_FAILED)
237
+ {
238
+ /* Find out why admin command failed */
239
+ MQLONG result_comp_code, result_reason_code;
240
+ MQHBAG result_bag;
241
+
242
+ pqm-&gt;mqInquireBag(pqm-&gt;reply_bag, MQHA_BAG_HANDLE, 0, &amp;result_bag, &amp;pqm-&gt;comp_code, &amp;pqm-&gt;reason_code);
243
+ CHECK_COMPLETION_CODE(&quot;Getting the result bag handle&quot;)
244
+
245
+ pqm-&gt;mqInquireInteger(result_bag, MQIASY_COMP_CODE, MQIND_NONE, &amp;result_comp_code, &amp;pqm-&gt;comp_code, &amp;pqm-&gt;reason_code);
246
+ CHECK_COMPLETION_CODE(&quot;Getting the completion code from the result bag&quot;)
247
+
248
+ pqm-&gt;mqInquireInteger(result_bag, MQIASY_REASON, MQIND_NONE, &amp;result_reason_code, &amp;pqm-&gt;comp_code, &amp;pqm-&gt;reason_code);
249
+ CHECK_COMPLETION_CODE(&quot;Getting the reason code from the result bag&quot;)
250
+
251
+ pqm-&gt;comp_code = result_comp_code;
252
+ pqm-&gt;reason_code = result_reason_code;
253
+
254
+ if(pqm-&gt;trace_level)
255
+ printf(&quot;WMQ::QueueManager#execute() Error returned by command server:%s\n&quot;, wmq_reason(pqm-&gt;reason_code));
256
+ }
257
+
258
+ if (pqm-&gt;exception_on_error)
259
+ {
260
+ if (pqm-&gt;reason_code == MQRC_CMD_SERVER_NOT_AVAILABLE)
261
+ {
262
+ rb_raise(wmq_exception,
263
+ &quot;WMQ::QueueManager#execute(). Please start the WebSphere MQ Command Server : 'strmqcsv %s', reason:%s&quot;,
264
+ RSTRING(name)-&gt;ptr,
265
+ wmq_reason(pqm-&gt;reason_code));
266
+ }
267
+ else
268
+ {
269
+ rb_raise(wmq_exception,
270
+ &quot;WMQ::QueueManager#execute(). Error executing admin command on Queue Manager:%s, reason:%s&quot;,
271
+ RSTRING(name)-&gt;ptr,
272
+ wmq_reason(pqm-&gt;reason_code));
273
+ }
274
+ }
275
+ return Qfalse;
276
+ }
277
+ return Qnil;
278
+ #else
279
+ rb_notimplement();
280
+ return Qfalse;
281
+ #endif
282
+ }</pre>
283
+ </body>
284
+ </html>