X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=champ-service%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fchamp%2Fservice%2FChampUUIDService.java;fp=champ-service%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fchamp%2Fservice%2FChampUUIDService.java;h=259a4bffee730fffc76311da99ab2e4d2b310213;hb=56253dc9561d5b24919bf59f83ccc55934d8ad50;hp=00016101b41e39ae097d44f56e05fa028e7730b2;hpb=73fc9e36510c27899e60a707e8fcadb8a759f0d1;p=aai%2Fchamp.git diff --git a/champ-service/src/main/java/org/onap/champ/service/ChampUUIDService.java b/champ-service/src/main/java/org/onap/champ/service/ChampUUIDService.java index 0001610..259a4bf 100644 --- a/champ-service/src/main/java/org/onap/champ/service/ChampUUIDService.java +++ b/champ-service/src/main/java/org/onap/champ/service/ChampUUIDService.java @@ -27,7 +27,11 @@ import org.onap.aai.champcore.exceptions.ChampUnmarshallingException; import org.onap.aai.champcore.model.ChampElement; import org.onap.aai.champcore.model.ChampObject; import org.onap.aai.champcore.model.ChampRelationship; +import org.onap.aai.cl.api.Logger; +import org.onap.aai.cl.eelf.LoggerFactory; +import org.onap.champ.ChampRESTAPI; import org.onap.champ.exception.ChampServiceException; +import org.onap.champ.service.logging.ChampMsgs; import org.onap.champ.util.ChampProperties; import org.onap.champ.util.ChampServiceConstants; @@ -41,7 +45,7 @@ import java.util.stream.Stream; public class ChampUUIDService { private ChampGraph graphImpl; private static final String KEY_NAME = ChampProperties.get(ChampServiceConstants.CHAMP_KEY_NAME); - + private Logger logger = LoggerFactory.getInstance().getLogger(ChampUUIDService.class); public ChampUUIDService(ChampGraph graphImpl) { this.graphImpl = graphImpl; @@ -117,18 +121,20 @@ public class ChampUUIDService { throws ChampUnmarshallingException, ChampTransactionException, ChampServiceException { Optional response = Optional.empty(); - Stream s; Map filter = new HashMap<>(); filter.put(KEY_NAME, uuid); s = graphImpl.queryRelationships(filter, Optional.ofNullable(transaction)); + Object[] objs = s.toArray(); if (objs.length == 0) { return response; } + response = graphImpl.retrieveRelationship(((ChampRelationship) objs[0]).getKey().get(), Optional.ofNullable(transaction)); + return response; }