Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package org.onosproject.teyang.utils.topology; |
| 17 | |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame^] | 18 | import org.onosproject.tetopology.management.api.TeTopologyService; |
| 19 | import org.onosproject.tetopology.management.api.node.NetworkNode; |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 20 | import org.onosproject.tetopology.management.api.node.NetworkNodeKey; |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 21 | import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208.ietfnetwork.NetworkId; |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame^] | 22 | import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208.ietfnetwork.networks.network |
| 23 | .Node; |
| 24 | import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708.ietftetopology.TeNodeEvent; |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 25 | |
| 26 | /** |
| 27 | * Node conversion functions. |
| 28 | */ |
| 29 | public final class NodeConverter { |
| 30 | |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame^] | 31 | 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 Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 39 | |
| 40 | // no instantiation |
| 41 | private NodeConverter() { |
| 42 | } |
| 43 | |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 44 | |
| 45 | /** |
| 46 | * Node object conversion from TE Topology subsystem to YANG. |
| 47 | * |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame^] | 48 | * @param teSubsystem TE subsystem node |
| 49 | * @return YANG node |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 50 | */ |
| 51 | public static Node teSubsystem2YangNode(org.onosproject.tetopology.management.api.node.NetworkNode teSubsystem) { |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame^] | 52 | //TODO: implementation to be submitted as a separate review |
| 53 | return null; |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | /** |
| 57 | * Node object conversion from YANG to TE Topology subsystem. |
| 58 | * |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame^] | 59 | * @param yangNode Network node in YANG model |
| 60 | * @param yangNetworkId YANG network identifier in YANG model |
| 61 | * @return TE subsystem node |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 62 | */ |
| 63 | public static org.onosproject.tetopology.management.api.node.NetworkNode |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame^] | 64 | yang2TeSubsystemNode(Node yangNode, NetworkId yangNetworkId) { |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 65 | |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame^] | 66 | //TODO: implementation to be submitted as separate review |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 67 | |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame^] | 68 | return null; |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 69 | } |
| 70 | |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame^] | 71 | public static NetworkNodeKey yangNodeEvent2NetworkNodeKey(TeNodeEvent yangNodeEvent) { |
| 72 | |
| 73 | //TODO: implementation to be submitted as separate review |
| 74 | |
| 75 | return null; |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 76 | } |
| 77 | |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame^] | 78 | public static NetworkNode yangNodeEvent2NetworkNode(TeNodeEvent yangNodeEvent, |
| 79 | TeTopologyService teTopologyService) { |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 80 | |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame^] | 81 | //TODO: implementation to be submitted as separate review |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 82 | |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 83 | return null; |
| 84 | } |
| 85 | } |