rubywmq 0.3.0-i386-mswin32-mq5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +13 -0
- data/README +73 -0
- data/doc/classes/WMQ/Message.html +376 -0
- data/doc/classes/WMQ/Message.src/M000001.html +77 -0
- data/doc/classes/WMQ/Message.src/M000002.html +27 -0
- data/doc/classes/WMQ/Queue.html +1459 -0
- data/doc/classes/WMQ/Queue.src/M000003.html +205 -0
- data/doc/classes/WMQ/Queue.src/M000004.html +107 -0
- data/doc/classes/WMQ/Queue.src/M000005.html +198 -0
- data/doc/classes/WMQ/Queue.src/M000006.html +66 -0
- data/doc/classes/WMQ/Queue.src/M000007.html +203 -0
- data/doc/classes/WMQ/Queue.src/M000008.html +265 -0
- data/doc/classes/WMQ/Queue.src/M000009.html +120 -0
- data/doc/classes/WMQ/Queue.src/M000010.html +28 -0
- data/doc/classes/WMQ/Queue.src/M000011.html +30 -0
- data/doc/classes/WMQ/Queue.src/M000012.html +31 -0
- data/doc/classes/WMQ/Queue.src/M000013.html +31 -0
- data/doc/classes/WMQ/Queue.src/M000014.html +31 -0
- data/doc/classes/WMQ/QueueManager.html +1529 -0
- data/doc/classes/WMQ/QueueManager.src/M000015.html +182 -0
- data/doc/classes/WMQ/QueueManager.src/M000016.html +194 -0
- data/doc/classes/WMQ/QueueManager.src/M000017.html +92 -0
- data/doc/classes/WMQ/QueueManager.src/M000018.html +70 -0
- data/doc/classes/WMQ/QueueManager.src/M000019.html +49 -0
- data/doc/classes/WMQ/QueueManager.src/M000020.html +49 -0
- data/doc/classes/WMQ/QueueManager.src/M000021.html +63 -0
- data/doc/classes/WMQ/QueueManager.src/M000022.html +61 -0
- data/doc/classes/WMQ/QueueManager.src/M000023.html +65 -0
- data/doc/classes/WMQ/QueueManager.src/M000024.html +232 -0
- data/doc/classes/WMQ/QueueManager.src/M000025.html +30 -0
- data/doc/classes/WMQ/QueueManager.src/M000026.html +31 -0
- data/doc/classes/WMQ/QueueManager.src/M000027.html +31 -0
- data/doc/classes/WMQ/QueueManager.src/M000028.html +38 -0
- data/doc/classes/WMQ/QueueManager.src/M000029.html +33 -0
- data/doc/classes/WMQ/QueueManager.src/M000030.html +21 -0
- data/doc/classes/WMQ/QueueManager.src/M000031.html +284 -0
- data/doc/classes/WMQ/QueueManager.src/M000032.html +24 -0
- data/doc/classes/WMQ/QueueManager.src/M000033.html +18 -0
- data/doc/classes/WMQ/QueueManager.src/M000034.html +46 -0
- data/doc/classes/WMQ/QueueManager.src/M000035.html +27 -0
- data/doc/classes/WMQ/WMQException.html +111 -0
- data/doc/classes/WMQ.html +6300 -0
- data/doc/created.rid +1 -0
- data/doc/files/ext/lib/wmq_const_admin_rb.html +128 -0
- data/doc/files/ext/lib/wmq_const_rb.html +128 -0
- data/doc/files/ext/lib/wmq_temp_rb.html +122 -0
- data/doc/files/ext/wmq_c.html +101 -0
- data/doc/files/ext/wmq_message_c.html +101 -0
- data/doc/files/ext/wmq_queue_c.html +101 -0
- data/doc/files/ext/wmq_queue_manager_c.html +101 -0
- data/doc/fr_class_index.html +31 -0
- data/doc/fr_file_index.html +33 -0
- data/doc/fr_method_index.html +61 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/examples/each_a.rb +31 -0
- data/examples/each_b.rb +40 -0
- data/examples/each_header.rb +37 -0
- data/examples/files_to_q.cfg +24 -0
- data/examples/files_to_q.rb +46 -0
- data/examples/get_a.rb +34 -0
- data/examples/get_client.rb +50 -0
- data/examples/put1_a.rb +24 -0
- data/examples/put1_b.rb +32 -0
- data/examples/put1_c.rb +31 -0
- data/examples/put_a.rb +34 -0
- data/examples/put_b.rb +42 -0
- data/examples/put_dlh.rb +40 -0
- data/examples/put_dynamic_q.rb +37 -0
- data/examples/put_rfh.rb +66 -0
- data/examples/put_rfh2_a.rb +42 -0
- data/examples/put_rfh2_b.rb +42 -0
- data/examples/put_xmit_q.rb +32 -0
- data/examples/q_to_files.cfg +17 -0
- data/examples/q_to_files.rb +47 -0
- data/examples/request.rb +59 -0
- data/examples/server.rb +96 -0
- data/lib/wmq/wmq.so +0 -0
- data/lib/wmq/wmq_const.rb +697 -0
- data/lib/wmq/wmq_const_admin.rb +273 -0
- data/lib/wmq/wmq_temp.rb +197 -0
- data/lib/wmq.rb +25 -0
- data/tests/test.rb +299 -0
- 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 => 'queue_manager name',
|
24
|
+
* :exception_on_error => true, # n/a
|
25
|
+
* :connect_options => WMQ::MQCNO_FASTBATH_BINDING # MQCNO.Options
|
26
|
+
*
|
27
|
+
* :trace_level => 0, # n/a
|
28
|
+
*
|
29
|
+
* # Common client connection parameters
|
30
|
+
* :channel_name => 'svrconn channel name', # MQCD.ChannelName
|
31
|
+
* :connection_name => 'localhost(1414)', # MQCD.ConnectionName
|
32
|
+
* :transport_type => WMQ::MQXPT_TCP, # MQCD.TransportType
|
33
|
+
*
|
34
|
+
* # Advanced client connections parameters
|
35
|
+
* :max_msg_length => 65535, # MQCD.MaxMsgLength
|
36
|
+
* :security_exit => 'Name of security exit', # MQCD.SecurityExit
|
37
|
+
* :send_exit => 'Name of send exit', # MQCD.SendExit
|
38
|
+
* :receive_exit => 'Name of receive exit', # MQCD.ReceiveExit
|
39
|
+
* :security_user_data => 'Security exit User data', # MQCD.SecurityUserData
|
40
|
+
* :send_user_data => 'Send exit user data', # MQCD.SendUserData
|
41
|
+
* :receive_user_data => 'Receive exit user data', # MQCD.ReceiveUserData
|
42
|
+
* :heartbeat_interval => 1, # MQCD.HeartbeatInterval
|
43
|
+
* :remote_security_id => 'Remote Security id', # MQCD.RemoteSecurityId
|
44
|
+
* :ssl_cipher_spec => 'SSL Cipher Spec', # MQCD.SSLCipherSpec
|
45
|
+
* :keep_alive_interval=> -1, # MQCD.KeepAliveInterval
|
46
|
+
* :mode_name => 'LU6.2 Mode Name', # MQCD.ModeName
|
47
|
+
* :tp_name => 'LU6.2 Transaction pgm name', # MQCD.TpName
|
48
|
+
* :user_identifier => 'LU 6.2 Userid', # MQCD.UserIdentifier
|
49
|
+
* :password => 'LU6.2 Password', # MQCD.Password
|
50
|
+
* :long_remote_user_id=> 'Long remote user identifier', # MQCD.LongRemoteUserId (Ptr, Length)
|
51
|
+
* :ssl_peer_name => 'SSL Peer name', # MQCD.SSLPeerName (Ptr, Length)
|
52
|
+
*
|
53
|
+
* # SSL Options
|
54
|
+
* :key_repository => '/var/mqm/qmgrs/.../key', # MQSCO.KeyRepository
|
55
|
+
* :crypto_hardware => 'GSK_ACCELERATOR_NCIPHER_NF_ON', # MQSCO.CryptoHardware
|
56
|
+
* )
|
57
|
+
*
|
58
|
+
* Optional Parameters
|
59
|
+
* * :q_mgr_name => 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 => 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 => 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=>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 => 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 => 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 => String
|
108
|
+
* * Name of SVRCONN channel defined on the QueueManager for Client Connections
|
109
|
+
* * Default Value:
|
110
|
+
* 'SYSTEM.DEF.SVRCONN'
|
111
|
+
*
|
112
|
+
* * :transport_type => 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=>'REID') do |qmgr|
|
135
|
+
* qmgr.put(:q_name=>'TEST.QUEUE', :data => 'Hello World')
|
136
|
+
* end
|
137
|
+
*
|
138
|
+
* Client Connection Example:
|
139
|
+
* require 'wmq/wmq_client'
|
140
|
+
*
|
141
|
+
* WMQ::QueueManager.connect(
|
142
|
+
* :channel_name => 'SYSTEM.DEF.SVRCONN',
|
143
|
+
* :transport_type => WMQ::MQXPT_TCP,
|
144
|
+
* :connection_name => 'localhost(1414)' ) do |qmgr|
|
145
|
+
* qmgr.open_queue(:q_name=>'TEST.QUEUE', :mode=>:input) do |queue|
|
146
|
+
*
|
147
|
+
* message = WMQ::Message.new
|
148
|
+
* if queue.get(:message => message)
|
149
|
+
* puts "Data Received: #{message.data}"
|
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, "1&", &parameters, &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)&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->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, "@name", rb_str_new2(""));
|
52
|
+
if(pqm->trace_level > 1) printf("WMQ::QueueManager#initialize() Queue Manager:[Not specified, use Default QMGR]\n");
|
53
|
+
}
|
54
|
+
else
|
55
|
+
{
|
56
|
+
rb_iv_set(self, "@name", val);
|
57
|
+
if(pqm->trace_level > 1) printf("WMQ::QueueManager#initialize() Queue Manager:%s\n", RSTRING(val)->ptr);
|
58
|
+
}
|
59
|
+
|
60
|
+
WMQ_HASH2BOOL(hash,exception_on_error, pqm->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 = &pqm->client_conn; /* Process MQCD */
|
69
|
+
pqm->is_client_conn = 1; /* Set to Client connection */
|
70
|
+
|
71
|
+
WMQ_HASH2MQCHARS(hash,connection_name, pmqcd->ConnectionName)
|
72
|
+
WMQ_HASH2MQLONG (hash,transport_type, pmqcd->TransportType)
|
73
|
+
WMQ_HASH2MQCHARS(hash,mode_name, pmqcd->ModeName)
|
74
|
+
WMQ_HASH2MQCHARS(hash,tp_name, pmqcd->TpName)
|
75
|
+
WMQ_HASH2MQCHARS(hash,security_exit, pmqcd->SecurityExit)
|
76
|
+
WMQ_HASH2MQCHARS(hash,send_exit, pmqcd->SendExit)
|
77
|
+
WMQ_HASH2MQCHARS(hash,receive_exit, pmqcd->ReceiveExit)
|
78
|
+
WMQ_HASH2MQLONG (hash,max_msg_length, pmqcd->MaxMsgLength)
|
79
|
+
WMQ_HASH2MQCHARS(hash,security_user_data, pmqcd->SecurityUserData)
|
80
|
+
WMQ_HASH2MQCHARS(hash,send_user_data, pmqcd->SendUserData)
|
81
|
+
WMQ_HASH2MQCHARS(hash,receive_user_data, pmqcd->ReceiveUserData)
|
82
|
+
WMQ_HASH2MQCHARS(hash,user_identifier, pmqcd->UserIdentifier)
|
83
|
+
WMQ_HASH2MQCHARS(hash,password, pmqcd->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->ChannelName, "SYSTEM.DEF.SVRCONN", sizeof(pmqcd->ChannelName));
|
90
|
+
}
|
91
|
+
else
|
92
|
+
{
|
93
|
+
WMQ_HASH2MQCHARS(hash,channel_name, pmqcd->ChannelName)
|
94
|
+
}
|
95
|
+
|
96
|
+
#ifdef MQCD_VERSION_4
|
97
|
+
WMQ_HASH2MQLONG(hash,heartbeat_interval, pmqcd->HeartbeatInterval)
|
98
|
+
/* TODO:
|
99
|
+
WMQ_HASH2MQLONG(hash,exit_name_length, pmqcd->ExitNameLength)
|
100
|
+
WMQ_HASH2MQLONG(hash,exit_data_length, pmqcd->ExitDataLength)
|
101
|
+
WMQ_HASH2MQLONG(hash,send_exits_defined, pmqcd->SendExitsDefined)
|
102
|
+
WMQ_HASH2MQLONG(hash,receive_exits_defined, pmqcd->ReceiveExitsDefined)
|
103
|
+
TO_PTR (send_exit_ptr, pmqcd->SendExitPtr)
|
104
|
+
TO_PTR (send_user_data_ptr, pmqcd->SendUserDataPtr)
|
105
|
+
TO_PTR (receive_exit_ptr, pmqcd->ReceiveExitPtr)
|
106
|
+
TO_PTR (receive_user_data_ptr, pmqcd->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)->len;
|
115
|
+
|
116
|
+
if (length > 0)
|
117
|
+
{
|
118
|
+
MQPTR pBuffer;
|
119
|
+
if(pqm->trace_level > 1)
|
120
|
+
printf("WMQ::QueueManager#initialize() Setting long_remote_user_id:%s\n",
|
121
|
+
RSTRING(str)->ptr);
|
122
|
+
|
123
|
+
/* Include null at end of string */
|
124
|
+
pBuffer = ALLOC_N(char, length+1);
|
125
|
+
memcpy(pBuffer, RSTRING(str)->ptr, length+1);
|
126
|
+
|
127
|
+
pmqcd->LongRemoteUserIdLength = length;
|
128
|
+
pmqcd->LongRemoteUserIdPtr = pBuffer;
|
129
|
+
pqm->long_remote_user_id_ptr = pBuffer;
|
130
|
+
}
|
131
|
+
}
|
132
|
+
WMQ_HASH2MQBYTES(hash,remote_security_id, pmqcd->RemoteSecurityId)
|
133
|
+
WMQ_HASH2MQCHARS(hash,ssl_cipher_spec, pmqcd->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)->len;
|
141
|
+
|
142
|
+
if (length > 0)
|
143
|
+
{
|
144
|
+
MQPTR pBuffer;
|
145
|
+
if(pqm->trace_level > 1)
|
146
|
+
printf("WMQ::QueueManager#initialize() Setting ssl_peer_name:%s\n",
|
147
|
+
RSTRING(str)->ptr);
|
148
|
+
|
149
|
+
/* Include null at end of string */
|
150
|
+
pBuffer = ALLOC_N(char, length+1);
|
151
|
+
memcpy(pBuffer, RSTRING(str)->ptr, length+1);
|
152
|
+
|
153
|
+
pmqcd->SSLPeerNameLength = length;
|
154
|
+
pmqcd->SSLPeerNamePtr = pBuffer;
|
155
|
+
pqm->ssl_peer_name_ptr = pBuffer;
|
156
|
+
}
|
157
|
+
}
|
158
|
+
WMQ_HASH2MQLONG(hash,keep_alive_interval, pmqcd->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->ssl_config_opts.KeyRepository)
|
169
|
+
WMQ_HASH2MQCHARS(hash,crypto_hardware, pqm->ssl_config_opts.CryptoHardware)
|
170
|
+
|
171
|
+
pqm->connect_options.SSLConfigPtr = &pqm->ssl_config_opts;
|
172
|
+
}
|
173
|
+
#endif
|
174
|
+
|
175
|
+
}
|
176
|
+
else
|
177
|
+
{
|
178
|
+
pqm->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->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 => 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->already_connected = 0;
|
39
|
+
|
40
|
+
Queue_manager_mq_load(pqm); /* Load MQ Library */
|
41
|
+
|
42
|
+
name = rb_iv_get(self,"@name");
|
43
|
+
name = StringValue(name);
|
44
|
+
|
45
|
+
if(pqm->trace_level)
|
46
|
+
printf("WMQ::QueueManager#connect() Connect to Queue Manager:%s\n", RSTRING(name)->ptr);
|
47
|
+
|
48
|
+
if (pqm->hcon) /* Disconnect from qmgr if already connected, ignore errors */
|
49
|
+
{
|
50
|
+
if(pqm->trace_level)
|
51
|
+
printf("WMQ::QueueManager#connect() Already connected to Queue Manager:%s, Disconnecting first!\n", RSTRING(name)->ptr);
|
52
|
+
|
53
|
+
pqm->MQDISC(&pqm->hcon, &pqm->comp_code, &pqm->reason_code);
|
54
|
+
}
|
55
|
+
|
56
|
+
pqm->MQCONNX(
|
57
|
+
RSTRING(name)->ptr, /* queue manager */
|
58
|
+
&pqm->connect_options, /* Connection Options */
|
59
|
+
&pqm->hcon, /* connection handle */
|
60
|
+
&pqm->comp_code, /* completion code */
|
61
|
+
&pqm->reason_code); /* connect reason code */
|
62
|
+
|
63
|
+
if(pqm->trace_level)
|
64
|
+
printf("WMQ::QueueManager#connect() MQCONNX completed with reason:%s, Handle:%d\n",
|
65
|
+
wmq_reason(pqm->reason_code),
|
66
|
+
pqm->hcon);
|
67
|
+
|
68
|
+
if (pqm->comp_code == MQCC_FAILED)
|
69
|
+
{
|
70
|
+
pqm->hcon = 0;
|
71
|
+
|
72
|
+
if (pqm->exception_on_error)
|
73
|
+
{
|
74
|
+
rb_raise(wmq_exception,
|
75
|
+
"WMQ::QueueManager#connect(). Error connecting to Queue Manager:%s, reason:%s",
|
76
|
+
RSTRING(name)->ptr,
|
77
|
+
wmq_reason(pqm->reason_code));
|
78
|
+
}
|
79
|
+
|
80
|
+
return Qfalse;
|
81
|
+
}
|
82
|
+
|
83
|
+
if (pqm->reason_code == MQRC_ALREADY_CONNECTED)
|
84
|
+
{
|
85
|
+
if(pqm->trace_level) printf("WMQ::QueueManager#connect() Already connected\n");
|
86
|
+
pqm->already_connected = 1;
|
87
|
+
}
|
88
|
+
|
89
|
+
return Qtrue;
|
90
|
+
}</pre>
|
91
|
+
</body>
|
92
|
+
</html>
|
@@ -0,0 +1,70 @@
|
|
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>disconnect (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
|
+
* Disconnect from this QueueManager instance
|
15
|
+
*
|
16
|
+
* Returns:
|
17
|
+
* * true : On Success
|
18
|
+
* * false: On Failure
|
19
|
+
*
|
20
|
+
* comp_code and reason_code are also updated.
|
21
|
+
* reason will return a text description of the reason_code
|
22
|
+
*
|
23
|
+
* Throws:
|
24
|
+
* * WMQ::WMQException if comp_code != MQCC_OK
|
25
|
+
* * Except if :exception_on_error => false was supplied as a parameter
|
26
|
+
* to QueueManager.new
|
27
|
+
*/
|
28
|
+
VALUE QueueManager_disconnect(VALUE self)
|
29
|
+
{
|
30
|
+
PQUEUE_MANAGER pqm;
|
31
|
+
Data_Get_Struct(self, QUEUE_MANAGER, pqm);
|
32
|
+
|
33
|
+
if(pqm->trace_level) printf ("WMQ::QueueManager#disconnect() Queue Manager Handle:%ld\n", pqm->hcon);
|
34
|
+
|
35
|
+
if (!pqm->already_connected)
|
36
|
+
{
|
37
|
+
pqm->MQDISC(&pqm->hcon, &pqm->comp_code, &pqm->reason_code);
|
38
|
+
|
39
|
+
if(pqm->trace_level) printf("WMQ::QueueManager#disconnect() MQDISC completed with reason:%s\n", wmq_reason(pqm->reason_code));
|
40
|
+
|
41
|
+
if (pqm->comp_code != MQCC_OK)
|
42
|
+
{
|
43
|
+
if (pqm->exception_on_error)
|
44
|
+
{
|
45
|
+
VALUE name = rb_iv_get(self,"@name");
|
46
|
+
name = StringValue(name);
|
47
|
+
|
48
|
+
rb_raise(wmq_exception,
|
49
|
+
"WMQ::QueueManager#disconnect(). Error disconnecting from Queue Manager:%s, reason:%s",
|
50
|
+
RSTRING(name)->ptr,
|
51
|
+
wmq_reason(pqm->reason_code));
|
52
|
+
}
|
53
|
+
|
54
|
+
return Qfalse;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
else
|
58
|
+
{
|
59
|
+
pqm->comp_code = 0;
|
60
|
+
pqm->reason_code = 0;
|
61
|
+
|
62
|
+
if(pqm->trace_level) printf ("WMQ::QueueManager#disconnect() Not calling MQDISC, since already connected on connect\n");
|
63
|
+
}
|
64
|
+
|
65
|
+
pqm->hcon = 0;
|
66
|
+
|
67
|
+
return Qtrue;
|
68
|
+
}</pre>
|
69
|
+
</body>
|
70
|
+
</html>
|
@@ -0,0 +1,49 @@
|
|
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>open_queue (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
|
+
* open_queue(...)
|
16
|
+
* access_queue(...)
|
17
|
+
*
|
18
|
+
* Open the specified queue, then close it once the
|
19
|
+
* supplied code block has completed
|
20
|
+
*
|
21
|
+
* Parameters:
|
22
|
+
* * Since the number of parameters can vary dramatically, all parameters are passed by name in a hash
|
23
|
+
* * See Queue.open for the complete list of parameters, except that :queue_manager is *not* required
|
24
|
+
* since it is supplied automatically by this method
|
25
|
+
*
|
26
|
+
* Example:
|
27
|
+
* require 'wmq/wmq_client'
|
28
|
+
*
|
29
|
+
* WMQ::QueueManager.connect(:q_mgr_name=>'REID', :connection_name=>'localhost(1414)') do |qmgr|
|
30
|
+
* qmgr.open_queue(:q_name=>'TEST.QUEUE', :mode=>:output) do |queue|
|
31
|
+
* queue.put(:data => 'Hello World')
|
32
|
+
* end
|
33
|
+
* end
|
34
|
+
*/
|
35
|
+
VALUE QueueManager_open_queue(int argc, VALUE *argv, VALUE self)
|
36
|
+
{
|
37
|
+
VALUE parameters;
|
38
|
+
VALUE proc;
|
39
|
+
|
40
|
+
/* Extract parameters and code block (Proc) */
|
41
|
+
rb_scan_args(argc, argv, "1&", &parameters, &proc);
|
42
|
+
|
43
|
+
Check_Type(parameters, T_HASH);
|
44
|
+
rb_hash_aset(parameters, ID2SYM(ID_queue_manager), self);
|
45
|
+
|
46
|
+
return rb_iterate(QueueManager_open_queue_each, parameters, QueueManager_open_queue_block, proc);
|
47
|
+
}</pre>
|
48
|
+
</body>
|
49
|
+
</html>
|
@@ -0,0 +1,49 @@
|
|
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>access_queue (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
|
+
* open_queue(...)
|
16
|
+
* access_queue(...)
|
17
|
+
*
|
18
|
+
* Open the specified queue, then close it once the
|
19
|
+
* supplied code block has completed
|
20
|
+
*
|
21
|
+
* Parameters:
|
22
|
+
* * Since the number of parameters can vary dramatically, all parameters are passed by name in a hash
|
23
|
+
* * See Queue.open for the complete list of parameters, except that :queue_manager is *not* required
|
24
|
+
* since it is supplied automatically by this method
|
25
|
+
*
|
26
|
+
* Example:
|
27
|
+
* require 'wmq/wmq_client'
|
28
|
+
*
|
29
|
+
* WMQ::QueueManager.connect(:q_mgr_name=>'REID', :connection_name=>'localhost(1414)') do |qmgr|
|
30
|
+
* qmgr.open_queue(:q_name=>'TEST.QUEUE', :mode=>:output) do |queue|
|
31
|
+
* queue.put(:data => 'Hello World')
|
32
|
+
* end
|
33
|
+
* end
|
34
|
+
*/
|
35
|
+
VALUE QueueManager_open_queue(int argc, VALUE *argv, VALUE self)
|
36
|
+
{
|
37
|
+
VALUE parameters;
|
38
|
+
VALUE proc;
|
39
|
+
|
40
|
+
/* Extract parameters and code block (Proc) */
|
41
|
+
rb_scan_args(argc, argv, "1&", &parameters, &proc);
|
42
|
+
|
43
|
+
Check_Type(parameters, T_HASH);
|
44
|
+
rb_hash_aset(parameters, ID2SYM(ID_queue_manager), self);
|
45
|
+
|
46
|
+
return rb_iterate(QueueManager_open_queue_each, parameters, QueueManager_open_queue_block, proc);
|
47
|
+
}</pre>
|
48
|
+
</body>
|
49
|
+
</html>
|