@SuppressWarnings("static-access") private void buildInterfaceList() { interfaceList = new ArrayList<ExtendedInterface>(); ExtendedCapability extendedCapabilityTemp = capabilityList.get(capabilityIndex); Capability capabilityTemp = extendedCapabilityTemp.getCapability(); /* */ Interface[] interfaceArray = capabilityTemp.getInterfaceArray(); Interface interfaceTemp = null; for (int m = 0; m < interfaceArray.length; m++) { interfaceTemp = interfaceArray[m]; String interfaceTypeComplete = interfaceTemp .selectAttribute("http://www.w3.org/2001/XMLSchema-instance", "type") .getDomNode() .getNodeValue(); int index = interfaceTypeComplete.indexOf(':') + 1; String resourceType = interfaceTypeComplete.substring(index); interfaceList.add(new ExtendedInterface(m, interfaceTemp, resourceType)); System.out.println(interfaceTemp.type); } }
private String[] buildCapabilityList(Resource resourceValue) { Resource tempResource = resourceValue; // First for Tap and second for Tap-XSAMs String[] accessURLs = new String[] {null, null}; XmlObject tempObject = tempResource.copy(); XmlObject xmlObjectCapabilityChild[] = tempObject.selectChildren(new QName("", "capability")); Capability capabilityTemp = null; for (int j = 0; j < xmlObjectCapabilityChild.length; j++) { try { capabilityTemp = Capability.Factory.parse(xmlObjectCapabilityChild[j].xmlText()); if (capabilityTemp.getStandardID() != null) { if (capabilityTemp.getStandardID().toUpperCase().contains("ivo://vamdc/std/TAP-XSAMS")) { accessURLs[1] = buildInterfaceList(capabilityTemp); } if (capabilityTemp.getStandardID().toUpperCase().contains("TAP")) { if (capabilityTemp.getStandardID().toUpperCase().contains("TAP-XSAMS")) { accessURLs[1] = buildInterfaceList(capabilityTemp); } else { accessURLs[0] = buildInterfaceList(capabilityTemp); } } } } catch (XmlException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return accessURLs; }
private String buildInterfaceList(Capability capabilityValue) { Capability capabilityTemp = capabilityValue; Interface[] interfaceArray = capabilityTemp.getInterfaceArray(); // System.out.println("Interface List for capability: " + interfaceArray.length); String interfaceAccessURL = interfaceArray[0].getAccessURLArray(0).getStringValue(); /* Interface interfaceTemp = null; for (int m = 0; m < interfaceArray.length; m++) { interfaceTemp = interfaceArray[m]; // This assumes URL will include TAP .... key word which may not be the case ...! if(interfaceTemp.getAccessURLArray(0).getStringValue().toUpperCase() .contains("TAP")){ return interfaceTemp.getAccessURLArray(0).getStringValue(); } } */ return interfaceAccessURL; }