blob: 49723f0e603df04c0b71a495edfc7b87a9bee6f3 [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.IetfSystemManager;
22import org.onosproject.yang.gen.v1.http.www.microsemi.com.microsemi.edge.assure.msea.system.rev20160505.IetfSystemMicrosemiService;
23import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.system.rev20140806.IetfSystemService;
24import org.onosproject.yms.app.yab.MockYmsManager;
25
26public class MockIetfSystemManager extends IetfSystemManager {
27
28 @Override
29 public void activate() {
30 try {
31 ymsService = new MockYmsManager();
32 ych = ymsService.getYangCodecHandler();
33 ych.addDeviceSchema(IetfSystemService.class);
34 ych.addDeviceSchema(IetfSystemMicrosemiService.class);
35 } catch (InstantiationException | IllegalAccessException e) {
36 log.error("Failed to load YMS Manager: " + e.getMessage());
37 e.printStackTrace();
38 } catch (IOException e) {
39 log.error("Failed to load YMS Manager: " + e.getMessage());
40 throw new UncheckedIOException(e);
41 }
42 }
43}