aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Brady <patrick.brady@att.com>2019-05-10 15:14:06 -0700
committerPatrick Brady <patrick.brady@att.com>2019-05-13 16:45:10 +0000
commit271fe4a979c6fd6aedfd0d63fb3f7a4980fa7c37 (patch)
tree3f1180e8f33f53d80fef1d6f9a73d57bfc2b2f91
parent1d5c5fb0f3c6609c9ca2ce54e3b45027911119b6 (diff)
Add ConfigModify to if statement
Requests from cdt with the action set to ConfigModify did not have entries added to the device interface protocol table. With this change the entry will be made in the table. Change-Id: I29835554a0ebf2fea29f1c8745b99ac1813c0d7d Signed-off-by: Patrick Brady <patrick.brady@att.com> Issue-ID: APPC-1593 (cherry picked from commit c3719d87ad36bd1fae457f34ec8aa3247915dc6f)
-rw-r--r--appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/node/ArtifactHandlerNode.java18
1 files changed, 10 insertions, 8 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 b2cc984fb..d0b8a834c 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
@@ -597,10 +597,8 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin {
public void processConfigTypeActions(JSONObject content, DBService dbservice, SvcLogicContext context)
throws ArtifactHandlerInternalException {
-
try {
- if (contentsActionEquals(content, CONFIGURE_PARAM) || contentsActionEquals(content, CONFIG_MODIFY_PARAM)
- || contentsActionEquals(content, CONFIG_SCALE_OUT_PARAM)) {
+ if (isContentActionConfig(content)) {
if (content.has(DOWNLOAD_DG_REFERENCE) && content.getString(DOWNLOAD_DG_REFERENCE).length() > 0) {
@@ -624,16 +622,20 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin {
private void tryProcessInterfaceProtocol(JSONObject content, DBService dbservice, SvcLogicContext context)
throws SvcLogicException, SQLException, ConfigurationException, DBException {
-
- if (contentsActionEquals(content, CONFIGURE_PARAM) || contentsActionEquals(content, CONFIG_SCALE_OUT_PARAM)) {
+ if (isContentActionConfig(content)) {
boolean isUpdateRequired = dbservice.isArtifactUpdateRequired(context, DB_DEVICE_INTERFACE_PROTOCOL);
- if (contentsActionEquals(content, CONFIGURE_PARAM)
- || (contentsActionEquals(content, CONFIG_SCALE_OUT_PARAM) && !isUpdateRequired)) {
-
+ if (isContentActionConfig(content) && !isUpdateRequired) {
dbservice.processDeviceInterfaceProtocol(context, isUpdateRequired);
}
}
}
+
+ //Consolidates the if statements required to check if the action is one of the config actions
+ private boolean isContentActionConfig(JSONObject content) {
+ return contentsActionEquals(content, CONFIGURE_PARAM)
+ || contentsActionEquals(content, CONFIG_MODIFY_PARAM)
+ || contentsActionEquals(content, CONFIG_SCALE_OUT_PARAM);
+ }
private boolean contentsActionEquals(JSONObject content, String action) {
return content.getString(ACTION).equals(action);