blob: fd19f0ee4aa7157c7f0a92597cf49ee158f2b5e7 [file] [log] [blame]
Aharoni, Pavel (pa0916)ca3cb012018-10-22 15:29:57 +03001/*-
2 * ============LICENSE_START=======================================================
3 * OSAM
4 * ================================================================================
5 * Copyright (C) 2018 AT&T
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
19 */
20
21
22package org.onap.osam.controllers;
23
24import com.fasterxml.jackson.databind.ObjectMapper;
25import org.onap.portalsdk.core.util.SystemProperties;
26
27import org.onap.osam.client.SyncRestClient;
28import org.onap.osam.factories.MsoRequestFactory;
29import org.onap.osam.mso.MsoBusinessLogic;
30import org.onap.osam.mso.MsoBusinessLogicImpl;
31import org.onap.osam.mso.MsoInterface;
32import org.onap.osam.mso.MsoProperties;
33import org.onap.osam.mso.rest.MsoRestClientNew;
34import org.springframework.context.annotation.Bean;
35import org.springframework.context.annotation.Configuration;
36import org.togglz.core.manager.FeatureManager;
37
38
39@Configuration
40public class MsoConfig {
41
42 @Bean
43 public ObjectMapper getObjectMapper() {
44 return new ObjectMapper();
45 }
46
47 @Bean
48 public MsoRequestFactory createRequestDetailsFactory(){
49 return new MsoRequestFactory();
50 }
51
52 @Bean
53 public MsoInterface getMsoClient(){
54 return new MsoRestClientNew(new SyncRestClient(MsoInterface.objectMapper()), SystemProperties.getProperty(
55 MsoProperties.MSO_SERVER_URL));
56 }
57
58 @Bean
59 public MsoBusinessLogic getMsoBusinessLogic(MsoInterface msoClient, FeatureManager featureManager){
60 return new MsoBusinessLogicImpl(msoClient, featureManager);
61 }
62
63
64}