package org.onap.holmes.common.aai;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import lombok.extern.slf4j.Slf4j;
private String getVmResourceLinks(String vserverId, String vserverName) throws CorrelationException {
String response = getResourceLinksResponse(vserverId, vserverName);
- try {
+ List linkList = aaiResponseUtil.convertJsonToVmResourceLink(response);
+ if (linkList.size() != 0) {
return aaiResponseUtil.convertJsonToVmResourceLink(response).get(0).getResourceLink();
- } catch (Exception e) {
- throw new CorrelationException("Failed to get aai resource link", e);
}
+ return "";
}
private String getResourceLinksResponse(String vserverId, String vserverName) throws CorrelationException {
}
private String getMsbSuffixAddr(String suffixUrl) {
+ if (suffixUrl.length() <= 0) {
+ return "";
+ }
String[] addrSplits = suffixUrl.substring(1).split("/");
String[] conv = addrSplits[2].split("-");
addrSplits[2] = conv[0];