blob: 84117e7a91675c0241df4511ac9cfc06ea440e75 [file] [log] [blame]
Shankara-Huaweid5823ab2016-11-22 10:14:52 +05301/*
2 * Copyright 2016-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.yms.app.ymsm;
18
19import org.onosproject.yms.app.ych.YchException;
20import org.onosproject.yms.ych.YangCompositeEncoding;
21import org.onosproject.yms.ych.YangDataTreeCodec;
22import org.onosproject.yms.ydt.YdtBuilder;
23import org.onosproject.yms.ydt.YmsOperationType;
24
25/**
26 * Represents implementation of YANG SBI broker interfaces.
27 */
28public class MockRegisteredDataTreeCodec implements YangDataTreeCodec {
29 private static final String PREFIX = "RegisteredDataTreeCodec ";
30 private static final String ENCODE = PREFIX +
31 "encodeYdtToProtocolFormat Called.";
32 private static final String COMPOSITE_ENCODE = PREFIX +
33 "encodeYdtToCompositeProtocolFormat Called.";
34 private static final String DECODE = PREFIX +
35 "decodeProtocolDataToYdt Called.";
36 private static final String COMPOSITE_DECODE = PREFIX +
37 "decodeCompositeProtocolDataToYdt Called.";
38
39 @Override
40 public String encodeYdtToProtocolFormat(YdtBuilder ydtBuilder) {
41 throw new YchException(ENCODE);
42 }
43
44 @Override
45 public YangCompositeEncoding encodeYdtToCompositeProtocolFormat(
46 YdtBuilder ydtBuilder) {
47
48 throw new YchException(COMPOSITE_ENCODE);
49 }
50
51 @Override
52 public YdtBuilder decodeProtocolDataToYdt(String protocolData,
53 Object schemaRegistry,
54 YmsOperationType proOper) {
55
56 throw new YchException(DECODE);
57 }
58
59 @Override
60 public YdtBuilder decodeCompositeProtocolDataToYdt(
61 YangCompositeEncoding protocolData,
62 Object schemaRegistry,
63 YmsOperationType proOper) {
64
65 throw new YchException(COMPOSITE_DECODE);
66 }
67}