diff options
author | 2022-05-19 14:09:58 +0100 | |
---|---|---|
committer | 2022-06-01 14:48:21 +0100 | |
commit | 912c86dec96e675c2635298cea8869d014938042 (patch) | |
tree | 504061c0e1f9782da7e676da428b67b0d4de9eee /cps-ncmp-rest/src/main/java | |
parent | 5d3ed6ff2fe76e2510867379fdf58d4e99b2cc9f (diff) |
Module Sync Lock State implementation
Implementation of Lock state for module sync watchdog
Cm Handle state is locked if any exception is found
during sync process
Make changes around READY state method in line with the
new schema set
Add last updated time to composite state
Remove running datastore references as this is being done
at a later time
Issue-ID: CPS-875
Change-Id: I6bd159faefef2fa84dbf536c292ff0a132793381
Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
Diffstat (limited to 'cps-ncmp-rest/src/main/java')
-rw-r--r-- | cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/mapper/RestOutputCmHandleStateMapper.java | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/mapper/RestOutputCmHandleStateMapper.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/mapper/RestOutputCmHandleStateMapper.java index ce3206829..5f4b31118 100644 --- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/mapper/RestOutputCmHandleStateMapper.java +++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/mapper/RestOutputCmHandleStateMapper.java @@ -25,7 +25,6 @@ import org.mapstruct.Mapping; import org.mapstruct.Named; import org.mapstruct.NullValueCheckStrategy; import org.mapstruct.NullValuePropertyMappingStrategy; -import org.onap.cps.ncmp.api.inventory.CmHandleState; import org.onap.cps.ncmp.api.inventory.CompositeState; import org.onap.cps.ncmp.rest.model.DataStores; import org.onap.cps.ncmp.rest.model.RestOutputCmHandleState; @@ -36,7 +35,7 @@ import org.onap.cps.ncmp.rest.model.SyncState; public interface RestOutputCmHandleStateMapper { @Mapping(target = "dataSyncState", source = "dataStores", qualifiedByName = "dataStoreToDataSyncState") - @Mapping(target = "cmHandleState", source = "cmhandleState", qualifiedByName = "cmHandleStateEnumToString") + @Mapping(target = "lockReason.reason", source = "lockReason.lockReasonCategory") RestOutputCmHandleState toRestOutputCmHandleState(CompositeState compositeState); /** @@ -54,13 +53,6 @@ public interface RestOutputCmHandleStateMapper { final DataStores dataStores = new DataStores(); - if (compositeStateDataStore.getRunningDataStore() != null) { - final SyncState runningSyncState = new SyncState(); - runningSyncState.setState(compositeStateDataStore.getRunningDataStore().getSyncState()); - runningSyncState.setLastSyncTime(compositeStateDataStore.getRunningDataStore().getLastSyncTime()); - dataStores.setRunning(runningSyncState); - } - if (compositeStateDataStore.getOperationalDataStore() != null) { final SyncState operationalSyncState = new SyncState(); operationalSyncState.setState(compositeStateDataStore.getOperationalDataStore().getSyncState()); @@ -73,15 +65,4 @@ public interface RestOutputCmHandleStateMapper { } - /** - * Converts cmHandleState enum value to equivalent string. - * - * @param cmHandleState cm handle state enum - * @return cm handle state as string - */ - @Named("cmHandleStateEnumToString") - static String toCmHandleState(final CmHandleState cmHandleState) { - return cmHandleState.name(); - } - } |