blob: 8da5d5402f311e35c7c25985a36127ebe273225a [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;
24
25import java.time.Duration;
26import java.util.List;
Naoki Shiota0d2943e2016-05-13 18:53:21 -070027import java.util.Optional;
Naoki Shiota5a056062016-05-05 18:43:59 -070028
29/**
30 * Service to setup optical domain connectivity.
31 */
32@Beta
33public interface OpticalPathService extends ListenerService<OpticalPathEvent, OpticalPathListener> {
34
35 /**
Naoki Shiota7c3111b2016-06-09 16:12:11 -070036 * Calculates multi-layer path between connect points and sets up connectivity.
Naoki Shiota5a056062016-05-05 18:43:59 -070037 *
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 Shiota7c3111b2016-06-09 16:12:11 -070048 * Sets up connectivity along given multi-layer path including cross-connect links.
Naoki Shiota5a056062016-05-05 18:43:59 -070049 *
Naoki Shiota7c3111b2016-06-09 16:12:11 -070050 * @param path multi-layer path along which connectivity will be set up
Naoki Shiota5a056062016-05-05 18:43:59 -070051 * @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 Shiota0d2943e2016-05-13 18:53:21 -070068 * @return list of link that compose a path. empty if ID is invalid.
Naoki Shiota5a056062016-05-05 18:43:59 -070069 */
Naoki Shiota0d2943e2016-05-13 18:53:21 -070070 Optional<List<Link>> getPath(OpticalConnectivityId id);
Naoki Shiota5a056062016-05-05 18:43:59 -070071}