From 5b81764739425ccb4a418947e1565a7f691f4204 Mon Sep 17 00:00:00 2001 From: Patrick Brady Date: Thu, 22 Mar 2018 15:12:48 -0700 Subject: 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 Issue-ID: APPC-403 --- .../org/onap/appc/executor/impl/CommandTask.java | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'appc-dispatcher/appc-command-executor') 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; + } } -- cgit 1.2.3-korg