blob: 74a23672103bfed94d51e330e95c01cb74c46db5 [file] [log] [blame]
cheng fan48e832c2015-05-29 01:54:47 +08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
cheng fan48e832c2015-05-29 01:54:47 +08003 *
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.pcep.api;
17
18import org.onosproject.net.DeviceId;
19
20/**
21 * Abstraction of an PCEP controller. Serves as a one stop shop for obtaining
22 * PCEP devices and (un)register listeners on PCEP events
23 */
24public interface PcepController {
25
26 /**
27 * Returns all switches known to this PCEP controller.
28 *
29 * @return Iterable of did elements
30 */
chengfan373aac52015-08-17 15:36:44 -050031 Iterable<PcepSwitch> getSwitches();
cheng fan48e832c2015-05-29 01:54:47 +080032
33 /**
34 * Return a switch with a specified did.
35 *
36 * @param did of a device
37 * @return a pcep device
38 */
chengfan373aac52015-08-17 15:36:44 -050039 PcepSwitch getSwitch(PcepDpid did);
cheng fan48e832c2015-05-29 01:54:47 +080040
41 /**
42 * Register a listener for meta events that occur to PCEP devices.
43 *
44 * @param listener the listener to notify
45 */
chengfan373aac52015-08-17 15:36:44 -050046 void addListener(PcepSwitchListener listener);
cheng fan48e832c2015-05-29 01:54:47 +080047
48 /**
49 * Unregister a listener.
50 *
51 * @param listener the listener to unregister
52 */
chengfan373aac52015-08-17 15:36:44 -050053 void removeListener(PcepSwitchListener listener);
cheng fan48e832c2015-05-29 01:54:47 +080054
55 /**
56 * Register a listener for meta events that occur to PCEP links.
57 *
58 * @param listener the listener to notify
59 */
chengfan373aac52015-08-17 15:36:44 -050060 void addLinkListener(PcepLinkListener listener);
cheng fan48e832c2015-05-29 01:54:47 +080061
62 /**
63 * Unregister a link listener.
64 *
65 * @param listener the listener to unregister
66 */
chengfan373aac52015-08-17 15:36:44 -050067 void removeLinkListener(PcepLinkListener listener);
cheng fan48e832c2015-05-29 01:54:47 +080068
69 /**
70 * Register a listener for meta events that occur to PCEP tunnel.
71 *
72 * @param listener the listener to notify
73 */
chengfan373aac52015-08-17 15:36:44 -050074 void addTunnelListener(PcepTunnelListener listener);
cheng fan48e832c2015-05-29 01:54:47 +080075
76 /**
77 * Unregister a tunnel listener.
78 *
79 * @param listener the listener to unregister
80 */
chengfan373aac52015-08-17 15:36:44 -050081 void removeTunnelListener(PcepTunnelListener listener);
cheng fan48e832c2015-05-29 01:54:47 +080082
83 /**
84 * Setup a tunnel through pcep controller.
85 *
86 * @param srcDid src deviceId of tunnel
87 * @param dstDid dst deviceId of tunnel
88 * @param srcPort src port
89 * @param dstPort dst port
90 * @param bandwidth andwidth of tunnel
91 * @param name tunnel name
92 * @return pcep tunnel
93 */
chengfan373aac52015-08-17 15:36:44 -050094 PcepTunnel applyTunnel(DeviceId srcDid, DeviceId dstDid,
cheng fan48e832c2015-05-29 01:54:47 +080095 long srcPort, long dstPort, long bandwidth,
96 String name);
97
98 /**
99 * Delete tunnel by id.
100 *
101 * @param id pcep tunnel id.
102 * @return true or false
103 */
chengfan373aac52015-08-17 15:36:44 -0500104 Boolean deleteTunnel(String id);
cheng fan48e832c2015-05-29 01:54:47 +0800105
106 /**
107 * Update tunnel bandwidth by tunnel id.
108 *
109 * @param id tunnel id
110 * @param bandwidth bandwidth of a tunnel
111 * @return true or false
112 */
chengfan373aac52015-08-17 15:36:44 -0500113 Boolean updateTunnelBandwidth(String id, long bandwidth);
cheng fan48e832c2015-05-29 01:54:47 +0800114
chengfan2fff70f2015-08-24 18:20:19 -0500115 /**
116 * Send statistic request by tunnel id.
117 *
118 * @param pcepTunnelId PCEP tunnel id
119 */
120 void getTunnelStatistics(String pcepTunnelId);
121
cheng fan48e832c2015-05-29 01:54:47 +0800122}