blob: e388c7041507d3f2cd0aeed57a4b2f6762a45a1c [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 org.onosproject.net.ElementId;
19import org.onosproject.net.Path;
20import org.onosproject.net.provider.Provider;
21
22/**
23 * Abstraction of an entity providing tunnel setup/release services to the core.
24 */
25public interface TunnelProvider extends Provider {
26
27 /**
jcc4a20a5f2015-04-30 15:43:39 +080028 * Instructs the provider to setup a tunnel. It's used by consumers.
wei wei89ddc322015-03-22 16:29:04 -050029 *
30 * @param tunnel Tunnel
31 * @param path explicit route or null for the tunnel
32 */
33 void setupTunnel(Tunnel tunnel, Path path);
34
35 /**
36 * Instructs the provider to setup a tunnel given the respective device.
jcc4a20a5f2015-04-30 15:43:39 +080037 * It's used by consumers.
wei wei89ddc322015-03-22 16:29:04 -050038 *
39 * @param srcElement device
40 * @param tunnel Tunnel
41 * @param path explicit route (not null) for the tunnel
42 */
43 void setupTunnel(ElementId srcElement, Tunnel tunnel, Path path);
44
45 /**
jcc4a20a5f2015-04-30 15:43:39 +080046 * Instructs the provider to release a tunnel. It's used by consumers.
wei wei89ddc322015-03-22 16:29:04 -050047 *
48 * @param tunnel Tunnel
49 */
50 void releaseTunnel(Tunnel tunnel);
51
52 /**
53 * Instructs the provider to release a tunnel given the respective device.
jcc4a20a5f2015-04-30 15:43:39 +080054 * It's used by consumers.
wei wei89ddc322015-03-22 16:29:04 -050055 *
56 * @param srcElement device
57 * @param tunnel Tunnel
58 */
59 void releaseTunnel(ElementId srcElement, Tunnel tunnel);
60
61 /**
jcc4a20a5f2015-04-30 15:43:39 +080062 * Instructs the provider to update a tunnel. It's used by consumers. Maybe
63 * some consumers enable to update a tunnel.
wei wei89ddc322015-03-22 16:29:04 -050064 *
65 * @param tunnel Tunnel
jcc4a20a5f2015-04-30 15:43:39 +080066 * @param path explicit route (path changed) or null (path not changed) for
67 * the tunnel
wei wei89ddc322015-03-22 16:29:04 -050068 */
69 void updateTunnel(Tunnel tunnel, Path path);
70
71 /**
72 * Instructs the provider to update a tunnel given the respective device.
jcc4a20a5f2015-04-30 15:43:39 +080073 * It's used by consumers. Maybe some consumers enable to update a tunnel.
wei wei89ddc322015-03-22 16:29:04 -050074 *
75 * @param srcElement device
76 * @param tunnel Tunnel
jcc4a20a5f2015-04-30 15:43:39 +080077 * @param path explicit route (path changed) or null (path not changed) for
78 * the tunnel
wei wei89ddc322015-03-22 16:29:04 -050079 */
80 void updateTunnel(ElementId srcElement, Tunnel tunnel, Path path);
81
jcc4a20a5f2015-04-30 15:43:39 +080082 /**
83 * Signals that the provider has added a tunnel. It's used by producers.
84 *
85 * @param tunnel tunnel information
86 * @return tunnel identity
87 */
88 TunnelId tunnelAdded(TunnelDescription tunnel);
89
90 /**
91 * Signals that the provider has removed a tunnel. It's used by producers.
92 *
93 * @param tunnel tunnel information
94 */
95 void tunnelRemoved(TunnelDescription tunnel);
96
97 /**
98 * Signals that the a tunnel was changed (e.g., sensing changes of
99 * tunnel).It's used by producers.
100 *
101 * @param tunnel tunnel information
102 */
103 void tunnelUpdated(TunnelDescription tunnel);
wei wei89ddc322015-03-22 16:29:04 -0500104}