blob: 4e952246ecc8d4600735775bb94ac18fa30d5233 [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 HIGUCHIf167bf92017-03-08 13:19:04 -080024import org.onosproject.newoptical.OpticalConnectivity;
Naoki Shiota5a056062016-05-05 18:43:59 -070025
26import java.time.Duration;
Yuta HIGUCHIf167bf92017-03-08 13:19:04 -080027import java.util.Collection;
Naoki Shiota5a056062016-05-05 18:43:59 -070028import java.util.List;
Naoki Shiota0d2943e2016-05-13 18:53:21 -070029import java.util.Optional;
Naoki Shiota5a056062016-05-05 18:43:59 -070030
31/**
32 * Service to setup optical domain connectivity.
33 */
34@Beta
35public interface OpticalPathService extends ListenerService<OpticalPathEvent, OpticalPathListener> {
36
37 /**
Naoki Shiota7c3111b2016-06-09 16:12:11 -070038 * Calculates multi-layer path between connect points and sets up connectivity.
Naoki Shiota5a056062016-05-05 18:43:59 -070039 *
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 Shiota7c3111b2016-06-09 16:12:11 -070050 * Sets up connectivity along given multi-layer path including cross-connect links.
Naoki Shiota5a056062016-05-05 18:43:59 -070051 *
Naoki Shiota7c3111b2016-06-09 16:12:11 -070052 * @param path multi-layer path along which connectivity will be set up
Naoki Shiota5a056062016-05-05 18:43:59 -070053 * @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 Shiota0d2943e2016-05-13 18:53:21 -070070 * @return list of link that compose a path. empty if ID is invalid.
Naoki Shiota5a056062016-05-05 18:43:59 -070071 */
Naoki Shiota0d2943e2016-05-13 18:53:21 -070072 Optional<List<Link>> getPath(OpticalConnectivityId id);
Yuta HIGUCHIf167bf92017-03-08 13:19:04 -080073
74 /**
75 * Lists collection of known OpticalConnectivity.
76 *
77 * @return collection of OpticalConnectivity
78 */
79 Collection<OpticalConnectivity> listConnectivity();
Naoki Shiota5a056062016-05-05 18:43:59 -070080}