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,182 @@
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>connect (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
+ * connect(...)
16
+ *
17
+ * Connect to the queue manager, then disconnect once the supplied code block completes
18
+ *
19
+ * Parameters:
20
+ * * Since the number of parameters can vary dramatically, all parameters are passed by name in a hash
21
+ * * Summary of parameters and their WebSphere MQ equivalents:
22
+ * WMQ::QueueManager.connect( # WebSphere MQ Equivalents:
23
+ * :q_mgr_name =&gt; 'queue_manager name',
24
+ * :exception_on_error =&gt; true, # n/a
25
+ * :connect_options =&gt; WMQ::MQCNO_FASTBATH_BINDING # MQCNO.Options
26
+ *
27
+ * :trace_level =&gt; 0, # n/a
28
+ *
29
+ * # Common client connection parameters
30
+ * :channel_name =&gt; 'svrconn channel name', # MQCD.ChannelName
31
+ * :connection_name =&gt; 'localhost(1414)', # MQCD.ConnectionName
32
+ * :transport_type =&gt; WMQ::MQXPT_TCP, # MQCD.TransportType
33
+ *
34
+ * # Advanced client connections parameters
35
+ * :max_msg_length =&gt; 65535, # MQCD.MaxMsgLength
36
+ * :security_exit =&gt; 'Name of security exit', # MQCD.SecurityExit
37
+ * :send_exit =&gt; 'Name of send exit', # MQCD.SendExit
38
+ * :receive_exit =&gt; 'Name of receive exit', # MQCD.ReceiveExit
39
+ * :security_user_data =&gt; 'Security exit User data', # MQCD.SecurityUserData
40
+ * :send_user_data =&gt; 'Send exit user data', # MQCD.SendUserData
41
+ * :receive_user_data =&gt; 'Receive exit user data', # MQCD.ReceiveUserData
42
+ * :heartbeat_interval =&gt; 1, # MQCD.HeartbeatInterval
43
+ * :remote_security_id =&gt; 'Remote Security id', # MQCD.RemoteSecurityId
44
+ * :ssl_cipher_spec =&gt; 'SSL Cipher Spec', # MQCD.SSLCipherSpec
45
+ * :keep_alive_interval=&gt; -1, # MQCD.KeepAliveInterval
46
+ * :mode_name =&gt; 'LU6.2 Mode Name', # MQCD.ModeName
47
+ * :tp_name =&gt; 'LU6.2 Transaction pgm name', # MQCD.TpName
48
+ * :user_identifier =&gt; 'LU 6.2 Userid', # MQCD.UserIdentifier
49
+ * :password =&gt; 'LU6.2 Password', # MQCD.Password
50
+ * :long_remote_user_id=&gt; 'Long remote user identifier', # MQCD.LongRemoteUserId (Ptr, Length)
51
+ * :ssl_peer_name =&gt; 'SSL Peer name', # MQCD.SSLPeerName (Ptr, Length)
52
+ *
53
+ * # SSL Options
54
+ * :key_repository =&gt; '/var/mqm/qmgrs/.../key', # MQSCO.KeyRepository
55
+ * :crypto_hardware =&gt; 'GSK_ACCELERATOR_NCIPHER_NF_ON', # MQSCO.CryptoHardware
56
+ * )
57
+ *
58
+ * Optional Parameters
59
+ * * :q_mgr_name =&gt; String
60
+ * * Name of the existing WebSphere MQ Queue Manager to connect to
61
+ *
62
+ * * Default:
63
+ * - Server connections will connect to the default queue manager
64
+ * - Client connections will connect to whatever queue
65
+ * manager is found at the host and port number as specified
66
+ * by the connection_name
67
+ *
68
+ * * :exception_on_error =&gt; true or false
69
+ * Determines whether WMQ::WMQExceptions are thrown whenever
70
+ * an error occurs during a WebSphere MQ operation (connect, put, get, etc..)
71
+ *
72
+ * Default: true
73
+ *
74
+ * * :connect_options =&gt; FixNum
75
+ * * One or more of the following values:
76
+ * WMQ::MQCNO_STANDARD_BINDING
77
+ * WMQ::MQCNO_FASTPATH_BINDING
78
+ * WMQ::MQCNO_SHARED_BINDING
79
+ * WMQ::MQCNO_ISOLATED_BINDING
80
+ * WMQ::MQCNO_ACCOUNTING_MQI_ENABLED
81
+ * WMQ::MQCNO_ACCOUNTING_MQI_DISABLED
82
+ * WMQ::MQCNO_ACCOUNTING_Q_ENABLED
83
+ * WMQ::MQCNO_ACCOUNTING_Q_DISABLED
84
+ * WMQ::MQCNO_NONE
85
+ *
86
+ * * Multiple values can be or'd together. E.g.
87
+ * :connect_options=&gt;WMQ::MQCNO_FASTPATH_BINDING | WMQ::MQCNO_ACCOUNTING_MQI_ENABLED
88
+ *
89
+ * * Please see the WebSphere MQ MQCNO data type documentation for more details
90
+ * Default: WMQ::MQCNO_NONE
91
+ *
92
+ * * :trace_level =&gt; FixNum
93
+ * * Turns on low-level tracing of the WebSphere MQ API calls to stdout.
94
+ * * 0: No tracing
95
+ * * 1: MQ API tracing only (MQCONNX, MQOPEN, MQPUT, etc..)
96
+ * * 2: Include Ruby WMQ tracing
97
+ * * 3: Verbose logging (Recommended for when reporting problems in Ruby WMQ)
98
+ * Default: 0
99
+ *
100
+ * Common Client Connection Parameters (Client connections only)
101
+ * * :connection_name =&gt; String (Mandatory for client connections)
102
+ * * Connection name, made up of the host name (or ip address) and the port number
103
+ * * E.g.
104
+ * 'mymachine.domain.com(1414)'
105
+ * '192.168.0.1(1417)'
106
+ *
107
+ * * :channel_name =&gt; String
108
+ * * Name of SVRCONN channel defined on the QueueManager for Client Connections
109
+ * * Default Value:
110
+ * 'SYSTEM.DEF.SVRCONN'
111
+ *
112
+ * * :transport_type =&gt; WMQ::MQXPT_TCP, # MQCD.TransportType
113
+ * * Valid Values:
114
+ * WMQ::MQXPT_LOCAL
115
+ * WMQ::MQXPT_LU62
116
+ * WMQ::MQXPT_TCP
117
+ * WMQ::MQXPT_NETBIOS
118
+ * WMQ::MQXPT_SPX
119
+ * WMQ::MQXPT_DECNET
120
+ * WMQ::MQXPT_UDP
121
+ *
122
+ * * Default Value:
123
+ * WMQ::MQXPT_TCP
124
+ *
125
+ * For the Advanced Client Connection parameters, please see the WebSphere MQ documentation
126
+ *
127
+ * Note:
128
+ * * If an exception is not caught in the code block, the current unit of work is
129
+ * automatically backed out, before disconnecting from the queue manager.
130
+ *
131
+ * Local Server Connection Example:
132
+ * require 'wmq/wmq'
133
+ *
134
+ * WMQ::QueueManager.connect(:q_mgr_name=&gt;'REID') do |qmgr|
135
+ * qmgr.put(:q_name=&gt;'TEST.QUEUE', :data =&gt; 'Hello World')
136
+ * end
137
+ *
138
+ * Client Connection Example:
139
+ * require 'wmq/wmq_client'
140
+ *
141
+ * WMQ::QueueManager.connect(
142
+ * :channel_name =&gt; 'SYSTEM.DEF.SVRCONN',
143
+ * :transport_type =&gt; WMQ::MQXPT_TCP,
144
+ * :connection_name =&gt; 'localhost(1414)' ) do |qmgr|
145
+ * qmgr.open_queue(:q_name=&gt;'TEST.QUEUE', :mode=&gt;:input) do |queue|
146
+ *
147
+ * message = WMQ::Message.new
148
+ * if queue.get(:message =&gt; message)
149
+ * puts &quot;Data Received: #{message.data}&quot;
150
+ * else
151
+ * puts 'No message available'
152
+ * end
153
+ * end
154
+ * end
155
+ */
156
+ VALUE QueueManager_singleton_connect(int argc, VALUE *argv, VALUE self)
157
+ {
158
+ VALUE proc, parameters, queue_manager;
159
+
160
+ /* Extract parameters and code block (Proc) */
161
+ rb_scan_args(argc, argv, &quot;1&amp;&quot;, &amp;parameters, &amp;proc);
162
+
163
+ queue_manager = rb_funcall(wmq_queue_manager, ID_new, 1, parameters);
164
+ if(!NIL_P(proc))
165
+ {
166
+ if(Qtrue == QueueManager_connect(queue_manager))
167
+ {
168
+ struct QueueManager_singleton_connect_arg arg;
169
+ arg.self = queue_manager;
170
+ arg.proc = proc;
171
+ rb_ensure(QueueManager_singleton_connect_body, (VALUE)&amp;arg,
172
+ QueueManager_singleton_connect_ensure, queue_manager);
173
+ }
174
+ else
175
+ {
176
+ return Qfalse;
177
+ }
178
+ }
179
+ return queue_manager;
180
+ }</pre>
181
+ </body>
182
+ </html>
@@ -0,0 +1,194 @@
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>new (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
+ * new(...)
16
+ *
17
+ * Parameters:
18
+ * * Since the number of parameters can vary dramatically, all parameters are passed by name in a hash
19
+ * * See QueueManager.new for details on all the parameters
20
+ *
21
+ * Note:
22
+ * * It is not recommended to use this method, rather use QueueManager.connect, since
23
+ * it will automatically disconnect from the queue manager. It also deals with backing out
24
+ * the current unit of work in the event of an unhandled exception. E.g. Syntax Error
25
+ * * RuntimeError and ArgumentError exceptions are always thrown regardless of the
26
+ * value of :exception_on_error
27
+ *
28
+ * Todo:
29
+ * * Support multiple send and receive exits
30
+ */
31
+ VALUE QueueManager_initialize(VALUE self, VALUE hash)
32
+ {
33
+ VALUE val;
34
+ VALUE str;
35
+ size_t size;
36
+ size_t length;
37
+ size_t i;
38
+ PQUEUE_MANAGER pqm;
39
+ char* pChar;
40
+
41
+ Check_Type(hash, T_HASH);
42
+
43
+ Data_Get_Struct(self, QUEUE_MANAGER, pqm);
44
+
45
+ WMQ_HASH2MQLONG(hash,trace_level, pqm-&gt;trace_level)
46
+
47
+ /* @name = options[:q_mgr_name] || '' # QMGR Name optional with Client Connection */
48
+ val = rb_hash_aref(hash, ID2SYM(ID_q_mgr_name));
49
+ if (NIL_P(val))
50
+ {
51
+ rb_iv_set(self, &quot;@name&quot;, rb_str_new2(&quot;&quot;));
52
+ if(pqm-&gt;trace_level &gt; 1) printf(&quot;WMQ::QueueManager#initialize() Queue Manager:[Not specified, use Default QMGR]\n&quot;);
53
+ }
54
+ else
55
+ {
56
+ rb_iv_set(self, &quot;@name&quot;, val);
57
+ if(pqm-&gt;trace_level &gt; 1) printf(&quot;WMQ::QueueManager#initialize() Queue Manager:%s\n&quot;, RSTRING(val)-&gt;ptr);
58
+ }
59
+
60
+ WMQ_HASH2BOOL(hash,exception_on_error, pqm-&gt;exception_on_error)
61
+
62
+ /*
63
+ * All Client connection parameters are ignored if connection_name is missing
64
+ */
65
+ #ifdef MQCNO_VERSION_2
66
+ if(!NIL_P(rb_hash_aref(hash, ID2SYM(ID_connection_name))))
67
+ {
68
+ PMQCD pmqcd = &amp;pqm-&gt;client_conn; /* Process MQCD */
69
+ pqm-&gt;is_client_conn = 1; /* Set to Client connection */
70
+
71
+ WMQ_HASH2MQCHARS(hash,connection_name, pmqcd-&gt;ConnectionName)
72
+ WMQ_HASH2MQLONG (hash,transport_type, pmqcd-&gt;TransportType)
73
+ WMQ_HASH2MQCHARS(hash,mode_name, pmqcd-&gt;ModeName)
74
+ WMQ_HASH2MQCHARS(hash,tp_name, pmqcd-&gt;TpName)
75
+ WMQ_HASH2MQCHARS(hash,security_exit, pmqcd-&gt;SecurityExit)
76
+ WMQ_HASH2MQCHARS(hash,send_exit, pmqcd-&gt;SendExit)
77
+ WMQ_HASH2MQCHARS(hash,receive_exit, pmqcd-&gt;ReceiveExit)
78
+ WMQ_HASH2MQLONG (hash,max_msg_length, pmqcd-&gt;MaxMsgLength)
79
+ WMQ_HASH2MQCHARS(hash,security_user_data, pmqcd-&gt;SecurityUserData)
80
+ WMQ_HASH2MQCHARS(hash,send_user_data, pmqcd-&gt;SendUserData)
81
+ WMQ_HASH2MQCHARS(hash,receive_user_data, pmqcd-&gt;ReceiveUserData)
82
+ WMQ_HASH2MQCHARS(hash,user_identifier, pmqcd-&gt;UserIdentifier)
83
+ WMQ_HASH2MQCHARS(hash,password, pmqcd-&gt;Password)
84
+
85
+ /* Default channel name to system default */
86
+ val = rb_hash_aref(hash, ID2SYM(ID_channel_name));
87
+ if (NIL_P(val))
88
+ {
89
+ strncpy(pmqcd-&gt;ChannelName, &quot;SYSTEM.DEF.SVRCONN&quot;, sizeof(pmqcd-&gt;ChannelName));
90
+ }
91
+ else
92
+ {
93
+ WMQ_HASH2MQCHARS(hash,channel_name, pmqcd-&gt;ChannelName)
94
+ }
95
+
96
+ #ifdef MQCD_VERSION_4
97
+ WMQ_HASH2MQLONG(hash,heartbeat_interval, pmqcd-&gt;HeartbeatInterval)
98
+ /* TODO:
99
+ WMQ_HASH2MQLONG(hash,exit_name_length, pmqcd-&gt;ExitNameLength)
100
+ WMQ_HASH2MQLONG(hash,exit_data_length, pmqcd-&gt;ExitDataLength)
101
+ WMQ_HASH2MQLONG(hash,send_exits_defined, pmqcd-&gt;SendExitsDefined)
102
+ WMQ_HASH2MQLONG(hash,receive_exits_defined, pmqcd-&gt;ReceiveExitsDefined)
103
+ TO_PTR (send_exit_ptr, pmqcd-&gt;SendExitPtr)
104
+ TO_PTR (send_user_data_ptr, pmqcd-&gt;SendUserDataPtr)
105
+ TO_PTR (receive_exit_ptr, pmqcd-&gt;ReceiveExitPtr)
106
+ TO_PTR (receive_user_data_ptr, pmqcd-&gt;ReceiveUserDataPtr)
107
+ */
108
+ #endif
109
+ #ifdef MQCD_VERSION_6
110
+ val = rb_hash_aref(hash, ID2SYM(ID_long_remote_user_id));
111
+ if (!NIL_P(val))
112
+ {
113
+ str = StringValue(val);
114
+ length = RSTRING(str)-&gt;len;
115
+
116
+ if (length &gt; 0)
117
+ {
118
+ MQPTR pBuffer;
119
+ if(pqm-&gt;trace_level &gt; 1)
120
+ printf(&quot;WMQ::QueueManager#initialize() Setting long_remote_user_id:%s\n&quot;,
121
+ RSTRING(str)-&gt;ptr);
122
+
123
+ /* Include null at end of string */
124
+ pBuffer = ALLOC_N(char, length+1);
125
+ memcpy(pBuffer, RSTRING(str)-&gt;ptr, length+1);
126
+
127
+ pmqcd-&gt;LongRemoteUserIdLength = length;
128
+ pmqcd-&gt;LongRemoteUserIdPtr = pBuffer;
129
+ pqm-&gt;long_remote_user_id_ptr = pBuffer;
130
+ }
131
+ }
132
+ WMQ_HASH2MQBYTES(hash,remote_security_id, pmqcd-&gt;RemoteSecurityId)
133
+ WMQ_HASH2MQCHARS(hash,ssl_cipher_spec, pmqcd-&gt;SSLCipherSpec)
134
+ #endif
135
+ #ifdef MQCD_VERSION_7
136
+ val = rb_hash_aref(hash, ID2SYM(ID_ssl_peer_name));
137
+ if (!NIL_P(val))
138
+ {
139
+ str = StringValue(val);
140
+ length = RSTRING(str)-&gt;len;
141
+
142
+ if (length &gt; 0)
143
+ {
144
+ MQPTR pBuffer;
145
+ if(pqm-&gt;trace_level &gt; 1)
146
+ printf(&quot;WMQ::QueueManager#initialize() Setting ssl_peer_name:%s\n&quot;,
147
+ RSTRING(str)-&gt;ptr);
148
+
149
+ /* Include null at end of string */
150
+ pBuffer = ALLOC_N(char, length+1);
151
+ memcpy(pBuffer, RSTRING(str)-&gt;ptr, length+1);
152
+
153
+ pmqcd-&gt;SSLPeerNameLength = length;
154
+ pmqcd-&gt;SSLPeerNamePtr = pBuffer;
155
+ pqm-&gt;ssl_peer_name_ptr = pBuffer;
156
+ }
157
+ }
158
+ WMQ_HASH2MQLONG(hash,keep_alive_interval, pmqcd-&gt;KeepAliveInterval)
159
+
160
+ /* Only set if SSL options are supplied, otherwise
161
+ * environment variables are ignored: MQSSLKEYR and MQSSLCRYP
162
+ * Any SSL info in the client channel definition tables is also ignored
163
+ */
164
+ if (!NIL_P(rb_hash_aref(hash, ID2SYM(ID_key_repository))) ||
165
+ !NIL_P(rb_hash_aref(hash, ID2SYM(ID_crypto_hardware))))
166
+ {
167
+ /* Process MQSCO */
168
+ WMQ_HASH2MQCHARS(hash,key_repository, pqm-&gt;ssl_config_opts.KeyRepository)
169
+ WMQ_HASH2MQCHARS(hash,crypto_hardware, pqm-&gt;ssl_config_opts.CryptoHardware)
170
+
171
+ pqm-&gt;connect_options.SSLConfigPtr = &amp;pqm-&gt;ssl_config_opts;
172
+ }
173
+ #endif
174
+
175
+ }
176
+ else
177
+ {
178
+ pqm-&gt;is_client_conn = 0; /* Set to Server connection */
179
+ }
180
+ #endif
181
+
182
+ #ifdef MQCNO_VERSION_4
183
+ /* Process MQCNO */
184
+ WMQ_HASH2MQLONG(hash,connect_options, pqm-&gt;connect_options.Options)
185
+ #endif
186
+
187
+ /* --------------------------------------------------
188
+ * TODO: MQAIR Structure - LDAP Security
189
+ * --------------------------------------------------*/
190
+
191
+ return Qnil;
192
+ }</pre>
193
+ </body>
194
+ </html>
@@ -0,0 +1,92 @@
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>connect (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
+ * Before working with any queues, it is necessary to connect
15
+ * to the queue manager.
16
+ *
17
+ * Returns:
18
+ * * true : On Success
19
+ * * false: On Failure
20
+ *
21
+ * comp_code and reason_code are also updated.
22
+ * reason will return a text description of the reason_code
23
+ *
24
+ * Throws:
25
+ * * WMQ::WMQException if comp_code != MQCC_OK
26
+ * * Except if :exception_on_error =&gt; false was supplied as a parameter
27
+ * to QueueManager.new
28
+ */
29
+ VALUE QueueManager_connect(VALUE self)
30
+ {
31
+ VALUE name;
32
+ VALUE str;
33
+ VALUE val;
34
+ VALUE hash;
35
+
36
+ PQUEUE_MANAGER pqm;
37
+ Data_Get_Struct(self, QUEUE_MANAGER, pqm);
38
+ pqm-&gt;already_connected = 0;
39
+
40
+ Queue_manager_mq_load(pqm); /* Load MQ Library */
41
+
42
+ name = rb_iv_get(self,&quot;@name&quot;);
43
+ name = StringValue(name);
44
+
45
+ if(pqm-&gt;trace_level)
46
+ printf(&quot;WMQ::QueueManager#connect() Connect to Queue Manager:%s\n&quot;, RSTRING(name)-&gt;ptr);
47
+
48
+ if (pqm-&gt;hcon) /* Disconnect from qmgr if already connected, ignore errors */
49
+ {
50
+ if(pqm-&gt;trace_level)
51
+ printf(&quot;WMQ::QueueManager#connect() Already connected to Queue Manager:%s, Disconnecting first!\n&quot;, RSTRING(name)-&gt;ptr);
52
+
53
+ pqm-&gt;MQDISC(&amp;pqm-&gt;hcon, &amp;pqm-&gt;comp_code, &amp;pqm-&gt;reason_code);
54
+ }
55
+
56
+ pqm-&gt;MQCONNX(
57
+ RSTRING(name)-&gt;ptr, /* queue manager */
58
+ &amp;pqm-&gt;connect_options, /* Connection Options */
59
+ &amp;pqm-&gt;hcon, /* connection handle */
60
+ &amp;pqm-&gt;comp_code, /* completion code */
61
+ &amp;pqm-&gt;reason_code); /* connect reason code */
62
+
63
+ if(pqm-&gt;trace_level)
64
+ printf(&quot;WMQ::QueueManager#connect() MQCONNX completed with reason:%s, Handle:%d\n&quot;,
65
+ wmq_reason(pqm-&gt;reason_code),
66
+ pqm-&gt;hcon);
67
+
68
+ if (pqm-&gt;comp_code == MQCC_FAILED)
69
+ {
70
+ pqm-&gt;hcon = 0;
71
+
72
+ if (pqm-&gt;exception_on_error)
73
+ {
74
+ rb_raise(wmq_exception,
75
+ &quot;WMQ::QueueManager#connect(). Error connecting to Queue Manager:%s, reason:%s&quot;,
76
+ RSTRING(name)-&gt;ptr,
77
+ wmq_reason(pqm-&gt;reason_code));
78
+ }
79
+
80
+ return Qfalse;
81
+ }
82
+
83
+ if (pqm-&gt;reason_code == MQRC_ALREADY_CONNECTED)
84
+ {
85
+ if(pqm-&gt;trace_level) printf(&quot;WMQ::QueueManager#connect() Already connected\n&quot;);
86
+ pqm-&gt;already_connected = 1;
87
+ }
88
+
89
+ return Qtrue;
90
+ }</pre>
91
+ </body>
92
+ </html>