Author |
Message
|
akil |
Posted: Sat Apr 09, 2016 10:51 pm Post subject: IIB9: CMP API getDeploymentDescriptor |
|
|
 Partisan
Joined: 27 May 2014 Posts: 338 Location: Mumbai
|
Apparently, the BAR file created by the toolkit by default, places the deployment-descriptor (broker.xml), in a sub-folder of the application that is contained in it, rather than at the top level. This is confirmed by mqsireadbar as well.
mqsireadbar -b App.bar -- returns nothing
mqsireadbar -b App.bar -r ---> returns the deployment descriptor
The CMP API however, does not seem to have any -r equivalent; The documentation states that to obtain the deployment descriptor one needs to query the BarFile object.
https://www.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.cmp.doc/index.html?lang=en
However, this returns a null - this is consistent with the mqsireadbar (without -r),
What's the equivalent of mqsireadbar -r in the CMP ? _________________ Regards |
|
Back to top |
|
 |
stoney |
Posted: Sun Apr 10, 2016 10:23 am Post subject: |
|
|
Centurion
Joined: 03 Apr 2013 Posts: 140
|
The BarFile object for the top level App.bar is not the one you want.
You need to get the BarFile object for App.appzip instead.
That BarFile object will have the deployment descriptor that you are after.
Here's some code that will do the trick:
Code: |
BarFile barFile = BarFile.loadBarFile("App.bar");
BarEntry appBarEntry = barFile.getBarEntryByName("App.appzip");
BarFile appBarFile = BarFile.loadBarFile(appBarEntry.getBytes(), appBarEntry.getFullName());
DeploymentDescriptor desc = appBarFile.getDeploymentDescriptor();
Enumeration<String> props = desc.getPropertyIdentifiers();
while (props.hasMoreElements()) {
String prop = props.nextElement();
System.out.println("Found property: " + prop);
}
|
All mqsireadbar -r does is iterate over the BarEntry objects in the top level BarFile using getBarEntryNames() & getBarEntryByName().
If it finds an application or library, then it loads it into a new BarFile object as above. |
|
Back to top |
|
 |
akil |
Posted: Sun Apr 10, 2016 11:59 am Post subject: |
|
|
 Partisan
Joined: 27 May 2014 Posts: 338 Location: Mumbai
|
Thank you!. Thank you! Thank you!.
How do you know this ? Is it mentioned anywhere in any documentation? Thank you !. _________________ Regards |
|
Back to top |
|
 |
stoney |
Posted: Sun Apr 10, 2016 11:21 pm Post subject: |
|
|
Centurion
Joined: 03 Apr 2013 Posts: 140
|
I have access to the source code, so that helps
I can't see that process mentioned in the Javadoc for the Integration API anywhere - I'll look at getting it updated. |
|
Back to top |
|
 |
akil |
Posted: Mon Apr 11, 2016 7:24 am Post subject: |
|
|
 Partisan
Joined: 27 May 2014 Posts: 338 Location: Mumbai
|
Oh alright . I didn't know you were from labs. Thank you once again _________________ Regards |
|
Back to top |
|
 |
akil |
Posted: Sun May 08, 2016 8:53 am Post subject: |
|
|
 Partisan
Joined: 27 May 2014 Posts: 338 Location: Mumbai
|
I was attempting to use this technique to call setOverride on the deploymentDescriptor.
As per the document i've to call save to make the changes persistent.
Calling save on the top-level barFile has no effect.
Calling save on the bar created from the byte[] throws an exception when save is called ( seems that it expects it to be a file).
Any suggestions on what to do? _________________ Regards |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon May 09, 2016 2:28 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
akil wrote: |
I was attempting to use this technique to call setOverride on the deploymentDescriptor.
As per the document i've to call save to make the changes persistent.
Calling save on the top-level barFile has no effect.
Calling save on the bar created from the byte[] throws an exception when save is called ( seems that it expects it to be a file).
Any suggestions on what to do? |
Saving in this case is often streaming from the source bar file to a destination bar file...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|