diff options
author | Keighron, Lori (lk2924) <lk2924@att.com> | 2019-11-25 14:17:57 -0500 |
---|---|---|
committer | Keighron, Lori (lk2924) <lk2924@att.com> | 2019-11-26 15:47:49 -0500 |
commit | cea67fafd905f169b8db5c4be0b47959b66c32e3 (patch) | |
tree | 0b9020fc88d106916bb1e4b66667dea74ef6e701 /appc-inbound/appc-artifact-handler/provider/src/main/java/org | |
parent | 0f9c0df9e651bbcbdb3e4b8133f57abe2482cbec (diff) |
Add new LCM actions GetConfig, StartTraffic, StopTraffic, etc
New LCM actions
Change-Id: Ic59607f2a7fc515bdd01be162018aaf695668f82
Issue-ID: APPC-1790
Signed-off-by: Keighron, Lori (lk2924) <lk2924@att.com>
Diffstat (limited to 'appc-inbound/appc-artifact-handler/provider/src/main/java/org')
-rw-r--r-- | appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/node/ArtifactHandlerNode.java | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/node/ArtifactHandlerNode.java b/appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/node/ArtifactHandlerNode.java index d0b8a834c..b6fd2f599 100644 --- a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/node/ArtifactHandlerNode.java +++ b/appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/node/ArtifactHandlerNode.java @@ -119,7 +119,14 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin { private static final String CONFIGURE_PARAM = "Configure"; private static final String CONFIG_SCALE_OUT_PARAM = "ConfigScaleOut"; private static final String CONFIG_MODIFY_PARAM = "ConfigModify"; - + private static final String GET_CONFIG = "GetConfig"; + private static final String POST_EVACUATE= "PostEvacuate"; + private static final String PRE_EVACUATE = "PreEvacuate"; + private static final String POST_MIGRATE = "PostMigrate"; + private static final String PRE_MIGRATE = "PreMigrate"; + private static final String PRE_REBUILD = "PreRebuild"; + private static final String POST_REBUILD = "PostRebuild"; + private static final String STOP_TRAFFIC = "StopTraffic"; public void processArtifact(Map<String, String> inParams, SvcLogicContext ctx) throws ArtifactProcessorException { if (inParams == null || inParams.isEmpty()) { @@ -155,6 +162,7 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin { } updateStoreArtifacts(requestInfo, documentInfo); + if (artifactName.toLowerCase().startsWith(REFERENCE)) { return storeReferenceData(requestInfo, documentInfo); } else if (artifactName.toLowerCase().startsWith(PD)) { @@ -172,6 +180,7 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin { } public void validateAnsibleAdminArtifact(JSONObject documentInfo) throws ArtifactHandlerInternalException { + String fn = "ArtifactHandlerNode.validateAnsibleAdminArtifact"; String artifactName = documentInfo.getString(ARTIFACT_NAME); log.info(fn + ": Received Admin File Name: " + artifactName + " ArtifactCotent : " @@ -598,7 +607,16 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin { public void processConfigTypeActions(JSONObject content, DBService dbservice, SvcLogicContext context) throws ArtifactHandlerInternalException { try { - if (isContentActionConfig(content)) { + if (isContentActionConfig(content) + || contentsActionEquals(content, GET_CONFIG) + || contentsActionEquals(content, POST_EVACUATE) + || contentsActionEquals(content, PRE_EVACUATE) + || contentsActionEquals(content, POST_MIGRATE) + || contentsActionEquals(content, PRE_MIGRATE) + || contentsActionEquals(content, POST_REBUILD) + || contentsActionEquals(content, PRE_REBUILD) + || contentsActionEquals(content, STOP_TRAFFIC) + ) { if (content.has(DOWNLOAD_DG_REFERENCE) && content.getString(DOWNLOAD_DG_REFERENCE).length() > 0) { @@ -763,7 +781,7 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin { private void populateProtocolReference(DBService dbservice, JSONObject content) throws ArtifactHandlerInternalException { - log.info("Begin-->populateProtocolReference "); + log.info("Begin-->populateProtocolReference"); try { SvcLogicContext context = new SvcLogicContext(); JSONObject scope = content.getJSONObject("scope"); @@ -784,7 +802,7 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin { log.error("Error inserting record into protocolReference", e); throw new ArtifactHandlerInternalException("Error inserting record into protocolReference", e); } finally { - log.info("End-->populateProtocolReference "); + log.info("End-->populateProtocolReference"); } } |