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