Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 1 | /* |
Brian O'Connor | ce2a03d | 2017-08-03 19:21:03 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
Sean Condon | fae8e66 | 2016-12-15 10:25:13 +0000 | [diff] [blame] | 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 | package org.onosproject.drivers.microsemi.yang.impl; |
| 17 | |
| 18 | import org.apache.felix.scr.annotations.Activate; |
| 19 | import org.apache.felix.scr.annotations.Component; |
| 20 | import org.apache.felix.scr.annotations.Deactivate; |
| 21 | import org.apache.felix.scr.annotations.Service; |
| 22 | import org.onosproject.drivers.microsemi.yang.MseaSaFilteringNetconfService; |
| 23 | import org.onosproject.netconf.NetconfException; |
| 24 | import org.onosproject.netconf.NetconfSession; |
| 25 | import org.onosproject.netconf.TargetConfig; |
| 26 | import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.MseaSaFiltering; |
| 27 | import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.MseaSaFilteringOpParam; |
| 28 | import 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 |
| 35 | public 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 | } |