blob: b0daeee425d5377ef02d380ab514f78cdff79653 [file] [log] [blame]
Yixiao Chen39828a62016-09-14 14:37:06 -04001/*
2 * Copyright 2016 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.teyang.utils.topology;
17
Henry Yu4b4a7eb2016-11-09 20:07:53 -050018import org.onosproject.tetopology.management.api.TeTopologyService;
19import org.onosproject.tetopology.management.api.node.NetworkNode;
Yixiao Chen39828a62016-09-14 14:37:06 -040020import org.onosproject.tetopology.management.api.node.NetworkNodeKey;
Yixiao Chen39828a62016-09-14 14:37:06 -040021import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208.ietfnetwork.NetworkId;
Henry Yu4b4a7eb2016-11-09 20:07:53 -050022import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208.ietfnetwork.networks.network
23 .Node;
24import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708.ietftetopology.TeNodeEvent;
Yixiao Chen39828a62016-09-14 14:37:06 -040025
26/**
27 * Node conversion functions.
28 */
29public final class NodeConverter {
30
Henry Yu4b4a7eb2016-11-09 20:07:53 -050031 private static final String E_NULL_TE_SUBSYSTEM_TE_NODE =
32 "TeSubsystem teNode object cannot be null";
33 private static final String E_NULL_TE_SUBSYSTEM_TE_TUNNEL_TP =
34 "TeSubsystem teTunnelTp object cannot be null";
35 private static final String E_NULL_TE_SUBSYSTEM_NODE =
36 "TeSubsystem ndoe object cannot be null";
37 private static final String E_NULL_YANG_NODE =
38 "Yang node object cannot be null";
Yixiao Chen39828a62016-09-14 14:37:06 -040039
40 // no instantiation
41 private NodeConverter() {
42 }
43
Yixiao Chen39828a62016-09-14 14:37:06 -040044
45 /**
46 * Node object conversion from TE Topology subsystem to YANG.
47 *
Henry Yu4b4a7eb2016-11-09 20:07:53 -050048 * @param teSubsystem TE subsystem node
49 * @return YANG node
Yixiao Chen39828a62016-09-14 14:37:06 -040050 */
51 public static Node teSubsystem2YangNode(org.onosproject.tetopology.management.api.node.NetworkNode teSubsystem) {
Henry Yu4b4a7eb2016-11-09 20:07:53 -050052 //TODO: implementation to be submitted as a separate review
53 return null;
Yixiao Chen39828a62016-09-14 14:37:06 -040054 }
55
56 /**
57 * Node object conversion from YANG to TE Topology subsystem.
58 *
Henry Yu4b4a7eb2016-11-09 20:07:53 -050059 * @param yangNode Network node in YANG model
60 * @param yangNetworkId YANG network identifier in YANG model
61 * @return TE subsystem node
Yixiao Chen39828a62016-09-14 14:37:06 -040062 */
63 public static org.onosproject.tetopology.management.api.node.NetworkNode
Henry Yu4b4a7eb2016-11-09 20:07:53 -050064 yang2TeSubsystemNode(Node yangNode, NetworkId yangNetworkId) {
Yixiao Chen39828a62016-09-14 14:37:06 -040065
Henry Yu4b4a7eb2016-11-09 20:07:53 -050066 //TODO: implementation to be submitted as separate review
Yixiao Chen39828a62016-09-14 14:37:06 -040067
Henry Yu4b4a7eb2016-11-09 20:07:53 -050068 return null;
Yixiao Chen39828a62016-09-14 14:37:06 -040069 }
70
Henry Yu4b4a7eb2016-11-09 20:07:53 -050071 public static NetworkNodeKey yangNodeEvent2NetworkNodeKey(TeNodeEvent yangNodeEvent) {
72
73 //TODO: implementation to be submitted as separate review
74
75 return null;
Yixiao Chen39828a62016-09-14 14:37:06 -040076 }
77
Henry Yu4b4a7eb2016-11-09 20:07:53 -050078 public static NetworkNode yangNodeEvent2NetworkNode(TeNodeEvent yangNodeEvent,
79 TeTopologyService teTopologyService) {
Yixiao Chen39828a62016-09-14 14:37:06 -040080
Henry Yu4b4a7eb2016-11-09 20:07:53 -050081 //TODO: implementation to be submitted as separate review
Yixiao Chen39828a62016-09-14 14:37:06 -040082
Yixiao Chen39828a62016-09-14 14:37:06 -040083 return null;
84 }
85}