summaryrefslogtreecommitdiffstats
path: root/controlloop/common/controller-usecases
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/common/controller-usecases')
-rw-r--r--controlloop/common/controller-usecases/src/main/java/org/onap/policy/drools/apps/controller/usecases/GetTargetEntityOperation2.java17
-rw-r--r--controlloop/common/controller-usecases/src/main/java/org/onap/policy/drools/apps/controller/usecases/UsecasesEventManager.java5
-rw-r--r--controlloop/common/controller-usecases/src/main/resources/usecases.drl6
3 files changed, 16 insertions, 12 deletions
diff --git a/controlloop/common/controller-usecases/src/main/java/org/onap/policy/drools/apps/controller/usecases/GetTargetEntityOperation2.java b/controlloop/common/controller-usecases/src/main/java/org/onap/policy/drools/apps/controller/usecases/GetTargetEntityOperation2.java
index 29689edf7..8341be1d3 100644
--- a/controlloop/common/controller-usecases/src/main/java/org/onap/policy/drools/apps/controller/usecases/GetTargetEntityOperation2.java
+++ b/controlloop/common/controller-usecases/src/main/java/org/onap/policy/drools/apps/controller/usecases/GetTargetEntityOperation2.java
@@ -3,7 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -93,11 +93,16 @@ public class GetTargetEntityOperation2 extends OperationPartial {
throw new IllegalArgumentException("The target type is null");
}
- return switch (targetType) {
- case PNF -> detmPnfTarget();
- case VM, VNF, VFMODULE -> detmVfModuleTarget();
- default -> throw new IllegalArgumentException("The target type is not supported");
- };
+ switch (targetType) {
+ case PNF:
+ return detmPnfTarget();
+ case VM:
+ case VNF:
+ case VFMODULE:
+ return detmVfModuleTarget();
+ default:
+ throw new IllegalArgumentException("The target type is not supported");
+ }
}
/**
diff --git a/controlloop/common/controller-usecases/src/main/java/org/onap/policy/drools/apps/controller/usecases/UsecasesEventManager.java b/controlloop/common/controller-usecases/src/main/java/org/onap/policy/drools/apps/controller/usecases/UsecasesEventManager.java
index 86a189dd3..62d5f70a9 100644
--- a/controlloop/common/controller-usecases/src/main/java/org/onap/policy/drools/apps/controller/usecases/UsecasesEventManager.java
+++ b/controlloop/common/controller-usecases/src/main/java/org/onap/policy/drools/apps/controller/usecases/UsecasesEventManager.java
@@ -37,7 +37,6 @@ import static org.onap.policy.drools.apps.controller.usecases.UsecasesConstants.
import static org.onap.policy.drools.apps.controller.usecases.UsecasesConstants.VSERVER_PROV_STATUS;
import static org.onap.policy.drools.apps.controller.usecases.UsecasesConstants.VSERVER_VSERVER_NAME;
-import java.io.Serial;
import java.util.Deque;
import java.util.Map;
import java.util.Set;
@@ -72,7 +71,6 @@ import org.onap.policy.sdnr.PciMessage;
*/
public class UsecasesEventManager extends ClEventManagerWithEvent<Step2> implements StepContext {
- @Serial
private static final long serialVersionUID = -1216568161322872641L;
/**
@@ -255,7 +253,8 @@ public class UsecasesEventManager extends ClEventManagerWithEvent<Step2> impleme
throw new ControlLoopException("The Target type is null");
}
switch (event.getTargetType()) {
- case VM, VNF:
+ case VM:
+ case VNF:
validateAaiVmVnfData(eventAai);
return;
case PNF:
diff --git a/controlloop/common/controller-usecases/src/main/resources/usecases.drl b/controlloop/common/controller-usecases/src/main/resources/usecases.drl
index 70a1cd8a1..f337f2179 100644
--- a/controlloop/common/controller-usecases/src/main/resources/usecases.drl
+++ b/controlloop/common/controller-usecases/src/main/resources/usecases.drl
@@ -741,7 +741,7 @@ rule "EVENT.MANAGER.PROCESS.FINAL.FAILURE.ACCEPTED"
notification.setPolicyName($manager.getPolicyName());
notification.setPolicyVersion($manager.getPolicyVersion());
notification.setHistory($manager.getPartialHistory().stream().map(OperationOutcome2::getClOperation)
- .toList());
+ .collect(Collectors.toList()));
// trigger move to the next policy - clear all steps
$manager.getSteps().clear();
@@ -800,7 +800,7 @@ rule "EVENT.MANAGER.PROCESS.FINAL.FAILURE.REJECTED"
notification.setPolicyName($manager.getPolicyName());
notification.setPolicyVersion($manager.getPolicyVersion());
notification.setHistory($manager.getPartialHistory().stream().map(OperationOutcome2::getClOperation)
- .toList());
+ .collect(Collectors.toList()));
$manager.deliver("policy-cl-mgt", notification, "notification", drools.getRule().getName());
@@ -1004,7 +1004,7 @@ rule "EVENT.MANAGER.FINAL"
notification.setPolicyName($manager.getPolicyName());
notification.setPolicyVersion($manager.getPolicyVersion());
notification.setHistory($manager.getFullHistory().stream().map(OperationOutcome2::getClOperation)
- .toList());
+ .collect(Collectors.toList()));
OperationFinalResult finalResult = $manager.getFinalResult();
if (finalResult == null) {