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; |
Yuta HIGUCHI | f167bf9 | 2017-03-08 13:19:04 -0800 | [diff] [blame^] | 24 | import org.onosproject.newoptical.OpticalConnectivity; |
Naoki Shiota | 5a05606 | 2016-05-05 18:43:59 -0700 | [diff] [blame] | 25 | |
| 26 | import java.time.Duration; |
Yuta HIGUCHI | f167bf9 | 2017-03-08 13:19:04 -0800 | [diff] [blame^] | 27 | import java.util.Collection; |
Naoki Shiota | 5a05606 | 2016-05-05 18:43:59 -0700 | [diff] [blame] | 28 | import java.util.List; |
Naoki Shiota | 0d2943e | 2016-05-13 18:53:21 -0700 | [diff] [blame] | 29 | import java.util.Optional; |
Naoki Shiota | 5a05606 | 2016-05-05 18:43:59 -0700 | [diff] [blame] | 30 | |
| 31 | /** |
| 32 | * Service to setup optical domain connectivity. |
| 33 | */ |
| 34 | @Beta |
| 35 | public interface OpticalPathService extends ListenerService<OpticalPathEvent, OpticalPathListener> { |
| 36 | |
| 37 | /** |
Naoki Shiota | 7c3111b | 2016-06-09 16:12:11 -0700 | [diff] [blame] | 38 | * Calculates multi-layer path between connect points and sets up connectivity. |
Naoki Shiota | 5a05606 | 2016-05-05 18:43:59 -0700 | [diff] [blame] | 39 | * |
| 40 | * @param ingress ingress port |
| 41 | * @param egress egress port |
| 42 | * @param bandwidth required bandwidth. No bandwidth is assured if null. |
| 43 | * @param latency required latency. No latency is assured if null. |
| 44 | * @return ID of created connectivity if successful. null otherwise. |
| 45 | */ |
| 46 | OpticalConnectivityId setupConnectivity(ConnectPoint ingress, ConnectPoint egress, |
| 47 | Bandwidth bandwidth, Duration latency); |
| 48 | |
| 49 | /** |
Naoki Shiota | 7c3111b | 2016-06-09 16:12:11 -0700 | [diff] [blame] | 50 | * Sets up connectivity along given multi-layer path including cross-connect links. |
Naoki Shiota | 5a05606 | 2016-05-05 18:43:59 -0700 | [diff] [blame] | 51 | * |
Naoki Shiota | 7c3111b | 2016-06-09 16:12:11 -0700 | [diff] [blame] | 52 | * @param path multi-layer path along which connectivity will be set up |
Naoki Shiota | 5a05606 | 2016-05-05 18:43:59 -0700 | [diff] [blame] | 53 | * @param bandwidth required bandwidth. No bandwidth is assured if null. |
| 54 | * @param latency required latency. No latency is assured if null. |
| 55 | * @return true if successful. false otherwise. |
| 56 | */ |
| 57 | OpticalConnectivityId setupPath(Path path, Bandwidth bandwidth, Duration latency); |
| 58 | |
| 59 | /** |
| 60 | * Removes connectivity with given ID. |
| 61 | * |
| 62 | * @param id ID of connectivity |
| 63 | * @return true if succeed. false if failed. |
| 64 | */ |
| 65 | boolean removeConnectivity(OpticalConnectivityId id); |
| 66 | |
| 67 | /** |
| 68 | * Returns path assigned to given ID. |
| 69 | * @param id ID of connectivity |
Naoki Shiota | 0d2943e | 2016-05-13 18:53:21 -0700 | [diff] [blame] | 70 | * @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] | 71 | */ |
Naoki Shiota | 0d2943e | 2016-05-13 18:53:21 -0700 | [diff] [blame] | 72 | Optional<List<Link>> getPath(OpticalConnectivityId id); |
Yuta HIGUCHI | f167bf9 | 2017-03-08 13:19:04 -0800 | [diff] [blame^] | 73 | |
| 74 | /** |
| 75 | * Lists collection of known OpticalConnectivity. |
| 76 | * |
| 77 | * @return collection of OpticalConnectivity |
| 78 | */ |
| 79 | Collection<OpticalConnectivity> listConnectivity(); |
Naoki Shiota | 5a05606 | 2016-05-05 18:43:59 -0700 | [diff] [blame] | 80 | } |