summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actorServiceProvider/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'models-interactions/model-actors/actorServiceProvider/src/main')
-rw-r--r--models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationFinalResult.java106
-rw-r--r--models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationOutcome.java5
-rw-r--r--models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationResult.java88
-rw-r--r--models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/TargetType.java65
-rw-r--r--models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperation.java8
-rw-r--r--models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperation.java15
-rw-r--r--models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java23
-rw-r--r--models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/parameters/ControlLoopOperationParams.java19
8 files changed, 302 insertions, 27 deletions
diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationFinalResult.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationFinalResult.java
new file mode 100644
index 000000000..67d25f2a9
--- /dev/null
+++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationFinalResult.java
@@ -0,0 +1,106 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * models
+ * ================================================================================
+ * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.controlloop.actorserviceprovider;
+
+public enum OperationFinalResult {
+ /**
+ * The Control Loop Policy successfully completed its Operations.
+ */
+ FINAL_SUCCESS("Final_Success"),
+ /**
+ * The Control Loop Policy was an Open Loop and is finished.
+ */
+ FINAL_OPENLOOP("Final_OpenLoop"),
+ /**
+ * The Control Loop Policy failed in its last Operation Policy. NOTE: Previous Operation Policies may have been
+ * successful.
+ */
+ FINAL_FAILURE("Final_Failure"),
+ /**
+ * The Control Loop Policy failed because the overall timeout was met.
+ */
+ FINAL_FAILURE_TIMEOUT("Final_Failure_Timeout"),
+ /**
+ * The Control Loop Policy failed because an Operation Policy met its retry limit.
+ */
+ FINAL_FAILURE_RETRIES("Final_Failure_Retries"),
+ /**
+ * The Control Loop Policy failed due to an exception.
+ */
+ FINAL_FAILURE_EXCEPTION("Final_Failure_Exception"),
+ /**
+ * The Control Loop Policy failed due to guard denied.
+ */
+ FINAL_FAILURE_GUARD("Final_Failure_Guard");
+
+ String result;
+
+ private OperationFinalResult(String result) {
+ this.result = result;
+ }
+
+ /**
+ * Converts to a result object.
+ *
+ * @param result input string
+ * @return result object
+ */
+ public static OperationFinalResult toResult(String result) {
+ if (result.equalsIgnoreCase(FINAL_SUCCESS.toString())) {
+ return FINAL_SUCCESS;
+ }
+ if (result.equalsIgnoreCase(FINAL_OPENLOOP.toString())) {
+ return FINAL_OPENLOOP;
+ }
+ if (result.equalsIgnoreCase(FINAL_FAILURE.toString())) {
+ return FINAL_FAILURE;
+ }
+ if (result.equalsIgnoreCase(FINAL_FAILURE_TIMEOUT.toString())) {
+ return FINAL_FAILURE_TIMEOUT;
+ }
+ if (result.equalsIgnoreCase(FINAL_FAILURE_RETRIES.toString())) {
+ return FINAL_FAILURE_RETRIES;
+ }
+ if (result.equalsIgnoreCase(FINAL_FAILURE_EXCEPTION.toString())) {
+ return FINAL_FAILURE_EXCEPTION;
+ }
+ if (result.equalsIgnoreCase(FINAL_FAILURE_GUARD.toString())) {
+ return FINAL_FAILURE_GUARD;
+ }
+ return null;
+ }
+
+ /**
+ * Check if the result really is a result.
+ *
+ * @param result string
+ * @param finalResult result object
+ * @return true if a result
+ */
+ public static boolean isResult(String result, OperationFinalResult finalResult) {
+ OperationFinalResult toResult = OperationFinalResult.toResult(result);
+ if (toResult == null) {
+ return false;
+ }
+ return toResult.equals(finalResult);
+ }
+
+}
diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationOutcome.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationOutcome.java
index 0c4350c63..2d6a61249 100644
--- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationOutcome.java
+++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationOutcome.java
@@ -25,7 +25,6 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import org.onap.policy.controlloop.ControlLoopOperation;
-import org.onap.policy.controlloop.policy.PolicyResult;
/**
* Outcome from an operation. Objects of this type are passed from one stage to the next.
@@ -39,7 +38,7 @@ public class OperationOutcome {
private Instant start;
private Instant end;
private String subRequestId;
- private PolicyResult result = PolicyResult.SUCCESS;
+ private OperationResult result = OperationResult.SUCCESS;
private String message;
private boolean finalOutcome;
private Object response;
@@ -119,7 +118,7 @@ public class OperationOutcome {
*
* @param result new result
*/
- public void setResult(@NonNull PolicyResult result) {
+ public void setResult(@NonNull OperationResult result) {
this.result = result;
}
}
diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationResult.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationResult.java
new file mode 100644
index 000000000..4577617a2
--- /dev/null
+++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/OperationResult.java
@@ -0,0 +1,88 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP
+ * ================================================================================
+ * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.controlloop.actorserviceprovider;
+
+public enum OperationResult {
+ /**
+ * Operation was successful.
+ */
+ SUCCESS("Success"),
+ /**
+ * Operation failed.
+ */
+ FAILURE("Failure"),
+ /**
+ * Operation failed due to maximum retries being met.
+ */
+ FAILURE_RETRIES("Failure_Retries"),
+ /**
+ * Operation failed due to timeout occurring.
+ */
+ FAILURE_TIMEOUT("Failure_Timeout"),
+ /**
+ * Operation failed due to an exception.
+ */
+ FAILURE_EXCEPTION("Failure_Exception"),
+ /**
+ * Operation failed since Guard did not permit.
+ */
+ FAILURE_GUARD("Failure_Guard")
+ ;
+
+
+ private String result;
+ private OperationResult(String result) {
+ this.result = result;
+ }
+
+ @Override
+ public String toString() {
+ return this.result;
+ }
+
+ /**
+ * Convert to a result.
+ *
+ * @param result result string
+ * @return Result object
+ */
+ public static OperationResult toResult(String result) {
+ if (result.equalsIgnoreCase(SUCCESS.toString())) {
+ return SUCCESS;
+ }
+ if (result.equalsIgnoreCase(FAILURE.toString())) {
+ return FAILURE;
+ }
+ if (result.equalsIgnoreCase(FAILURE_RETRIES.toString())) {
+ return FAILURE_RETRIES;
+ }
+ if (result.equalsIgnoreCase(FAILURE_TIMEOUT.toString())) {
+ return FAILURE_TIMEOUT;
+ }
+ if (result.equalsIgnoreCase(FAILURE_EXCEPTION.toString())) {
+ return FAILURE_EXCEPTION;
+ }
+ if (result.equalsIgnoreCase(FAILURE_GUARD.toString())) {
+ return FAILURE_GUARD;
+ }
+ return null;
+ }
+}
diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/TargetType.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/TargetType.java
new file mode 100644
index 000000000..605445c57
--- /dev/null
+++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/TargetType.java
@@ -0,0 +1,65 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP
+ * ================================================================================
+ * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.controlloop.actorserviceprovider;
+
+public enum TargetType {
+ VM("VM"), PNF("PNF"), VFC("VFC"), VNF("VNF"), VFMODULE("VFMODULE");
+
+ private String target;
+
+ private TargetType(String targetType) {
+ this.target = targetType;
+ }
+
+ @Override
+ public String toString() {
+ return this.target;
+ }
+
+ /**
+ * Converts a string to TargetType object if it matches.
+ *
+ * @param targetType String
+ * @return TargetType object
+ */
+ public static TargetType toTargetType(String targetType) {
+ if (targetType == null) {
+ return null;
+ }
+ if (targetType.equalsIgnoreCase(VM.toString())) {
+ return VM;
+ }
+ if (targetType.equalsIgnoreCase(PNF.toString())) {
+ return PNF;
+ }
+ if (targetType.equalsIgnoreCase(VFC.toString())) {
+ return VFC;
+ }
+ if (targetType.equalsIgnoreCase(VNF.toString())) {
+ return VNF;
+ }
+ if (targetType.equalsIgnoreCase(VFMODULE.toString())) {
+ return VFMODULE;
+ }
+
+ return null;
+ }
+}
diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperation.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperation.java
index a3f3a6905..e02e59239 100644
--- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperation.java
+++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/BidirectionalTopicOperation.java
@@ -29,12 +29,12 @@ import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoderObject;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
+import org.onap.policy.controlloop.actorserviceprovider.OperationResult;
import org.onap.policy.controlloop.actorserviceprovider.parameters.BidirectionalTopicConfig;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
import org.onap.policy.controlloop.actorserviceprovider.pipeline.PipelineControllerFuture;
import org.onap.policy.controlloop.actorserviceprovider.topic.BidirectionalTopicHandler;
import org.onap.policy.controlloop.actorserviceprovider.topic.Forwarder;
-import org.onap.policy.controlloop.policy.PolicyResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -215,14 +215,14 @@ public abstract class BidirectionalTopicOperation<Q, S> extends OperationPartial
case SUCCESS:
logger.info("{}.{} request succeeded for {}", params.getActor(), params.getOperation(),
params.getRequestId());
- setOutcome(outcome, PolicyResult.SUCCESS, response);
+ setOutcome(outcome, OperationResult.SUCCESS, response);
postProcessResponse(outcome, rawResponse, response);
return outcome;
case FAILURE:
logger.info("{}.{} request failed for {}", params.getActor(), params.getOperation(),
params.getRequestId());
- return setOutcome(outcome, PolicyResult.FAILURE, response);
+ return setOutcome(outcome, OperationResult.FAILURE, response);
case STILL_WAITING:
default:
@@ -240,7 +240,7 @@ public abstract class BidirectionalTopicOperation<Q, S> extends OperationPartial
* @param response response used to populate the outcome
* @return the updated operation
*/
- public OperationOutcome setOutcome(OperationOutcome outcome, PolicyResult result, S response) {
+ public OperationOutcome setOutcome(OperationOutcome outcome, OperationResult result, S response) {
outcome.setResponse(response);
return setOutcome(outcome, result);
}
diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperation.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperation.java
index 09c876d41..c75ca1d4f 100644
--- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperation.java
+++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/HttpOperation.java
@@ -37,12 +37,12 @@ import org.onap.policy.common.endpoints.utils.NetLoggerUtil;
import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
+import org.onap.policy.controlloop.actorserviceprovider.OperationResult;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpConfig;
import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpParams;
import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpPollingConfig;
import org.onap.policy.controlloop.actorserviceprovider.pipeline.PipelineControllerFuture;
-import org.onap.policy.controlloop.policy.PolicyResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -243,11 +243,12 @@ public abstract class HttpOperation<T> extends OperationPartial {
if (!isSuccess(rawResponse, response)) {
logger.info("{}.{} request failed with http error code {} for {}", params.getActor(), params.getOperation(),
rawResponse.getStatus(), params.getRequestId());
- return CompletableFuture.completedFuture(setOutcome(outcome, PolicyResult.FAILURE, rawResponse, response));
+ return CompletableFuture.completedFuture(
+ setOutcome(outcome, OperationResult.FAILURE, rawResponse, response));
}
logger.info("{}.{} request succeeded for {}", params.getActor(), params.getOperation(), params.getRequestId());
- setOutcome(outcome, PolicyResult.SUCCESS, rawResponse, response);
+ setOutcome(outcome, OperationResult.SUCCESS, rawResponse, response);
return postProcessResponse(outcome, url, rawResponse, response);
}
@@ -260,7 +261,7 @@ public abstract class HttpOperation<T> extends OperationPartial {
* @param response decoded response
* @return the updated operation
*/
- public OperationOutcome setOutcome(OperationOutcome outcome, PolicyResult result, Response rawResponse,
+ public OperationOutcome setOutcome(OperationOutcome outcome, OperationResult result, Response rawResponse,
T response) {
outcome.setResponse(response);
@@ -292,13 +293,13 @@ public abstract class HttpOperation<T> extends OperationPartial {
logger.info("{}.{} request succeeded for {}", params.getActor(), params.getOperation(),
params.getRequestId());
return CompletableFuture
- .completedFuture(setOutcome(outcome, PolicyResult.SUCCESS, rawResponse, response));
+ .completedFuture(setOutcome(outcome, OperationResult.SUCCESS, rawResponse, response));
case FAILURE:
logger.info("{}.{} request failed for {}", params.getActor(), params.getOperation(),
params.getRequestId());
return CompletableFuture
- .completedFuture(setOutcome(outcome, PolicyResult.FAILURE, rawResponse, response));
+ .completedFuture(setOutcome(outcome, OperationResult.FAILURE, rawResponse, response));
case STILL_WAITING:
default:
@@ -313,7 +314,7 @@ public abstract class HttpOperation<T> extends OperationPartial {
if (pollCount++ >= cfg.getMaxPolls()) {
logger.warn("{}: execeeded 'poll' limit {} for {}", getFullName(), cfg.getMaxPolls(),
params.getRequestId());
- setOutcome(outcome, PolicyResult.FAILURE_TIMEOUT);
+ setOutcome(outcome, OperationResult.FAILURE_TIMEOUT);
return CompletableFuture.completedFuture(outcome);
}
diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java
index b5cc15e19..c81575f62 100644
--- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java
+++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java
@@ -54,10 +54,10 @@ import org.onap.policy.controlloop.actorserviceprovider.CallbackManager;
import org.onap.policy.controlloop.actorserviceprovider.Operation;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.OperationProperties;
+import org.onap.policy.controlloop.actorserviceprovider.OperationResult;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
import org.onap.policy.controlloop.actorserviceprovider.parameters.OperatorConfig;
import org.onap.policy.controlloop.actorserviceprovider.pipeline.PipelineControllerFuture;
-import org.onap.policy.controlloop.policy.PolicyResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -132,10 +132,12 @@ public abstract class OperationPartial implements Operation {
return config.getBlockingExecutor();
}
+ @Override
public String getActorName() {
return params.getActor();
}
+ @Override
public String getName() {
return params.getOperation();
}
@@ -221,7 +223,7 @@ public abstract class OperationPartial implements Operation {
// TODO need a FAILURE_MISSING_DATA (e.g., A&AI)
outcome2.setFinalOutcome(true);
- outcome2.setResult(PolicyResult.FAILURE_GUARD);
+ outcome2.setResult(OperationResult.FAILURE_GUARD);
outcome2.setMessage(outcome != null ? outcome.getMessage() : null);
// @formatter:off
@@ -392,7 +394,7 @@ public abstract class OperationPartial implements Operation {
* @return {@code true} if the outcome was successful
*/
protected boolean isSuccess(OperationOutcome outcome) {
- return (outcome != null && outcome.getResult() == PolicyResult.SUCCESS);
+ return (outcome != null && outcome.getResult() == OperationResult.SUCCESS);
}
/**
@@ -403,7 +405,7 @@ public abstract class OperationPartial implements Operation {
* <i>and</i> was associated with this operator, {@code false} otherwise
*/
protected boolean isActorFailed(OperationOutcome outcome) {
- return (isSameOperation(outcome) && outcome.getResult() == PolicyResult.FAILURE);
+ return (isSameOperation(outcome) && outcome.getResult() == OperationResult.FAILURE);
}
/**
@@ -475,7 +477,7 @@ public abstract class OperationPartial implements Operation {
outcome = origOutcome;
} else {
logger.warn("{}: null outcome; treating as a failure for {}", getFullName(), params.getRequestId());
- outcome = this.setOutcome(params.makeOutcome(getTargetEntity()), PolicyResult.FAILURE);
+ outcome = this.setOutcome(params.makeOutcome(getTargetEntity()), OperationResult.FAILURE);
}
// ensure correct actor/operation
@@ -483,7 +485,7 @@ public abstract class OperationPartial implements Operation {
outcome.setOperation(getName());
// determine if we should retry, based on the result
- if (outcome.getResult() != PolicyResult.FAILURE) {
+ if (outcome.getResult() != OperationResult.FAILURE) {
// do not retry success or other failure types (e.g., exception)
outcome.setFinalOutcome(true);
return outcome;
@@ -504,7 +506,7 @@ public abstract class OperationPartial implements Operation {
* FAILURE_RETRIES
*/
logger.info("operation {} retries exhausted for {}", getFullName(), params.getRequestId());
- outcome.setResult(PolicyResult.FAILURE_RETRIES);
+ outcome.setResult(OperationResult.FAILURE_RETRIES);
outcome.setFinalOutcome(true);
}
@@ -989,7 +991,8 @@ public abstract class OperationPartial implements Operation {
* @return the updated operation
*/
public OperationOutcome setOutcome(OperationOutcome operation, Throwable thrown) {
- PolicyResult result = (isTimeout(thrown) ? PolicyResult.FAILURE_TIMEOUT : PolicyResult.FAILURE_EXCEPTION);
+ OperationResult result = (isTimeout(thrown) ? OperationResult.FAILURE_TIMEOUT
+ : OperationResult.FAILURE_EXCEPTION);
return setOutcome(operation, result);
}
@@ -1000,10 +1003,10 @@ public abstract class OperationPartial implements Operation {
* @param result result of the operation
* @return the updated operation
*/
- public OperationOutcome setOutcome(OperationOutcome operation, PolicyResult result) {
+ public OperationOutcome setOutcome(OperationOutcome operation, OperationResult result) {
logger.trace("{}: set outcome {} for {}", getFullName(), result, params.getRequestId());
operation.setResult(result);
- operation.setMessage(result == PolicyResult.SUCCESS ? ControlLoopOperation.SUCCESS_MSG
+ operation.setMessage(result == OperationResult.SUCCESS ? ControlLoopOperation.SUCCESS_MSG
: ControlLoopOperation.FAILED_MSG);
return operation;
diff --git a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/parameters/ControlLoopOperationParams.java b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/parameters/ControlLoopOperationParams.java
index 66573f38a..0e4f09b66 100644
--- a/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/parameters/ControlLoopOperationParams.java
+++ b/models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/parameters/ControlLoopOperationParams.java
@@ -37,9 +37,9 @@ import org.onap.policy.controlloop.VirtualControlLoopEvent;
import org.onap.policy.controlloop.actorserviceprovider.ActorService;
import org.onap.policy.controlloop.actorserviceprovider.Operation;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
+import org.onap.policy.controlloop.actorserviceprovider.TargetType;
import org.onap.policy.controlloop.actorserviceprovider.Util;
import org.onap.policy.controlloop.actorserviceprovider.controlloop.ControlLoopEventContext;
-import org.onap.policy.controlloop.policy.Target;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -54,6 +54,13 @@ import org.slf4j.LoggerFactory;
public class ControlLoopOperationParams {
private static final Logger logger = LoggerFactory.getLogger(ControlLoopOperationParams.class);
+ public static final String PARAMS_ENTITY_RESOURCEID = "resourceID";
+ public static final String PARAMS_ENTITY_MODEL_INVARIANT_ID = "modelInvariantId";
+ public static final String PARAMS_ENTITY_MODEL_VERSION_ID = "modelVersionId";
+ public static final String PARAMS_ENTITY_MODEL_NAME = "modelName";
+ public static final String PARAMS_ENTITY_MODEL_VERSION = "modelVersion";
+ public static final String PARAMS_ENTITY_MODEL_CUSTOMIZATION_ID = "modelCustomizationId";
+
/**
* Actor name.
*/
@@ -107,10 +114,16 @@ public class ControlLoopOperationParams {
private Integer retry;
/**
- * The Target information, extracted from the Policy. May be {@code null}, depending
+ * The Target Type information, extracted from the Policy. May be {@code null}, depending
* on the requirement of the operation to be invoked.
*/
- private Target target;
+ private TargetType targetType;
+
+ /**
+ * Target entitiy ids, extracted from the Policy. May be (@code null}, depending on
+ * the requirement of the operation to be invoked.
+ */
+ private Map<String, String> targetEntityIds;
/**
* Target entity.