blob: eeba11ec75aa05ce266b66cc31f24931013cbb3b [file] [log] [blame]
Sean Condonfae8e662016-12-15 10:25:13 +00001/*
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 */
16package org.onosproject.drivers.microsemi.yang.impl;
17
18import org.apache.felix.scr.annotations.Activate;
19import org.apache.felix.scr.annotations.Component;
20import org.apache.felix.scr.annotations.Deactivate;
21import org.apache.felix.scr.annotations.Service;
22import org.onosproject.drivers.microsemi.yang.MseaSaFilteringNetconfService;
23import org.onosproject.netconf.NetconfException;
24import org.onosproject.netconf.NetconfSession;
25import org.onosproject.netconf.TargetConfig;
26import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.MseaSaFiltering;
27import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.MseaSaFilteringOpParam;
28import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.MseaSaFilteringService;
29
30/**
31 * Implementation of the MseaSaFiltering YANG model service.
32 */
33@Component(immediate = true, inherit = true)
34@Service
35public class MseaSaFilteringManager extends AbstractYangServiceImpl
36 implements MseaSaFilteringNetconfService {
37 public static final String MSEA_SA_FILTERING = "org.onosproject.drivers.microsemi.yang.mseasafiltering";
38
39 @Activate
40 public void activate() {
41 appId = coreService.registerApplication(MSEA_SA_FILTERING);
42 ych = ymsService.getYangCodecHandler();
43 ych.addDeviceSchema(MseaSaFilteringService.class);
44 log.info("MseaSaFilteringManager Started");
45 }
46
47 @Deactivate
48 public void deactivate() {
49 super.deactivate();
50 ymsService.unRegisterService(this, MseaSaFilteringService.class);
51 ych = null;
52 log.info("MseaSaFilteringManager Stopped");
53 }
54
55 /**
56 * Get a filtered subset of the model.
57 * This is meant to filter the current live model
58 * against the attribute(s) given in the argument
59 * and return the filtered model.
60 */
61 @Override
62 public MseaSaFiltering getMseaSaFiltering(MseaSaFilteringOpParam mseaSaFilteringFilter, NetconfSession session)
63 throws NetconfException {
64 return (MseaSaFiltering) getNetconfObject(mseaSaFilteringFilter, session);
65 }
66
67 /**
68 * Call NETCONF edit-config with a configuration.
69 */
70 @Override
71 public void setMseaSaFiltering(
72 MseaSaFilteringOpParam mseaSaFiltering, NetconfSession session, TargetConfig ncDs)
73 throws NetconfException {
74 setNetconfObject(mseaSaFiltering, session, ncDs);
75 }
76}