blob: 702d684a85c856ec0145aef6f8d2bfdb9e7f54fa [file] [log] [blame]
wei wei89ddc322015-03-22 16:29:04 -05001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
wei wei89ddc322015-03-22 16:29:04 -05003 *
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 */
Thomas Vachuskabf916ea2015-05-20 18:24:34 -070016
17package org.onosproject.incubator.net.tunnel;
wei wei89ddc322015-03-22 16:29:04 -050018
Brian O'Connor2bed5ce2015-06-25 15:10:28 -040019import com.google.common.annotations.Beta;
wei wei89ddc322015-03-22 16:29:04 -050020import org.onosproject.net.ElementId;
21import org.onosproject.net.Path;
22import org.onosproject.net.provider.Provider;
23
24/**
25 * Abstraction of an entity providing tunnel setup/release services to the core.
26 */
Brian O'Connor2bed5ce2015-06-25 15:10:28 -040027@Beta
wei wei89ddc322015-03-22 16:29:04 -050028public interface TunnelProvider extends Provider {
29
30 /**
jcc4a20a5f2015-04-30 15:43:39 +080031 * Instructs the provider to setup a tunnel. It's used by consumers.
wei wei89ddc322015-03-22 16:29:04 -050032 *
33 * @param tunnel Tunnel
34 * @param path explicit route or null for the tunnel
35 */
36 void setupTunnel(Tunnel tunnel, Path path);
37
38 /**
39 * Instructs the provider to setup a tunnel given the respective device.
jcc4a20a5f2015-04-30 15:43:39 +080040 * It's used by consumers.
wei wei89ddc322015-03-22 16:29:04 -050041 *
42 * @param srcElement device
43 * @param tunnel Tunnel
44 * @param path explicit route (not null) for the tunnel
45 */
46 void setupTunnel(ElementId srcElement, Tunnel tunnel, Path path);
47
48 /**
jcc4a20a5f2015-04-30 15:43:39 +080049 * Instructs the provider to release a tunnel. It's used by consumers.
wei wei89ddc322015-03-22 16:29:04 -050050 *
51 * @param tunnel Tunnel
52 */
53 void releaseTunnel(Tunnel tunnel);
54
55 /**
56 * Instructs the provider to release a tunnel given the respective device.
jcc4a20a5f2015-04-30 15:43:39 +080057 * It's used by consumers.
wei wei89ddc322015-03-22 16:29:04 -050058 *
59 * @param srcElement device
60 * @param tunnel Tunnel
61 */
62 void releaseTunnel(ElementId srcElement, Tunnel tunnel);
63
64 /**
jcc4a20a5f2015-04-30 15:43:39 +080065 * Instructs the provider to update a tunnel. It's used by consumers. Maybe
66 * some consumers enable to update a tunnel.
wei wei89ddc322015-03-22 16:29:04 -050067 *
68 * @param tunnel Tunnel
jcc4a20a5f2015-04-30 15:43:39 +080069 * @param path explicit route (path changed) or null (path not changed) for
70 * the tunnel
wei wei89ddc322015-03-22 16:29:04 -050071 */
72 void updateTunnel(Tunnel tunnel, Path path);
73
74 /**
75 * Instructs the provider to update a tunnel given the respective device.
jcc4a20a5f2015-04-30 15:43:39 +080076 * It's used by consumers. Maybe some consumers enable to update a tunnel.
wei wei89ddc322015-03-22 16:29:04 -050077 *
78 * @param srcElement device
79 * @param tunnel Tunnel
jcc4a20a5f2015-04-30 15:43:39 +080080 * @param path explicit route (path changed) or null (path not changed) for
81 * the tunnel
wei wei89ddc322015-03-22 16:29:04 -050082 */
83 void updateTunnel(ElementId srcElement, Tunnel tunnel, Path path);
84
jcc4a20a5f2015-04-30 15:43:39 +080085 /**
86 * Signals that the provider has added a tunnel. It's used by producers.
87 *
88 * @param tunnel tunnel information
89 * @return tunnel identity
90 */
91 TunnelId tunnelAdded(TunnelDescription tunnel);
92
93 /**
94 * Signals that the provider has removed a tunnel. It's used by producers.
95 *
96 * @param tunnel tunnel information
97 */
98 void tunnelRemoved(TunnelDescription tunnel);
99
100 /**
101 * Signals that the a tunnel was changed (e.g., sensing changes of
102 * tunnel).It's used by producers.
103 *
104 * @param tunnel tunnel information
105 */
106 void tunnelUpdated(TunnelDescription tunnel);
samuel7a5691a2015-05-23 00:36:32 +0800107
108 /**
109 * Signals that the a tunnel was queried.
110 * It's used by producers.
111 * @param tunnelId tunnel identity
112 * @return tunnel entity
113 */
114 Tunnel tunnelQueryById(TunnelId tunnelId);
wei wei89ddc322015-03-22 16:29:04 -0500115}