2 * Copyright © 2017-2018 AT&T Intellectual Property.
\r
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
\r
5 * in compliance with the License. You may obtain a copy of the License at
\r
7 * http://www.apache.org/licenses/LICENSE-2.0
\r
9 * Unless required by applicable law or agreed to in writing, software distributed under the License
\r
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
\r
11 * or implied. See the License for the specific language governing permissions and limitations under
\r
15 package org.onap.ccsdk.config.assignment.processor;
\r
17 import org.onap.ccsdk.config.data.adaptor.service.ConfigResourceService;
\r
18 import org.onap.ccsdk.config.model.ConfigModelConstant;
\r
19 import org.onap.ccsdk.config.model.service.ComponentNode;
\r
20 import org.onap.ccsdk.config.model.service.ComponentNodeService;
\r
21 import org.onap.ccsdk.config.rest.adaptor.service.ConfigRestAdaptorService;
\r
23 public class ProcessorFactory {
\r
25 private ConfigResourceService configResourceService;
\r
26 private ConfigRestAdaptorService configRestAdaptorService;
\r
27 private ComponentNodeService componentNodeService;
\r
29 public ProcessorFactory(ConfigResourceService configResourceService,
\r
30 ConfigRestAdaptorService configRestAdaptorService, ComponentNodeService componentNodeService) {
\r
31 this.componentNodeService = componentNodeService;
\r
32 this.configResourceService = configResourceService;
\r
33 this.configRestAdaptorService = configRestAdaptorService;
\r
36 public ComponentNode getInstance(String source) {
\r
38 if (ConfigModelConstant.SOURCE_DEFAULT.equalsIgnoreCase(source)) {
\r
39 return new DefaultResourceProcessor(configResourceService);
\r
40 } else if (ConfigModelConstant.SOURCE_DB.equalsIgnoreCase(source)) {
\r
41 return new DBResourceProcessor(configResourceService);
\r
42 } else if (ConfigModelConstant.SOURCE_MDSAL.equalsIgnoreCase(source)) {
\r
43 return new MdsalResourceProcessor(configRestAdaptorService);
\r
46 return new InputResourceProcessor(configResourceService);
\r