blob: c28841b59f3ea04a054b3d11c75809b8c5841ef2 [file] [log] [blame]
cheng fan48e832c2015-05-29 01:54:47 +08001/*
2 * Copyright 2015 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.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 */
31 public Iterable<PcepSwitch> getSwitches();
32
33 /**
34 * Return a switch with a specified did.
35 *
36 * @param did of a device
37 * @return a pcep device
38 */
39 public PcepSwitch getSwitch(PcepDpid did);
40
41 /**
42 * Register a listener for meta events that occur to PCEP devices.
43 *
44 * @param listener the listener to notify
45 */
46 public void addListener(PcepSwitchListener listener);
47
48 /**
49 * Unregister a listener.
50 *
51 * @param listener the listener to unregister
52 */
53 public void removeListener(PcepSwitchListener listener);
54
55 /**
56 * Register a listener for meta events that occur to PCEP links.
57 *
58 * @param listener the listener to notify
59 */
60 public void addLinkListener(PcepLinkListener listener);
61
62 /**
63 * Unregister a link listener.
64 *
65 * @param listener the listener to unregister
66 */
67 public void removeLinkListener(PcepLinkListener listener);
68
69 /**
70 * Register a listener for meta events that occur to PCEP tunnel.
71 *
72 * @param listener the listener to notify
73 */
74 public void addTunnelListener(PcepTunnelListener listener);
75
76 /**
77 * Unregister a tunnel listener.
78 *
79 * @param listener the listener to unregister
80 */
81 public void removeTunnelListener(PcepTunnelListener listener);
82
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 */
94 public PcepTunnel applyTunnel(DeviceId srcDid, DeviceId dstDid,
95 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 */
104 public Boolean deleteTunnel(String id);
105
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 */
113 public Boolean updateTunnelBandwidth(String id, long bandwidth);
114
115}