blob: 60aae90dc8304c5066a392df7afbe9e7cc294a78 [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;
17
18import java.io.IOException;
19import java.io.UncheckedIOException;
20
21import org.onosproject.drivers.microsemi.yang.impl.MseaSaFilteringManager;
22import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.sa.filtering.rev20160412.MseaSaFilteringService;
23import org.onosproject.yms.app.yab.MockYmsManager;
24
25public class MockMseaSaFilteringManager extends MseaSaFilteringManager {
26
27 @Override
28 public void activate() {
29 try {
30 ymsService = new MockYmsManager();
31 ych = ymsService.getYangCodecHandler();
32 ych.addDeviceSchema(MseaSaFilteringService.class);
33 } catch (InstantiationException | IllegalAccessException e) {
34 log.error("Failed to load YMS Manager: " + e.getMessage());
35 e.printStackTrace();
36 } catch (IOException e) {
37 log.error("Failed to load YMS Manager: " + e.getMessage());
38 throw new UncheckedIOException(e);
39 }
40 }
41}