blob: e6df0cba98c5ebc370b8a38bb0cff3a6fabf18cf [file] [log] [blame]
Naoki Shiota5a056062016-05-05 18:43:59 -07001/*
2 * Copyright 2016 Open Networking Laboratory
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 */
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;
27
28/**
29 * Service to setup optical domain connectivity.
30 */
31@Beta
32public interface OpticalPathService extends ListenerService<OpticalPathEvent, OpticalPathListener> {
33
34 /**
35 * Calculates optical path between connect points and sets up connectivity.
36 *
37 * @param ingress ingress port
38 * @param egress egress port
39 * @param bandwidth required bandwidth. No bandwidth is assured if null.
40 * @param latency required latency. No latency is assured if null.
41 * @return ID of created connectivity if successful. null otherwise.
42 */
43 OpticalConnectivityId setupConnectivity(ConnectPoint ingress, ConnectPoint egress,
44 Bandwidth bandwidth, Duration latency);
45
46 /**
47 * Sets up connectivity along given optical path.
48 *
49 * @param path path along which connectivity will be set up
50 * @param bandwidth required bandwidth. No bandwidth is assured if null.
51 * @param latency required latency. No latency is assured if null.
52 * @return true if successful. false otherwise.
53 */
54 OpticalConnectivityId setupPath(Path path, Bandwidth bandwidth, Duration latency);
55
56 /**
57 * Removes connectivity with given ID.
58 *
59 * @param id ID of connectivity
60 * @return true if succeed. false if failed.
61 */
62 boolean removeConnectivity(OpticalConnectivityId id);
63
64 /**
65 * Returns path assigned to given ID.
66 * @param id ID of connectivity
67 * @return list of link that compose a path. null if ID is invalid.
68 */
69 List<Link> getPath(OpticalConnectivityId id);
70}