X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=appc-outbound%2Fappc-aai-client%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fappc%2Faai%2Fclient%2Faai%2FAaiService.java;fp=appc-outbound%2Fappc-aai-client%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fappc%2Faai%2Fclient%2Faai%2FAaiService.java;h=c1f42a73de0d224c40f1fd06f889551c56e78d4c;hb=e4211cdd64e59989bb03dfbdd8c255aea8152c63;hp=cb439ee1619e4f419d1408edf4e406c87de35c94;hpb=caece93b98a0c7ad1ae762ff1f29571e1bca8e0f;p=appc.git diff --git a/appc-outbound/appc-aai-client/provider/src/main/java/org/onap/appc/aai/client/aai/AaiService.java b/appc-outbound/appc-aai-client/provider/src/main/java/org/onap/appc/aai/client/aai/AaiService.java index cb439ee16..c1f42a73d 100644 --- a/appc-outbound/appc-aai-client/provider/src/main/java/org/onap/appc/aai/client/aai/AaiService.java +++ b/appc-outbound/appc-aai-client/provider/src/main/java/org/onap/appc/aai/client/aai/AaiService.java @@ -247,7 +247,7 @@ public class AaiService { String vserverName = ctx.getAttribute(aaiRefKey + "vserver-name"); String vnfcName = vserverName + vnfcFuncCode + "001"; String groupNotation = getGroupNotation(groupNotationType, groupNotationValue, vnfcName, vserverName, - prefix, ctx, vnfcType); + prefix, ctx, vnfcType, vnfcFuncCode, vmCount); String ipAddressV4OamVip = null; if ("Y".equals(populateIpAddressV4OamVip)) { @@ -372,7 +372,7 @@ public class AaiService { } public String getGroupNotation(String groupNotationType, String groupNotationValue, String vnfcName, - String vserverName, String prefix, SvcLogicContext ctx, String vnfcRefVnfcType) throws Exception { + String vserverName, String prefix, SvcLogicContext ctx, String vnfcRefVnfcType, String vnfcFuncCode, int vmCount) throws Exception { String grpNotation = null; @@ -446,11 +446,54 @@ public class AaiService { } } } + else if ("existing-value".equals(groupNotationType)) { + /* This is a new value being added. Find the existing vnfc records in A&AI inventory with the same vnfc-function code as the value in vnfc_reference table. + * Verify that the group-notation value is the same for all such records found in inventory. + * if all records do not have the same group-notation value, write the new vnfc record to A&AI inventory without a group-notation value and continue to the next VM in the vnfc_reference table. A 501 intermediate error message should be sent after all new VNFC records have been added to A&AI. + If all records match, use the same group-notation value for the new vnfc record as found in the existing vnfc records. +*/ + grpNotation = getGroupNotationForExistigValue(ctx, prefix, vnfcFuncCode, vmCount); + } log.info("RETURNED GROUPNOTATION " + grpNotation); return grpNotation; } + public String getGroupNotationForExistigValue(SvcLogicContext ctx, String prefix, String vnfcFuncCode, int vmCount) { + String vfModuleId = ctx.getAttribute("req-vf-module-id"); //Coming from request-params + boolean first=true; + String aaiGroupNotationValue=null; + for (int i=0;i