Cisco Cisco Prime Collaboration Assurance 11.5 User Guide
© 2012-2014 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public.
Page 77 of 2
<cmn:returnDataCriteria>
<cmn:returnDataType>ALL</cmn:returnDataType>
</cmn:returnDataCriteria>
<cmn:associatedObjectSelectionCriteria/>
</filter>
When I send a get request or a getOrderSummary request, or any request that returns data back in a
notification that is contained in a cupmApiList, how do I extract the individual objects from the list?
There are several ways to do this in Axis2-supported Java. See the following Java code snippets for
examples.
// get the arrayOfObject object out of the list
org.ossj.xml.common.v1_3.ArrayOfObject arrayOfObject =
cupmApiList.getDataObject();
cupmApiList.getDataObject();
// process each object in the list int sizeArray =
arrayOfObject.sizeOfItemArray();
arrayOfObject.sizeOfItemArray();
for ( int ix = 0 ; ix < sizeArray ; ix++ ) { XmlObject xmlObject =
arrayOfObject.getItemArray(ix); processObject(xmlObject); }
void processObject(XmlObject xmlObject) {
// Ror each object in the list, the class, a typed object, and/or the
// node name can be used to determine and cast the object on the list.
// Some objects can be done multiple ways, others, sent back as
// documents, must use the typed object OMElement element = new
StAXOMBuilder(xmlObject.newXMLStreamReader()).getDocumentElement();
XmlOptions options = new XmlOptions();
options.setLoadReplaceDocumentElement(element.getQName());
typedXmlObject = XmlObject.Factory.parse(xmlObject.newInputStream(), options);
String nodeNameKey = getTypeFromListItem(xmlObject);
// nonimpl way to identify node Class xmlClass = xmlObject.getClass();
if (
xmlClass.equals(com.cisco.cucms.cupm.nbi.v1.impl.CupmApiResultValueImpl.class) )
{
xmlClass.equals(com.cisco.cucms.cupm.nbi.v1.impl.CupmApiResultValueImpl.class) )
{
// if list contains a apiResult, you may use the result in its value state,
// or you can create a document class and work with the result for more
functionality
functionality
CupmApiResultValue cupmApiResult = (CupmApiResultValue)
xmlObject; CupmApiResultDocument cupmApiResultDocument =
CupmApiResultDocument.Factory.newInstance();
cupmApiResultDocument.setCupmApiResult(cupmApiResult); } else if (
xmlClass.equals(com.cisco.cucms.cupm.nbi.v1.impl.DeviceValueImpl.class) ) {
// if list contains a device, you may use the device in its value state,
// or you can create a document class and work with the device for more
functionality
functionality