Java HashTable in NetRexx ....

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Java HashTable in NetRexx ....

maillists (@MQSystems)

Hi I am struggling to translate a working java sample to NetRexx (it’s the actually the MQIVP.java from IBM MQ)

 

Following pieces from the java code I have trouble of getting into NetRexx properly *blush*

 

  private Hashtable<String, Object> properties = null;

.

.

.

 properties = new Hashtable<String, Object>();

.

  properties.put("hostname", hostname);

  properties.put("port", new Integer(Integer.parseInt(port)));          ß--- this one I can’t get into ‘NetRexx’

  properties.put("channel", channel);

  properties.put(MQConstants.USER_ID_PROPERTY, user);

  Properties.put(MQConstants.USE_MQCSP_AUTHENTICATION_PROPERTY, true);  ß--- not sure if this works nicely with ‘true’ in NetRexx

  properties.put(MQConstants.PASSWORD_PROPERTY, password);

 

The Hastable is compromised of String for labels and Objects for data, in the trace I can see the hostname, channel and userid properly

But the port should be some form of Integer as in the trace some form of conversion from getIntegerProperty from the Hashtable is done, which does not work from my NetRexx code as i probably missed something…

 

Is there an general way to translate working java code to NetRexx? Somethings I just don’t get in java where as in NetRexx I am fine… with this different types of Objects and Integers in a Hashtable I get *confused*

 

Michael Dag

 

 

(this is from the working trace, which never happens in my NetRexx trace …)

[05/05/20 16:59:38.550.0B]  00000001     static  c.ibm.mq.MQEnvironment                                                 ----+--  {  getIntegerProperty(String,Hashtable) [port] [{CCSID=819, hostname=qmcloud-ad5d.qm.eu-de.mq.appdomain.cloud, password=XXXXXXXXXXXX, port=31464, channel=CLOUD.ADMIN.SVRCONN, APPNAME=MQIVP (Java), Use MQCSP authentication=true, userID=michael}]

[05/05/20 16:59:38.550.0C]  00000001     static  c.ibm.mq.MQEnvironment                                                 ----+---  {  getObjectProperty(String,Hashtable) [port] [{CCSID=819, hostname=qmcloud-ad5d.qm.eu-de.mq.appdomain.cloud, password=XXXXXXXXXXXX, port=31464, channel=CLOUD.ADMIN.SVRCONN, APPNAME=MQIVP (Java), Use MQCSP authentication=true, userID=michael}]

[05/05/20 16:59:38.550.0D]  00000001     static  c.ibm.mq.MQEnvironment                                                 ----+---  }  getObjectProperty(String,Hashtable) returns [31464(0x7ae8)] Integer

[05/05/20 16:59:38.550.0E]  00000001     static  c.ibm.mq.MQEnvironment                                                 ----+--  }  getIntegerProperty(String,Hashtable)<exitIndex 1> returns [31464(0x7ae8)] Integer

[05/05/20 16:59:38.550.0F]  00000001  @612679d6  c.ibm.mq.MQClientManagedConnectionFactoryJ11                           ----+--  d  setPortNumber(int) setter [31464(0x7ae8)]


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Java HashTable in NetRexx ....

rvjansen
Hi Michael,

please try this:

Properties = Hashtable()
port=42; hostname='Ford'
properties.put("hostname", hostname)
properties.put("port", Integer(Integer.parseInt(port)))


René.

On 6 May 2020, at 18:57, maillists (@MQSystems) <[hidden email]> wrote:

Hi I am struggling to translate a working java sample to NetRexx (it’s the actually the MQIVP.java from IBM MQ)
 
Following pieces from the java code I have trouble of getting into NetRexx properly *blush*
 
  private Hashtable<String, Object> properties = null; 
.
.
.
 properties = new Hashtable<String, Object>();
.
  properties.put("hostname", hostname);
  properties.put("port", new Integer(Integer.parseInt(port)));          ß--- this one I can’t get into ‘NetRexx’ 
  properties.put("channel", channel);
  properties.put(MQConstants.USER_ID_PROPERTY, user);
  Properties.put(MQConstants.USE_MQCSP_AUTHENTICATION_PROPERTY, true);  ß--- not sure if this works nicely with ‘true’ in NetRexx
  properties.put(MQConstants.PASSWORD_PROPERTY, password); 
 
The Hastable is compromised of String for labels and Objects for data, in the trace I can see the hostname, channel and userid properly
But the port should be some form of Integer as in the trace some form of conversion from getIntegerProperty from the Hashtable is done, which does not work from my NetRexx code as i probably missed something…
 
Is there an general way to translate working java code to NetRexx? Somethings I just don’t get in java where as in NetRexx I am fine… with this different types of Objects and Integers in a Hashtable I get *confused*
 
Michael Dag
 
 
(this is from the working trace, which never happens in my NetRexx trace …) 
[05/05/20 16:59:38.550.0B]  00000001     static  c.ibm.mq.MQEnvironment                                                 ----+--  {  getIntegerProperty(String,Hashtable) [port] [{CCSID=819, hostname=qmcloud-ad5d.qm.eu-de.mq.appdomain.cloud, password=XXXXXXXXXXXX, port=31464, channel=CLOUD.ADMIN.SVRCONN, APPNAME=MQIVP (Java), Use MQCSP authentication=true, userID=michael}]
[05/05/20 16:59:38.550.0C]  00000001     static  c.ibm.mq.MQEnvironment                                                 ----+---  {  getObjectProperty(String,Hashtable) [port] [{CCSID=819, hostname=qmcloud-ad5d.qm.eu-de.mq.appdomain.cloud, password=XXXXXXXXXXXX, port=31464, channel=CLOUD.ADMIN.SVRCONN, APPNAME=MQIVP (Java), Use MQCSP authentication=true, userID=michael}]
[05/05/20 16:59:38.550.0D]  00000001     static  c.ibm.mq.MQEnvironment                                                 ----+---  }  getObjectProperty(String,Hashtable) returns [31464(0x7ae8)] Integer
[05/05/20 16:59:38.550.0E]  00000001     static  c.ibm.mq.MQEnvironment                                                 ----+--  }  getIntegerProperty(String,Hashtable)<exitIndex 1> returns [31464(0x7ae8)] Integer
[05/05/20 16:59:38.550.0F]  00000001  @612679d6  c.ibm.mq.MQClientManagedConnectionFactoryJ11                           ----+--  d  setPortNumber(int) setter [31464(0x7ae8)]
_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Java HashTable in NetRexx ....

rvjansen


Is there a general way to translate working java code to NetRexx? 

In the tools directory (if you don’t build from source, see https://sourceforge.net/p/netrexx/code/ci/master/tree/tools/java2nrx/ ) the java2nrx tool is to be found, maybe try that and see if that helps to translate faster.

best regards,

René. 

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Java HashTable in NetRexx ....

Marc Remes-2
unfortunately java2nrx does not translate Java generics..

On 5/7/20 10:02 AM, René Jansen wrote:

>
>>>
>>> Is there a general way to translate working java code to NetRexx? 
>
> In the tools directory (if you don’t build from source,
> see https://sourceforge.net/p/netrexx/code/ci/master/tree/tools/java2nrx/
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_netrexx_code_ci_master_tree_tools_java2nrx_&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=_6rXNpPJ1fYV-3bV1za02NiR4PUelvicfHXwtnTXpXE&m=xcqVoXYTjTH5MyNrFjWROEvO8fKCDa1J-pn-NxKHUxk&s=bl-Ykp_fRMM-R4eeaQVanwqyDw0iYWz1Uqid8zInwRg&e=> )
> the java2nrx tool is to be found, maybe try that and see if that helps to translate faster.
>
> best regards,
>
> René. 
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>
--

Marc


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/


signature.asc (501 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Java HashTable in NetRexx ....

maillists (@MQSystems)
Indeed... tried MQIVP.java but no go, didn't even get through nrc MQIVP.nrx

-----Original Message-----
From: [hidden email] <[hidden email]> On Behalf Of Marc Remes
Sent: donderdag 7 mei 2020 17:36
To: IBM Netrexx <[hidden email]>
Subject: Re: [Ibm-netrexx] Java HashTable in NetRexx ....

unfortunately java2nrx does not translate Java generics..

On 5/7/20 10:02 AM, René Jansen wrote:

>
>>>
>>> Is there a general way to translate working java code to NetRexx?
>
> In the tools directory (if you don’t build from source, see
> https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_netrexx_code_ci_master_tree_tools_java2nrx_&d=DwIFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=_6rXNpPJ1fYV-3bV1za02NiR4PUelvicfHXwtnTXpXE&m=PWD0m_4_cXrORsN3AS3qmIB9joeL_CeAGDLxv1e6vO0&s=KHMumJAwyZKOsT-z-fKEUpJH1NnkAYxaskBXHhsXhwQ&e= 
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_
> p_netrexx_code_ci_master_tree_tools_java2nrx_&d=DwMFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=_6rXNpPJ1fYV-3bV1za02NiR4PUelvicfHXwtnTXpXE&m=xcqVoXYTjTH5MyNrFjWROEvO8fKCDa1J-pn-NxKHUxk&s=bl-Ykp_fRMM-R4eeaQVanwqyDw0iYWz1Uqid8zInwRg&e=> ) the java2nrx tool is to be found, maybe try that and see if that helps to translate faster.
>
> best regards,
>
> René.
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : https://urldefense.proofpoint.com/v2/url?u=http-3A__ibm-2Dnetrexx.215625.n3.nabble.com_&d=DwIFaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=_6rXNpPJ1fYV-3bV1za02NiR4PUelvicfHXwtnTXpXE&m=PWD0m_4_cXrORsN3AS3qmIB9joeL_CeAGDLxv1e6vO0&s=UKLtRZuDzFmlLwGibrbMwbnqGKhzl82cS7T3a5zndEk&e= 
>
--

Marc


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/


MQIVP.java (12K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Java HashTable in NetRexx ....

Jason Martin
Probably pretty close. Fix HashTable line.

Could clean more but I do not even know what MQ is.


On 2020-05-07 12:06, maillists (@MQSystems) wrote:
> Indeed... tried MQIVP.java but no go, didn't even get through nrc MQIVP.nrx

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/


MQIVP.nrx (16K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Java HashTable in NetRexx ....

Jason Martin
In reply to this post by maillists (@MQSystems)
Hashtable /* FIX THIS LINE *****************FIX THIS LINE***********/ null

Probably should be

properties = Hashtable null

but change the variable name (Using Keywords Makes My Eyes Hurt)

Xroperties = Hashtable null

MQIVP.nrx:77: Xroperties = Hashtable()
MQIVP.nrx:133: Xroperties.put("hostname", hostname)
MQIVP.nrx:137: Xroperties.put("port", Integer(Integer.parseInt(port)))
MQIVP.nrx:140: Xroperties.put("port", Integer(-1))
MQIVP.nrx:144: Xroperties.put("channel", channel)
MQIVP.nrx:150: Xroperties.put(MQConstants.USER_ID_PROPERTY, user)
MQIVP.nrx:151:
Xroperties.put(MQConstants.USE_MQCSP_AUTHENTICATION_PROPERTY, 1)
MQIVP.nrx:153: Xroperties.put(MQConstants.PASSWORD_PROPERTY, password)
MQIVP.nrx:162: Xroperties.put("CCSID", Integer(iCCSID))
MQIVP.nrx:165: Xroperties.put(MQConstants.APPNAME_PROPERTY, "MQIVP (Java)")
MQIVP.nrx:176: queueManager = MQQueueManager(queueMgr, Xroperties)

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: Java HashTable in NetRexx ....

maillists (@MQSystems)
This put me on a good track to get MQIVP.nrx working... Then had to
translate to my own NetRexx program and then it failed again...

After long search I found the

Following variables in the Hashtable need to be String explictly in NetRexx
rather then Rexx type.

connHost         = String
connChannel   = String null
connUserid      = String null
connPassword = String null

the connPort could be Rexx '-1' and Integer.parseInt() could be left out
too, Integer(connPort) was enough to make it work.

Thanks for the help!!!

Michael


-----Original Message-----
From: [hidden email]
<[hidden email]> On Behalf Of Jason Martin
Sent: donderdag 7 mei 2020 19:29
To: IBM Netrexx <[hidden email]>
Subject: Re: [Ibm-netrexx] Java HashTable in NetRexx ....

Hashtable /* FIX THIS LINE *****************FIX THIS LINE***********/ null

Probably should be

properties = Hashtable null

but change the variable name (Using Keywords Makes My Eyes Hurt)

Xroperties = Hashtable null

MQIVP.nrx:77: Xroperties = Hashtable()
MQIVP.nrx:133: Xroperties.put("hostname", hostname)
MQIVP.nrx:137: Xroperties.put("port", Integer(Integer.parseInt(port)))
MQIVP.nrx:140: Xroperties.put("port", Integer(-1))
MQIVP.nrx:144: Xroperties.put("channel", channel)
MQIVP.nrx:150: Xroperties.put(MQConstants.USER_ID_PROPERTY, user)
MQIVP.nrx:151:
Xroperties.put(MQConstants.USE_MQCSP_AUTHENTICATION_PROPERTY, 1)
MQIVP.nrx:153: Xroperties.put(MQConstants.PASSWORD_PROPERTY, password)
MQIVP.nrx:162: Xroperties.put("CCSID", Integer(iCCSID))
MQIVP.nrx:165: Xroperties.put(MQConstants.APPNAME_PROPERTY, "MQIVP (Java)")
MQIVP.nrx:176: queueManager = MQQueueManager(queueMgr, Xroperties)

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : https://urldefense.proofpoint.com/v2/url?u=http-3A__ibm-2Dnetrexx.215625.n3.nabble.com_&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=_6rXNpPJ1fYV-3bV1za02NiR4PUelvicfHXwtnTXpXE&m=2oeLezqkqikt84kXc73qpKYBEkdeF4FcBqgPwBwohCI&s=mSlJCwWG4yCdZifw5hZGj7_K588T9gxI6-GL4BdWgw4&e= 

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/