import org.onap.cps.ncmp.api.impl.yangmodels.YangModelCmHandle;
import org.onap.cps.ncmp.api.inventory.CmHandleState;
+import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle;
/**
* The implementation of it should handle the persisting of composite state and delegate the request to publish the
* @param targetCmHandleState target cm handle state
*/
void updateCmHandleState(final YangModelCmHandle yangModelCmHandle, final CmHandleState targetCmHandleState);
+
+ /**
+ * Publish LCM Event.
+ *
+ * @param targetNcmpServiceCmHandle target NcmpServiceCmHandle
+ * @param existingNcmpServiceCmHandle existing NcmpServiceCmHandle
+ */
+ void publishLcmEvent(final NcmpServiceCmHandle targetNcmpServiceCmHandle,
+ final NcmpServiceCmHandle existingNcmpServiceCmHandle);
}
import org.onap.cps.ncmp.api.inventory.InventoryPersistence;
import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle;
import org.onap.ncmp.cmhandle.event.lcm.LcmEvent;
+import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@Slf4j
}
+ @Async("notificationExecutor")
+ @Override
+ public void publishLcmEvent(final NcmpServiceCmHandle targetNcmpServiceCmHandle,
+ final NcmpServiceCmHandle existingNcmpServiceCmHandle) {
+ final String cmHandleId = targetNcmpServiceCmHandle.getCmHandleId();
+ final LcmEvent lcmEvent =
+ lcmEventsCreator.populateLcmEvent(cmHandleId, targetNcmpServiceCmHandle, existingNcmpServiceCmHandle);
+ lcmEventsService.publishLcmEvent(cmHandleId, lcmEvent);
+ }
+
private void updateToSpecifiedCmHandleState(final YangModelCmHandle yangModelCmHandle,
final CmHandleState targetCmHandleState) {
inventoryPersistence.saveCmHandle(yangModelCmHandle);
}
- private void publishLcmEvent(final NcmpServiceCmHandle targetNcmpServiceCmHandle,
- final NcmpServiceCmHandle existingNcmpServiceCmHandle) {
- final String cmHandleId = targetNcmpServiceCmHandle.getCmHandleId();
- final LcmEvent lcmEvent =
- lcmEventsCreator.populateLcmEvent(cmHandleId, targetNcmpServiceCmHandle, existingNcmpServiceCmHandle);
- lcmEventsService.publishLcmEvent(cmHandleId, lcmEvent);
- }
-
private void updateAndSaveCmHandleState(final YangModelCmHandle yangModelCmHandle,
final CmHandleState targetCmHandleState) {
setCmHandleState(yangModelCmHandle, targetCmHandleState);