summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorrameshiyer27 <ramesh.murugan.iyer@est.tech>2023-06-12 16:24:32 +0100
committerAdheli Tavares <adheli.tavares@est.tech>2023-06-14 13:08:07 +0000
commit1d1908528e67d9763482cf9d5921456f19af31e7 (patch)
tree3cfec9ca9027ba40c1b5d797625c9aa96020a9a6 /models
parent73a48d9c7e599baf145820d0bc0968040142dac8 (diff)
Add timeout for ACM operations
User can retry the ACM state change order when ACM operations time out. Issue-ID: POLICY-4716 Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech> Change-Id: Ie840fc13170ef235c6b6f3b26a47b7516f10296c
Diffstat (limited to 'models')
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/concepts/StateChangeResult.java3
-rw-r--r--models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AcInstanceStateResolver.java17
2 files changed, 19 insertions, 1 deletions
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/StateChangeResult.java b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/StateChangeResult.java
index de4404fdd..c09b79df5 100644
--- a/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/StateChangeResult.java
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/concepts/StateChangeResult.java
@@ -22,5 +22,6 @@ package org.onap.policy.clamp.models.acm.concepts;
public enum StateChangeResult {
NO_ERROR,
- FAILED
+ FAILED,
+ TIMEOUT
}
diff --git a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AcInstanceStateResolver.java b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AcInstanceStateResolver.java
index 659169b9f..e2f4fdf9b 100644
--- a/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AcInstanceStateResolver.java
+++ b/models/src/main/java/org/onap/policy/clamp/models/acm/persistence/provider/AcInstanceStateResolver.java
@@ -50,6 +50,7 @@ public class AcInstanceStateResolver {
private static final String NO_ERROR = StateChangeResult.NO_ERROR.name();
private static final String FAILED = StateChangeResult.FAILED.name();
+ private static final String TIMEOUT = StateChangeResult.TIMEOUT.name();
// list of results
public static final String DEPLOY = DeployOrder.DEPLOY.name();
@@ -87,6 +88,22 @@ public class AcInstanceStateResolver {
this.graph.put(new String[] {DEPLOY_NONE, LOCK, DEPLOYED, UNLOCKING, FAILED}, LOCK);
this.graph.put(new String[] {DEPLOY_NONE, UNLOCK, DEPLOYED, UNLOCKING, FAILED}, UNLOCK);
+
+ // timeout
+ this.graph.put(new String[] {DEPLOY, LOCK_NONE, UNDEPLOYING, STATE_LOCKED_NONE, TIMEOUT}, DEPLOY);
+ this.graph.put(new String[] {UNDEPLOY, LOCK_NONE, UNDEPLOYING, STATE_LOCKED_NONE, TIMEOUT}, UNDEPLOY);
+ this.graph.put(new String[] {UNDEPLOY, LOCK_NONE, UPDATING, STATE_LOCKED_NONE, TIMEOUT}, UNDEPLOY);
+
+ this.graph.put(new String[] {DEPLOY, LOCK_NONE, DEPLOYING, STATE_LOCKED_NONE, TIMEOUT}, DEPLOY);
+ this.graph.put(new String[] {UNDEPLOY, LOCK_NONE, DEPLOYING, STATE_LOCKED_NONE, TIMEOUT}, UNDEPLOY);
+
+ this.graph.put(new String[] {DELETE, LOCK_NONE, DELETING, LOCK_NONE, TIMEOUT}, DELETE);
+
+ this.graph.put(new String[] {DEPLOY_NONE, UNLOCK, DEPLOYED, LOCKING, TIMEOUT}, UNLOCK);
+ this.graph.put(new String[] {DEPLOY_NONE, LOCK, DEPLOYED, LOCKING, TIMEOUT}, LOCK);
+
+ this.graph.put(new String[] {DEPLOY_NONE, LOCK, DEPLOYED, UNLOCKING, TIMEOUT}, LOCK);
+ this.graph.put(new String[] {DEPLOY_NONE, UNLOCK, DEPLOYED, UNLOCKING, TIMEOUT}, UNLOCK);
}
/**