blob: 73fddbf9c578bef09dbac1d9d1039cffabcd91a2 [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 overridden YANG data tree codec interfaces.
27 */
28public class MockOverriddenDataTreeCodec implements YangDataTreeCodec {
29 private static final String PREFIX = "OverriddenDataTreeCodec ";
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
42 throw new YchException(ENCODE);
43 }
44
45 @Override
46 public YangCompositeEncoding encodeYdtToCompositeProtocolFormat(
47 YdtBuilder ydtBuilder) {
48
49 throw new YchException(COMPOSITE_ENCODE);
50 }
51
52 @Override
53 public YdtBuilder decodeProtocolDataToYdt(String protocolData,
54 Object schemaRegistryForYdt,
55 YmsOperationType proOper) {
56
57 throw new YchException(DECODE);
58 }
59
60 @Override
61 public YdtBuilder decodeCompositeProtocolDataToYdt(
62 YangCompositeEncoding protocolData,
63 Object schemaRegistryForYdt,
64 YmsOperationType proOper) {
65
66 throw new YchException(COMPOSITE_DECODE);
67 }
68}