Aharoni, Pavel (pa0916) | ca3cb01 | 2018-10-22 15:29:57 +0300 | [diff] [blame] | 1 | /*-
|
| 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 |
|
| 22 | package org.onap.osam.controllers;
|
| 23 |
|
| 24 | import com.fasterxml.jackson.databind.ObjectMapper;
|
| 25 | import org.onap.portalsdk.core.util.SystemProperties;
|
| 26 |
|
| 27 | import org.onap.osam.client.SyncRestClient;
|
| 28 | import org.onap.osam.factories.MsoRequestFactory;
|
| 29 | import org.onap.osam.mso.MsoBusinessLogic;
|
| 30 | import org.onap.osam.mso.MsoBusinessLogicImpl;
|
| 31 | import org.onap.osam.mso.MsoInterface;
|
| 32 | import org.onap.osam.mso.MsoProperties;
|
| 33 | import org.onap.osam.mso.rest.MsoRestClientNew;
|
| 34 | import org.springframework.context.annotation.Bean;
|
| 35 | import org.springframework.context.annotation.Configuration;
|
| 36 | import org.togglz.core.manager.FeatureManager;
|
| 37 |
|
| 38 |
|
| 39 | @Configuration
|
| 40 | public 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 | }
|