private AdhocQueryResponse addHomeCommunityId(AdhocQueryResponse rsp) { String home = XdsDevice.getXCARespondingGW().getHomeCommunityID(); IdentifiableType obj; if (rsp.getRegistryObjectList() != null) { List<JAXBElement<? extends IdentifiableType>> objList = rsp.getRegistryObjectList().getIdentifiable(); for (int i = 0, len = objList.size() ; i < len ; i++ ) { obj = objList.get(i).getValue(); if (obj.getHome() == null && ((obj instanceof ExtrinsicObjectType) || (obj instanceof RegistryPackageType) || obj instanceof ObjectRefType)) { obj.setHome(home); } } } if (rsp.getRegistryErrorList() != null) { for ( RegistryError err : rsp.getRegistryErrorList().getRegistryError()) { if (err.getLocation() == null) err.setLocation(home); } } return rsp; }
private RetrieveDocumentSetResponseType addHomeCommunityID(RetrieveDocumentSetResponseType rsp) { String home = XdsDevice.getXCARespondingGW().getHomeCommunityID(); if (rsp.getDocumentResponse() != null) { for (DocumentResponse docRsp : rsp.getDocumentResponse()) { if (docRsp.getHomeCommunityId() == null) docRsp.setHomeCommunityId(home); } } RegistryResponseType regRsp = rsp.getRegistryResponse(); if (regRsp != null && regRsp.getRegistryErrorList() != null) { for ( RegistryError err : regRsp.getRegistryErrorList().getRegistryError()) { if (err.getLocation() == null) err.setLocation(home); } } return rsp; }