public void toPersistenceIdentifiable(IdentifiableType roType, Identifiable ro) { String id = roType.getId(); ro.setId(id.startsWith("urn:") ? id : "urn:uuid:"+UUID.randomUUID().toString()); uuidMapping.put(id, ro); ro.setHome(roType.getHome()); copySlots(roType.getSlot(), ro); }
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; }