Naoki Shiota | 5a05606 | 2016-05-05 18:43:59 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 0a4e674 | 2016-09-15 23:03:10 -0700 | [diff] [blame^] | 2 | * Copyright 2016-present Open Networking Laboratory |
Naoki Shiota | 5a05606 | 2016-05-05 18:43:59 -0700 | [diff] [blame] | 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.newoptical.api; |
| 17 | |
| 18 | import com.google.common.annotations.Beta; |
| 19 | import org.onlab.util.Bandwidth; |
| 20 | import org.onosproject.event.ListenerService; |
| 21 | import org.onosproject.net.ConnectPoint; |
| 22 | import org.onosproject.net.Link; |
| 23 | import org.onosproject.net.Path; |
| 24 | |
| 25 | import java.time.Duration; |
| 26 | import java.util.List; |
Naoki Shiota | 0d2943e | 2016-05-13 18:53:21 -0700 | [diff] [blame] | 27 | import java.util.Optional; |
Naoki Shiota | 5a05606 | 2016-05-05 18:43:59 -0700 | [diff] [blame] | 28 | |
| 29 | /** |
| 30 | * Service to setup optical domain connectivity. |
| 31 | */ |
| 32 | @Beta |
| 33 | public interface OpticalPathService extends ListenerService<OpticalPathEvent, OpticalPathListener> { |
| 34 | |
| 35 | /** |
Naoki Shiota | 7c3111b | 2016-06-09 16:12:11 -0700 | [diff] [blame] | 36 | * Calculates multi-layer path between connect points and sets up connectivity. |
Naoki Shiota | 5a05606 | 2016-05-05 18:43:59 -0700 | [diff] [blame] | 37 | * |
| 38 | * @param ingress ingress port |
| 39 | * @param egress egress port |
| 40 | * @param bandwidth required bandwidth. No bandwidth is assured if null. |
| 41 | * @param latency required latency. No latency is assured if null. |
| 42 | * @return ID of created connectivity if successful. null otherwise. |
| 43 | */ |
| 44 | OpticalConnectivityId setupConnectivity(ConnectPoint ingress, ConnectPoint egress, |
| 45 | Bandwidth bandwidth, Duration latency); |
| 46 | |
| 47 | /** |
Naoki Shiota | 7c3111b | 2016-06-09 16:12:11 -0700 | [diff] [blame] | 48 | * Sets up connectivity along given multi-layer path including cross-connect links. |
Naoki Shiota | 5a05606 | 2016-05-05 18:43:59 -0700 | [diff] [blame] | 49 | * |
Naoki Shiota | 7c3111b | 2016-06-09 16:12:11 -0700 | [diff] [blame] | 50 | * @param path multi-layer path along which connectivity will be set up |
Naoki Shiota | 5a05606 | 2016-05-05 18:43:59 -0700 | [diff] [blame] | 51 | * @param bandwidth required bandwidth. No bandwidth is assured if null. |
| 52 | * @param latency required latency. No latency is assured if null. |
| 53 | * @return true if successful. false otherwise. |
| 54 | */ |
| 55 | OpticalConnectivityId setupPath(Path path, Bandwidth bandwidth, Duration latency); |
| 56 | |
| 57 | /** |
| 58 | * Removes connectivity with given ID. |
| 59 | * |
| 60 | * @param id ID of connectivity |
| 61 | * @return true if succeed. false if failed. |
| 62 | */ |
| 63 | boolean removeConnectivity(OpticalConnectivityId id); |
| 64 | |
| 65 | /** |
| 66 | * Returns path assigned to given ID. |
| 67 | * @param id ID of connectivity |
Naoki Shiota | 0d2943e | 2016-05-13 18:53:21 -0700 | [diff] [blame] | 68 | * @return list of link that compose a path. empty if ID is invalid. |
Naoki Shiota | 5a05606 | 2016-05-05 18:43:59 -0700 | [diff] [blame] | 69 | */ |
Naoki Shiota | 0d2943e | 2016-05-13 18:53:21 -0700 | [diff] [blame] | 70 | Optional<List<Link>> getPath(OpticalConnectivityId id); |
Naoki Shiota | 5a05606 | 2016-05-05 18:43:59 -0700 | [diff] [blame] | 71 | } |