summaryrefslogtreecommitdiffstats
path: root/model/basic-model/src
diff options
context:
space:
mode:
authorRashmi Pujar <rashmi.pujar1@bell.ca>2022-01-22 00:37:28 -0500
committerRashmi Pujar <rashmi.pujar1@bell.ca>2022-01-24 14:06:57 -0500
commit632899642b6a1d1489a0b96932c9c38863a53a26 (patch)
treeab9665853aa637ab1d76d7c25523c77835d3ca3e /model/basic-model/src
parentc719ee941bd4202b617544e351a11a35b20b8a6a (diff)
Add TOSCA policy status header field to APEX event create CLI
In order to expose the processing status of a TOSCA policy to APEX-PDP, a new header field for APEX concept "event" has been introduced to track this within an APEX policy implementation. This field will be leveraged to extract the TOSCA policy execution metrics. Note, that the field is marked as optional for backward compatibility. Unit tests have been augmented to test for the field wherever applicable and the default empty value is retained for the others. "example-grpc" module has been updated to include this field. Exposing the TOSCA policy execution metrics is outside the scope of this patch since the current changes are already very large owing to the atomic nature of the change introduced. Issue-ID: POLICY-3845 Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca> Change-Id: Ief6d70f9abcfc8414e10aa51a27815ee9028e4c8
Diffstat (limited to 'model/basic-model/src')
-rw-r--r--model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxToscaPolicyProcessingStatus.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxToscaPolicyProcessingStatus.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxToscaPolicyProcessingStatus.java
new file mode 100644
index 000000000..43c7e7866
--- /dev/null
+++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxToscaPolicyProcessingStatus.java
@@ -0,0 +1,46 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 Bell Canada. 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.apex.model.basicmodel.concepts;
+
+/**
+ * This enumeration indicates the status of TOSCA policy processing on an APEX event.
+ */
+public enum AxToscaPolicyProcessingStatus {
+
+ /** Indicates the entrypoint for the processing of a TOSCA Policy. */
+ ENTRY(0),
+
+ /** Indicates a successful exit point for a TOSCA Policy. */
+ EXIT_SUCCESS(1),
+
+ /** Indicates a failure exit point for a TOSCA Policy. */
+ EXIT_FAILURE(2);
+
+ private final int statusCode;
+
+ AxToscaPolicyProcessingStatus(int statusCode) {
+ this.statusCode = statusCode;
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+} \ No newline at end of file