From 25628c56e5fc6b1d6e2e3b761f435fc9596ce1b3 Mon Sep 17 00:00:00 2001 From: Daniel Cruz Date: Wed, 23 Oct 2019 18:18:07 -0500 Subject: Update APPC LCM Model references Updates to all references of APPC LCM model code based on changes in policy models for APPC LCM. Issue-ID: POLICY-2043 Change-Id: I0102eb27f449578636cfc0bf22124fa863f05724 Signed-off-by: Daniel Cruz --- .../eventmanager/ControlLoopOperationManager.java | 10 +++++----- .../policy/drools/impl/PolicyEngineJUnitImpl.java | 22 +++++++++++----------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'controlloop/common/eventmanager/src/main') diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java index 62bd0c1e9..87e76c34f 100644 --- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java +++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java @@ -45,7 +45,7 @@ import org.onap.policy.aai.AaiCqResponse; import org.onap.policy.aai.util.AaiException; import org.onap.policy.appc.Response; import org.onap.policy.appc.ResponseCode; -import org.onap.policy.appclcm.LcmResponseWrapper; +import org.onap.policy.appclcm.AppcLcmDmaapWrapper; import org.onap.policy.cds.CdsResponse; import org.onap.policy.controlloop.ControlLoopEvent; import org.onap.policy.controlloop.ControlLoopException; @@ -507,11 +507,11 @@ public class ControlLoopOperationManager implements Serializable { // Cast APPC response and handle it // return onResponse((Response) response); - } else if (response instanceof LcmResponseWrapper) { + } else if (response instanceof AppcLcmDmaapWrapper) { // // Cast LCM response and handle it // - return onResponse((LcmResponseWrapper) response); + return onResponse(( AppcLcmDmaapWrapper) response); } else if (response instanceof PciResponseWrapper) { // // Cast SDNR response and handle it @@ -633,12 +633,12 @@ public class ControlLoopOperationManager implements Serializable { * @param dmaapResponse the LCM response * @return The result of the response handling */ - private PolicyResult onResponse(LcmResponseWrapper dmaapResponse) { + private PolicyResult onResponse(AppcLcmDmaapWrapper dmaapResponse) { /* * Parse out the operation attempt using the subrequestid */ Integer operationAttempt = AppcLcmActorServiceProvider - .parseOperationAttempt(dmaapResponse.getBody().getCommonHeader().getSubRequestId()); + .parseOperationAttempt(dmaapResponse.getBody().getOutput().getCommonHeader().getSubRequestId()); if (operationAttempt == null) { this.completeOperation(operationAttempt, "Policy was unable to parse APP-C SubRequestID (it was null).", PolicyResult.FAILURE_EXCEPTION); diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/drools/impl/PolicyEngineJUnitImpl.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/drools/impl/PolicyEngineJUnitImpl.java index 773299dc2..6a3be2d6a 100644 --- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/drools/impl/PolicyEngineJUnitImpl.java +++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/drools/impl/PolicyEngineJUnitImpl.java @@ -2,14 +2,14 @@ * ============LICENSE_START======================================================= * policy engine * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * 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 - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,7 +28,7 @@ import java.util.Map; import java.util.Queue; import org.onap.policy.appc.Request; -import org.onap.policy.appclcm.LcmRequestWrapper; +import org.onap.policy.appclcm.AppcLcmDmaapWrapper; import org.onap.policy.controlloop.ControlLoopNotification; import org.onap.policy.controlloop.util.Serialization; import org.onap.policy.drools.PolicyEngine; @@ -45,7 +45,7 @@ public class PolicyEngineJUnitImpl implements PolicyEngine { /** * Adds all objects that implement PolicyEngineListener to the notification list when an event * occurs. - * + * * @param listener an object that is interest in knowing about events published to the * PolicyEngine */ @@ -55,7 +55,7 @@ public class PolicyEngineJUnitImpl implements PolicyEngine { /** * Notifies all listeners about a new event. - * + * * @param topic the topic in which the notification was sent to */ public void notifyListeners(String topic) { @@ -75,10 +75,10 @@ public class PolicyEngineJUnitImpl implements PolicyEngine { if (obj instanceof Request) { Request request = (Request) obj; logger.debug("Request: {} subrequest {}", request.getAction(), request.getCommonHeader().getSubRequestId()); - } else if (obj instanceof LcmRequestWrapper) { - LcmRequestWrapper dmaapRequest = (LcmRequestWrapper) obj; - logger.debug("Request: {} subrequest {}", dmaapRequest.getBody().getAction(), - dmaapRequest.getBody().getCommonHeader().getSubRequestId()); + } else if (obj instanceof AppcLcmDmaapWrapper) { + AppcLcmDmaapWrapper dmaapRequest = (AppcLcmDmaapWrapper) obj; + logger.debug("Request: {} subrequest {}", dmaapRequest.getBody().getInput().getAction(), + dmaapRequest.getBody().getInput().getCommonHeader().getSubRequestId()); } // // Does the bus exist? @@ -115,7 +115,7 @@ public class PolicyEngineJUnitImpl implements PolicyEngine { /** * Subscribe to a topic on a bus. - * + * * @param busType the bus type * @param topic the topic * @return the head of the queue, or null if the queue or bus does not exist or the -- cgit 1.2.3-korg