aboutsummaryrefslogtreecommitdiffstats
path: root/appc-dispatcher/appc-command-executor
diff options
context:
space:
mode:
authorPatrick Brady <pb071s@att.com>2018-03-22 15:12:48 -0700
committerPatrick Brady <pb071s@att.com>2018-04-11 17:42:20 +0000
commit5b81764739425ccb4a418947e1565a7f691f4204 (patch)
tree245b7d69f2bc2c093c88bc9fb3c2c3757468e9c1 /appc-dispatcher/appc-command-executor
parentabd3c649e4e50d9e1e995f81cb080e470eb02b48 (diff)
ODL Upgrade Method 2
Changes necessary to support upgrade to ODL Nitrogen, while continuing to use Karaf 3 style features Change-Id: I2edf619e0b889420c32793b958c0926b0311e71d Signed-off-by: Patrick Brady <pb071s@att.com> Issue-ID: APPC-403
Diffstat (limited to 'appc-dispatcher/appc-command-executor')
-rw-r--r--appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/onap/appc/executor/impl/CommandTask.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/onap/appc/executor/impl/CommandTask.java b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/onap/appc/executor/impl/CommandTask.java
index 4a82ca6a8..0784ffcbe 100644
--- a/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/onap/appc/executor/impl/CommandTask.java
+++ b/appc-dispatcher/appc-command-executor/appc-command-executor-core/src/main/java/org/onap/appc/executor/impl/CommandTask.java
@@ -18,7 +18,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
* ============LICENSE_END=========================================================
*/
@@ -37,6 +36,7 @@ import com.att.eelf.configuration.EELFManager;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.onap.ccsdk.sli.core.sli.SvcLogicResource;
+import org.onap.ccsdk.sli.adaptors.aai.AAIRequest;
import org.onap.ccsdk.sli.adaptors.aai.AAIService;
import org.onap.ccsdk.sli.adaptors.aai.AAIServiceException;
import org.osgi.framework.BundleContext;
@@ -142,7 +142,7 @@ public class CommandTask implements Runnable {
if (statusCode == 100 || statusCode == 400) {
SvcLogicContext ctx = new SvcLogicContext();
ctx = getVnfdata(commandRequest.getCommandExecutorInput().getRuntimeContext().getVnfContext().getId(), "vnf", ctx);
- aaiService.deleteGenericVnfData(commandRequest.getCommandExecutorInput().getRuntimeContext().getVnfContext().getId(), ctx.getAttribute("vnf.resource-version"));
+ deleteGenericVnfData(commandRequest.getCommandExecutorInput().getRuntimeContext().getVnfContext().getId(), ctx.getAttribute("vnf.resource-version"));
}
}
@@ -194,4 +194,20 @@ public class CommandTask implements Runnable {
logger.error(e.getMessage(),e);
}
}
+
+ public boolean deleteGenericVnfData(String vnf_id, String resourceVersion) throws AAIServiceException {
+ boolean response = false;
+
+ try {
+ AAIRequest request = aaiService.getRequestFromResource("generic-vnf");
+ request.addRequestProperty("generic-vnf.vnf-id", vnf_id);
+ response = aaiService.delete(request, resourceVersion);
+ } catch(AAIServiceException aaiexc) {
+ throw aaiexc;
+ } catch (Exception exc) {
+ logger.warn("deleteGenericVnfData", exc);
+ throw new AAIServiceException(exc);
+ }
+ return response;
+ }
}