Andrea Campanella | e1e3e44 | 2019-10-21 13:45:32 +0200 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 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 | |
| 17 | package org.onosproject.odtn; |
| 18 | |
| 19 | import org.apache.commons.lang3.tuple.Pair; |
| 20 | import org.onosproject.net.ConnectPoint; |
| 21 | import org.onosproject.net.intent.IntentId; |
| 22 | |
| 23 | /** |
| 24 | * Interface for Integration with GNPy optical tool. |
| 25 | */ |
| 26 | public interface GnpyService { |
| 27 | |
| 28 | |
| 29 | /** |
| 30 | * Connectes to an instance of GNPY optical planning and simulation tool. |
| 31 | * |
| 32 | * @param protocol the protocol, eg HTTP or HTTPS |
| 33 | * @param ip the ip of the service |
| 34 | * @param port the port fo the service |
| 35 | * @param username the username of the service |
| 36 | * @param password the password. |
| 37 | * @return true if connection was successful |
| 38 | */ |
| 39 | boolean connectGnpy(String protocol, String ip, String port, String username, String password); |
| 40 | |
| 41 | /** |
| 42 | * Disconnects for the connected GNPy instance. |
| 43 | * |
| 44 | * @return true if successful |
| 45 | */ |
| 46 | boolean disconnectGnpy(); |
| 47 | |
| 48 | /** |
| 49 | * Checks connectivity an instance of GNPY optical planning and simulation tool. |
| 50 | * |
| 51 | * @return true if connection was successful |
| 52 | */ |
| 53 | boolean isConnected(); |
| 54 | |
| 55 | /** |
| 56 | * Obtains the best connectivity from A to B according to GSNR from GNPY, possibly bidirectional. |
| 57 | * |
| 58 | * @param ingress the ingress connect point |
| 59 | * @param egress the egress connect point |
| 60 | * @param bidirectional true if bidirectional connectivity is required. |
| 61 | * @return the Id of the intent that was installed as a result of the computation. |
| 62 | */ |
| 63 | Pair<IntentId, Double> obtainConnectivity(ConnectPoint ingress, ConnectPoint egress, boolean bidirectional); |
| 64 | |
| 65 | |
| 66 | } |