blob: 15837c7cf04e81d384ac11f2cd15f5fce4cec018 [file] [log] [blame]
Naoki Shiota5a056062016-05-05 18:43:59 -07001/*
Brian O'Connor0a4e6742016-09-15 23:03:10 -07002 * Copyright 2016-present Open Networking Laboratory
Naoki Shiota5a056062016-05-05 18:43:59 -07003 *
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 */
16package org.onosproject.newoptical.api;
17
18import com.google.common.annotations.Beta;
19import org.onlab.util.Bandwidth;
20import org.onosproject.event.ListenerService;
21import org.onosproject.net.ConnectPoint;
22import org.onosproject.net.Link;
23import org.onosproject.net.Path;
Yuta HIGUCHI8ac05092017-03-15 00:41:22 -070024import org.onosproject.net.intent.Key;
Yuta HIGUCHIf167bf92017-03-08 13:19:04 -080025import org.onosproject.newoptical.OpticalConnectivity;
Naoki Shiota5a056062016-05-05 18:43:59 -070026
27import java.time.Duration;
Yuta HIGUCHIf167bf92017-03-08 13:19:04 -080028import java.util.Collection;
Naoki Shiota5a056062016-05-05 18:43:59 -070029import java.util.List;
Naoki Shiota0d2943e2016-05-13 18:53:21 -070030import java.util.Optional;
Yuta HIGUCHI8ac05092017-03-15 00:41:22 -070031import java.util.Set;
Naoki Shiota5a056062016-05-05 18:43:59 -070032
33/**
34 * Service to setup optical domain connectivity.
35 */
36@Beta
37public interface OpticalPathService extends ListenerService<OpticalPathEvent, OpticalPathListener> {
38
39 /**
Naoki Shiota7c3111b2016-06-09 16:12:11 -070040 * Calculates multi-layer path between connect points and sets up connectivity.
Naoki Shiota5a056062016-05-05 18:43:59 -070041 *
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.
46 * @return ID of created connectivity if successful. null otherwise.
47 */
48 OpticalConnectivityId setupConnectivity(ConnectPoint ingress, ConnectPoint egress,
49 Bandwidth bandwidth, Duration latency);
50
51 /**
Naoki Shiota7c3111b2016-06-09 16:12:11 -070052 * Sets up connectivity along given multi-layer path including cross-connect links.
Naoki Shiota5a056062016-05-05 18:43:59 -070053 *
Naoki Shiota7c3111b2016-06-09 16:12:11 -070054 * @param path multi-layer path along which connectivity will be set up
Naoki Shiota5a056062016-05-05 18:43:59 -070055 * @param bandwidth required bandwidth. No bandwidth is assured if null.
56 * @param latency required latency. No latency is assured if null.
57 * @return true if successful. false otherwise.
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 Shiota0d2943e2016-05-13 18:53:21 -070072 * @return list of link that compose a path. empty if ID is invalid.
Naoki Shiota5a056062016-05-05 18:43:59 -070073 */
Naoki Shiota0d2943e2016-05-13 18:53:21 -070074 Optional<List<Link>> getPath(OpticalConnectivityId id);
Yuta HIGUCHIf167bf92017-03-08 13:19:04 -080075
76 /**
77 * Lists collection of known OpticalConnectivity.
78 *
79 * @return collection of OpticalConnectivity
80 */
81 Collection<OpticalConnectivity> listConnectivity();
Yuta HIGUCHI8ac05092017-03-15 00:41:22 -070082
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 Shiota5a056062016-05-05 18:43:59 -070091}