2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
6 * Modifications Copyright (C) 2019 Nokia. All rights reserved.
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
22 package org.onap.vid.aai;
24 import com.fasterxml.jackson.databind.ObjectMapper;
25 import javax.servlet.ServletContext;
26 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
27 import org.onap.vid.model.PombaInstance.PombaRequest;
28 import org.onap.vid.utils.SystemPropertiesWrapper;
29 import org.springframework.beans.factory.annotation.Autowired;
31 public class PombaClientImpl implements PombaClientInterface {
33 protected String fromAppId = "VidAaiController";
34 EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AaiClient.class);
37 ServletContext servletContext;
40 PombaRestInterface pombaRestInterface;
43 SystemPropertiesWrapper systemPropertiesWrapper;
46 public void verify(PombaRequest request) {
47 String methodName = "doAaiPost";
48 logger.debug(EELFLoggerDelegate.debugLogger, methodName + " start");
49 String uri = systemPropertiesWrapper.getProperty("pomba.server.url");
52 pombaRestInterface.RestPost(fromAppId, uri, new ObjectMapper().writeValueAsString(request));
53 } catch (Exception e) {
54 logger.info(EELFLoggerDelegate.errorLogger, methodName, e);
55 logger.debug(EELFLoggerDelegate.debugLogger, methodName, e);