aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt
diff options
context:
space:
mode:
authorEinat Vinouze <einat.vinouze@intl.att.com>2019-08-27 16:01:01 +0300
committerIttay Stern <ittay.stern@att.com>2019-09-09 07:01:36 +0000
commite1f7974f0badbd4440d5b7ea5f1b1cb2d4973818 (patch)
tree46be9cdc44cbb475527bc3c43df23d16f7579d29 /vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt
parente25b88b5a7a0f3bf63ca7160a441b53145484bcc (diff)
Adding feature: Replace vfmodule
Issue-ID: VID-603 Change-Id: I59068a0979d6fb733e4243c8f78921f396dc9d17 Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com> Signed-off-by: Amichai Hemli <amichai.hemli@intl.att.com> Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt9
1 files changed, 7 insertions, 2 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt b/vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt
index 0e9ab7b7a..2c50e03cd 100644
--- a/vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt
+++ b/vid-app-common/src/main/java/org/onap/vid/job/command/ResourceCommand.kt
@@ -222,11 +222,16 @@ abstract class ResourceCommand(
else -> InternalState.IN_PROGRESS
}
+ InternalState.REPLACE_MYSELF -> when (jobStatus) {
+ JobStatus.IN_PROGRESS -> InternalState.REPLACE_MYSELF
+ else -> InternalState.IN_PROGRESS
+ }
+
InternalState.IN_PROGRESS -> {
when {
jobStatus != JobStatus.COMPLETED -> InternalState.IN_PROGRESS
isDescendantHasAction(Action.Create) -> InternalState.CREATING_CHILDREN
- isDescendantHasAction(Action.Replace) -> InternalState.CREATING_CHILDREN
+ isDescendantHasAction(Action.Upgrade) -> InternalState.CREATING_CHILDREN
else -> InternalState.TERMINAL
}
}
@@ -284,7 +289,7 @@ abstract class ResourceCommand(
isNeedToResumeMySelf() -> InternalState.RESUME_MYSELF
isNeedToReplaceMySelf() -> InternalState.REPLACE_MYSELF
isDescendantHasAction(phase) -> InternalState.CREATING_CHILDREN
- isDescendantHasAction(Action.Replace) -> InternalState.CREATING_CHILDREN
+ isDescendantHasAction(Action.Upgrade) -> InternalState.CREATING_CHILDREN
else -> InternalState.TERMINAL
}
else -> throw IllegalStateException("state $internalState is not supported yet")