blob: 3b060fced3c1da7339a2ff463190d6bef43e876f [file] [log] [blame]
wei wei89ddc322015-03-22 16:29:04 -05001/*
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.net.tunnel;
17
18import java.util.Collection;
19
20import org.onosproject.net.ConnectPoint;
21import org.onosproject.net.Path;
Sho SHIMIZU63feca72015-05-07 10:44:25 -070022import org.onosproject.net.resource.BandwidthResource;
wei wei89ddc322015-03-22 16:29:04 -050023
24/**
25 * Service for interacting with the tunnel inventory.
26 */
27public interface TunnelService {
28
29 /**
30 * Invokes the core to create a tunnel based on specified parameters.
31 *
32 * @param src sourcePoint
33 * @param dst destinationPoint
34 * @param bw bandwidth
35 * @param path explicit path or null
36 */
Sho SHIMIZU63feca72015-05-07 10:44:25 -070037 void requestTunnel(ConnectPoint src, ConnectPoint dst, BandwidthResource bw, Path path);
wei wei89ddc322015-03-22 16:29:04 -050038
39 /**
40 * Invokes the core to create a tunnel based on specified parameters with a tunnel type.
41 *
42 * @param src sourcePoint
43 * @param dst destinationPoint
44 * @param type tunnelType
45 * @param bw bandwidth
46 * @param path explicit path or null
47 */
Sho SHIMIZU63feca72015-05-07 10:44:25 -070048 void requestTunnel(ConnectPoint src, ConnectPoint dst, Tunnel.Type type, BandwidthResource bw, Path path);
wei wei89ddc322015-03-22 16:29:04 -050049
50 /**
51 * Returns the count of all known tunnels in the dataStore.
52 *
53 * @return number of tunnels
54 */
55 int getTunnelCount();
56
57 /**
58 * Returns a collection of all known tunnel based on the type.
59 *
wei weia6681222015-04-21 14:58:22 -050060 *@param type tunnelType
wei wei89ddc322015-03-22 16:29:04 -050061 * @return all tunnels for a specific type
62 */
63 Collection<Tunnel> getTunnels(Tunnel.Type type);
64
65 /**
wei weia6681222015-04-21 14:58:22 -050066 * Returns set of all tunnels from the specified connectpoint.
wei wei89ddc322015-03-22 16:29:04 -050067 *
wei weia6681222015-04-21 14:58:22 -050068 * @param connectPoint device/portnumber
69 * @param type tunnelType
wei wei89ddc322015-03-22 16:29:04 -050070 * @return set of tunnels
71 */
72 Collection<Tunnel> getTunnels(ConnectPoint connectPoint, Tunnel.Type type);
73
74 /**
75 * Returns set of all tunnels from the
76 * specified source connectpoint and destination connectpoint.
77 *
78 * @param src sourcePoint
79 * @param dst destinationPoint
80 * @param type tunnel type
81 * @return set of tunnels
82 */
83 Collection<Tunnel> getTunnels(ConnectPoint src, ConnectPoint dst, Tunnel.Type type);
84
85 /**
86 * Returns the tunnel between the specified source
87 * and destination connection points.
88 *
89 * @param src source label
90 * @param dst destination label
91 * @return tunnel from source to destination; null if none found
92 */
93 Tunnel getTunnel(Label src, Label dst);
94
95 /**
96 * Returns the tunnel based on the Id.
97 *
98 * @param id tunnelId
99 * @return tunnel with specified Id
100 */
101 Tunnel getTunnel(TunnelId id);
102
103 /**
104 * Adds the specified tunnel listener.
105 *
106 * @param listener tunnel listener
107 */
108 void addListener(TunnelListener listener);
109
110 /**
111 * Removes the specified tunnel listener.
112 *
113 * @param listener tunnel listener
114 */
115 void removeListener(TunnelListener listener);
116
117}