2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * Modifications Copyright (C) 2018 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=========================================================
21 package org.onap.vid.controllers;
23 import com.fasterxml.jackson.databind.ObjectMapper;
24 import org.onap.portalsdk.core.util.SystemProperties;
26 import org.onap.vid.client.SyncRestClient;
27 import org.onap.vid.factories.MsoRequestFactory;
28 import org.onap.vid.mso.MsoBusinessLogic;
29 import org.onap.vid.mso.MsoBusinessLogicImpl;
30 import org.onap.vid.mso.MsoInterface;
31 import org.onap.vid.mso.MsoProperties;
32 import org.onap.vid.mso.rest.MsoRestClientNew;
33 import org.springframework.context.annotation.Bean;
34 import org.springframework.context.annotation.Configuration;
35 import org.togglz.core.manager.FeatureManager;
39 public class MsoConfig {
42 * Gets the object mapper.
44 * @return the object mapper
47 public ObjectMapper getObjectMapper() {
48 return new ObjectMapper();
52 public MsoRequestFactory createRequestDetailsFactory(){
53 return new MsoRequestFactory();
57 public MsoInterface getMsoClient(){
58 return new MsoRestClientNew(new SyncRestClient(MsoInterface.objectMapper()), SystemProperties.getProperty(
59 MsoProperties.MSO_SERVER_URL));
63 public MsoBusinessLogic getMsoBusinessLogic(MsoInterface msoClient, FeatureManager featureManager){
64 return new MsoBusinessLogicImpl(msoClient, featureManager);