diff options
author | Toine Siebelink <toine.siebelink@est.tech> | 2023-12-14 08:36:36 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2023-12-14 08:36:36 +0000 |
commit | 8e63d7b907bf8e94eacf283af435dfd27fe823ee (patch) | |
tree | 84c87623fa3c770e6eaf2eb2d705985ca2e9f2c9 /cps-ncmp-service/src/main | |
parent | 541ed451d1257f6eb72517f33f470db53fdd7fb4 (diff) | |
parent | d8be9ef1d451f3e19c0c73752ad3d947e8baa9bd (diff) |
Merge "Modify cmHandle registration for alternateId"
Diffstat (limited to 'cps-ncmp-service/src/main')
4 files changed, 14 insertions, 19 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java index 1afe5c7114..469d75ab94 100755 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java @@ -328,7 +328,8 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService dmiPluginRegistration.getDmiDataPlugin(), dmiPluginRegistration.getDmiModelPlugin(), cmHandle, - cmHandle.getModuleSetTag()); + cmHandle.getModuleSetTag(), + cmHandle.getAlternateId()); yangModelCmHandles.add(yangModelCmHandle); initialTrustLevelPerCmHandleId.put(cmHandle.getCmHandleId(), cmHandle.getRegistrationTrustLevel()); }); @@ -420,7 +421,7 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService .withLockReason(MODULE_UPGRADE, lockReasonWithModuleSetTag).build()); return YangModelCmHandle.toYangModelCmHandle(dmiPluginRegistration.getDmiPlugin(), dmiPluginRegistration.getDmiDataPlugin(), dmiPluginRegistration.getDmiModelPlugin(), - ncmpServiceCmHandle, moduleSetTag); + ncmpServiceCmHandle, moduleSetTag, ncmpServiceCmHandle.getAlternateId()); } private CmHandleRegistrationResponse deleteCmHandleAndGetCmHandleRegistrationResponse(final String cmHandleId) { diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/YangDataConverter.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/YangDataConverter.java index b6a04d3677..b54c154b2a 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/YangDataConverter.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/YangDataConverter.java @@ -87,7 +87,8 @@ public class YangDataConverter { (String) cmHandleDataNode.getLeaves().get("dmi-data-service-name"), (String) cmHandleDataNode.getLeaves().get("dmi-model-service-name"), ncmpServiceCmHandle, - (String) cmHandleDataNode.getLeaves().get("module-set-tag") + (String) cmHandleDataNode.getLeaves().get("module-set-tag"), + (String) cmHandleDataNode.getLeaves().get("alternate-id") ); } diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java index f930d5b71d..ba36b1a54c 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandle.java @@ -68,6 +68,9 @@ public class YangModelCmHandle { @JsonProperty("module-set-tag") private String moduleSetTag; + @JsonProperty("alternate-id") + private String alternateId; + @JsonProperty("additional-properties") private List<Property> dmiProperties; @@ -91,6 +94,7 @@ public class YangModelCmHandle { copy.dmiProperties = original.getDmiProperties() == null ? null : new ArrayList<>(original.getDmiProperties()); copy.publicProperties = original.getPublicProperties() == null ? null : new ArrayList<>(original.getPublicProperties()); + copy.alternateId = original.getAlternateId(); return copy; } @@ -107,13 +111,15 @@ public class YangModelCmHandle { final String dmiDataServiceName, final String dmiModelServiceName, final NcmpServiceCmHandle ncmpServiceCmHandle, - final String moduleSetTag) { + final String moduleSetTag, + final String alternateId) { final YangModelCmHandle yangModelCmHandle = new YangModelCmHandle(); yangModelCmHandle.setId(ncmpServiceCmHandle.getCmHandleId()); yangModelCmHandle.setDmiServiceName(dmiServiceName); yangModelCmHandle.setDmiDataServiceName(dmiDataServiceName); yangModelCmHandle.setDmiModelServiceName(dmiModelServiceName); yangModelCmHandle.setModuleSetTag(moduleSetTag == null ? StringUtils.EMPTY : moduleSetTag); + yangModelCmHandle.setAlternateId(alternateId); yangModelCmHandle.setDmiProperties(asYangModelCmHandleProperties(ncmpServiceCmHandle.getDmiProperties())); yangModelCmHandle.setPublicProperties(asYangModelCmHandleProperties( ncmpServiceCmHandle.getPublicProperties())); diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/NcmpServiceCmHandle.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/NcmpServiceCmHandle.java index f323079e0b..4989878975 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/NcmpServiceCmHandle.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/NcmpServiceCmHandle.java @@ -23,7 +23,6 @@ package org.onap.cps.ncmp.api.models; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.Nulls; import java.util.Collections; -import java.util.LinkedHashMap; import java.util.Map; import lombok.Getter; import lombok.NoArgsConstructor; @@ -59,18 +58,6 @@ public class NcmpServiceCmHandle { @JsonSetter(nulls = Nulls.AS_EMPTY) private TrustLevel registrationTrustLevel; - /** - * NcmpServiceCmHandle copy constructor. - * - * @param ncmpServiceCmHandle Ncmp Service CmHandle - */ - public NcmpServiceCmHandle(final NcmpServiceCmHandle ncmpServiceCmHandle) { - this.cmHandleId = ncmpServiceCmHandle.getCmHandleId(); - this.dmiProperties = new LinkedHashMap<>(ncmpServiceCmHandle.getDmiProperties()); - this.publicProperties = new LinkedHashMap<>(ncmpServiceCmHandle.getPublicProperties()); - this.compositeState = ncmpServiceCmHandle.getCompositeState() != null ? new CompositeState( - ncmpServiceCmHandle.getCompositeState()) : null; - this.moduleSetTag = ncmpServiceCmHandle.getModuleSetTag(); - this.registrationTrustLevel = ncmpServiceCmHandle.getRegistrationTrustLevel(); - } + @JsonSetter(nulls = Nulls.AS_EMPTY) + private String alternateId; } |