From 2133020f219c8ec31c748d0a3ff9c063aa15dde9 Mon Sep 17 00:00:00 2001 From: "Modaboina, Kusumakumari (km583p)" Date: Fri, 14 Sep 2018 17:01:04 -0400 Subject: scopeOverlap errorfix actionrequest fr force=false Issue-ID: APPC-1188 Change-Id: Ife6666e80025a595c5a8f840a00d0882ac80ed71 Signed-off-by: Modaboina, Kusumakumari (km583p) --- .../onap/appc/interfaces/service/data/Request.java | 10 ++++++++++ .../service/executorImpl/ServiceExecutorImpl.java | 20 ++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) (limited to 'appc-inbound/appc-interfaces-service/bundle/src/main/java') diff --git a/appc-inbound/appc-interfaces-service/bundle/src/main/java/org/onap/appc/interfaces/service/data/Request.java b/appc-inbound/appc-interfaces-service/bundle/src/main/java/org/onap/appc/interfaces/service/data/Request.java index d43c9277b..918883559 100644 --- a/appc-inbound/appc-interfaces-service/bundle/src/main/java/org/onap/appc/interfaces/service/data/Request.java +++ b/appc-inbound/appc-interfaces-service/bundle/src/main/java/org/onap/appc/interfaces/service/data/Request.java @@ -32,6 +32,9 @@ public class Request { @JsonProperty("action-identifiers") private ActionIdentifier actionIdentifiers; + + @JsonProperty("target-id") + private String targetId; public String getAction() { return action; @@ -49,4 +52,11 @@ public class Request { this.actionIdentifiers = actionIdentifiers; } + public String getTargetId() { + return targetId; + } + + public void setTargetId(String targetId) { + this.targetId = targetId; + } } diff --git a/appc-inbound/appc-interfaces-service/bundle/src/main/java/org/onap/appc/interfaces/service/executorImpl/ServiceExecutorImpl.java b/appc-inbound/appc-interfaces-service/bundle/src/main/java/org/onap/appc/interfaces/service/executorImpl/ServiceExecutorImpl.java index f38ea83e6..cafa8dc18 100644 --- a/appc-inbound/appc-interfaces-service/bundle/src/main/java/org/onap/appc/interfaces/service/executorImpl/ServiceExecutorImpl.java +++ b/appc-inbound/appc-interfaces-service/bundle/src/main/java/org/onap/appc/interfaces/service/executorImpl/ServiceExecutorImpl.java @@ -4,8 +4,6 @@ * ================================================================================ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ - * Copyright (C) 2017 Amdocs - * ============================================================================= * 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 @@ -74,6 +72,10 @@ public class ServiceExecutorImpl { } if (scopeOverlap.getCurrentRequest().getActionIdentifiers().getVnfId() != null) { return Boolean.TRUE; + } else if (!Strings.isNullOrEmpty(scopeOverlap.getVnfId()) + && scopeOverlap.getInProgressRequest().size() > 0) { + log.info("Checking overlap for similar vnfid :" + isVnfIdOverlap(scopeOverlap)); + return isVnfIdOverlap(scopeOverlap); } else if (scopeOverlap.getCurrentRequest().getActionIdentifiers().getVfModuleId() != null) { return Boolean.TRUE; } else if (scopeOverlap.getCurrentRequest().getActionIdentifiers().getvServerId() != null) { @@ -152,4 +154,18 @@ public class ServiceExecutorImpl { } return isVnfcNameOverLap(scopeOverlap); } + + private boolean isVnfIdOverlap(ScopeOverlap scopeOverlap) throws Exception { + List inProgressRequests = scopeOverlap.getInProgressRequest(); + log.info("inProgressRequests list"+inProgressRequests.toString()); + for (Request request : inProgressRequests) { + log.info("request list"+request.getTargetId()); + if (!Strings.isNullOrEmpty(scopeOverlap.getVnfId()) + && !Strings.isNullOrEmpty(request.getTargetId()) + && (request.getTargetId() + .equals(scopeOverlap.getVnfId()))) + return Boolean.TRUE; + } + return Boolean.FALSE; + } } -- cgit 1.2.3-korg