blob: 7bd6f98e71da7aff28ee8d2d1073b302c65ca78f [file] [log] [blame]
Gaurav Agrawal8ce6d5c2017-05-03 18:23:00 +05301/*
2 * Copyright 2017-present Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.yang;
18
19import com.google.common.annotations.Beta;
20import org.apache.felix.scr.annotations.Activate;
21import org.apache.felix.scr.annotations.Component;
22import org.apache.felix.scr.annotations.Deactivate;
23import org.apache.felix.scr.annotations.Reference;
24import org.apache.felix.scr.annotations.ReferenceCardinality;
25import org.apache.felix.scr.annotations.Service;
26import org.onosproject.core.CoreService;
27import org.onosproject.yang.compiler.api.YangCompilationParam;
28import org.onosproject.yang.compiler.api.YangCompiledOutput;
29import org.onosproject.yang.compiler.api.YangCompilerException;
30import org.onosproject.yang.compiler.api.YangCompilerService;
31import org.slf4j.Logger;
32import org.slf4j.LoggerFactory;
33
34import java.io.IOException;
35
36/**
37 * Represents implementation of YANG live compiler manager.
38 */
39@Beta
40@Service
41@Component(immediate = true)
42public class YangLiveCompilerManager implements YangCompilerService {
43
44 private static final String APP_ID = "org.onosproject.yang";
45 private final Logger log = LoggerFactory.getLogger(getClass());
46 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
47 protected CoreService coreService;
48 private YangCompilerService compilerService;
49
50 @Activate
51 public void activate() {
52 coreService.registerApplication(APP_ID);
53 // TODO implementation.
54 log.info("Started");
55 }
56
57 @Deactivate
58 public void deactivate() {
59 log.info("Stopped");
60 }
61
62
63 @Override
64 public YangCompiledOutput compileYangFiles(YangCompilationParam param)
65 throws IOException, YangCompilerException {
66 // TODO implementation.
67 return null;
68 }
69}