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.link.NetworkLink; |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 20 | import org.onosproject.tetopology.management.api.link.NetworkLinkKey; |
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.topology.rev20151208.ietfnetworktopology |
| 23 | .networks.network.augmentedndnetwork.Link; |
| 24 | import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708.ietftetopology.TeLinkEvent; |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 25 | |
| 26 | /** |
| 27 | * The conversion functions. |
| 28 | */ |
| 29 | public final class LinkConverter { |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame^] | 30 | private static final String E_NULL_TELINK_UNDERLAY_PATH = |
| 31 | "TeSubsystem link underlayPath object cannot be null"; |
| 32 | private static final String E_NULL_TELINK_DATA = |
| 33 | "TeSubsystem teLinkAttrBuilder data cannot be null"; |
| 34 | private static final String E_NULL_TELINK = |
| 35 | "TeSubsystem teLink object cannot be null"; |
| 36 | private static final String E_NULL_YANG_TELINK_CONFIG = |
| 37 | "YANG telink config object cannot be null"; |
| 38 | private static final String E_NULL_YANG_TELINK = |
| 39 | "YANG Link object cannot be null"; |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 40 | |
| 41 | // no instantiation |
| 42 | private LinkConverter() { |
| 43 | } |
| 44 | |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 45 | |
| 46 | /** |
| 47 | * Link object conversion from YANG to TE Topology subsystem. |
| 48 | * |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame^] | 49 | * @param yangLink YANG link |
| 50 | * @param networkId YANG networkId |
| 51 | * @return TE subsystem link |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 52 | */ |
| 53 | public static org.onosproject.tetopology.management.api.link.NetworkLink |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame^] | 54 | yang2TeSubsystemLink(Link yangLink, NetworkId networkId) { |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 55 | |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame^] | 56 | //TODO: Implementation will be submitted as a separate review |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 57 | |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame^] | 58 | return null; |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 59 | } |
| 60 | |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame^] | 61 | public static Link teSubsystem2YangLink(NetworkLink link) { |
| 62 | |
| 63 | //TODO: Implementation will be submitted as a separate review |
| 64 | |
| 65 | return null; |
| 66 | } |
| 67 | |
| 68 | public static NetworkLinkKey yangLinkEvent2NetworkLinkKey(TeLinkEvent yangLinkEvent) { |
| 69 | |
| 70 | //TODO: Implementation will be submitted as a separate review |
| 71 | |
| 72 | return null; |
| 73 | } |
| 74 | |
| 75 | public static NetworkLink yangLinkEvent2NetworkLink(TeLinkEvent yangLinkEvent, |
| 76 | TeTopologyService teTopologyService) { |
| 77 | |
| 78 | //TODO: Implementation will be submitted as a separate review |
| 79 | |
| 80 | return null; |
| 81 | } |
Yixiao Chen | 39828a6 | 2016-09-14 14:37:06 -0400 | [diff] [blame] | 82 | } |