blob: f1038e98c08b3bb00c477370305f288153221d06 [file] [log] [blame]
tony-liuaff59a72016-10-21 15:41:46 +08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
tony-liuaff59a72016-10-21 15:41:46 +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 */
16
17package org.onosproject.tetunnel.api;
18
19import org.onosproject.incubator.net.tunnel.Tunnel;
20import org.onosproject.incubator.net.tunnel.TunnelId;
chenqinghui86320ae2016-12-01 15:40:39 +080021import org.onosproject.tetunnel.api.lsp.TeLsp;
22import org.onosproject.tetunnel.api.lsp.TeLspKey;
tony-liuaff59a72016-10-21 15:41:46 +080023import org.onosproject.tetunnel.api.tunnel.TeTunnel;
24import org.onosproject.tetunnel.api.tunnel.TeTunnelKey;
25
26/**
27 * Service through which tunnel providers can inject TE Tunnel attributes
28 * into the system.
29 * <p>
30 * Please note that this service works with the existing Tunnel subsystem
31 * together, just as an extension to the tunnel subsystem, and only focus on TE
32 * Tunnel attributes management.
33 */
34public interface TeTunnelProviderService {
35
36 /**
37 * Signals that a TE Tunnel is created with supplied attributes.
38 *
39 * @param teTunnel new created TE Tunnel attributes
40 * @return created tunnel identifier or null if failed
41 */
42 TunnelId teTunnelAdded(TeTunnel teTunnel);
43
44 /**
45 * Signals that a TE Tunnel with specified attributes is removed.
46 *
47 * @param teTunnel removed TE Tunnel
48 */
49 void teTunnelRemoved(TeTunnel teTunnel);
50
51 /**
52 * Updates TE Tunnel attributes with supplied information, the old
53 * attributes will be totally overwrote by the new attributes.
54 *
55 * @param teTunnel new TE Tunnel attributes
56 */
57 void updateTeTunnel(TeTunnel teTunnel);
58
59 /**
60 * Updates state of a TE tunnel specified by the given key.
61 *
62 * @param key TE tunnel key
63 * @param state new state of the tunnel
64 */
65 void updateTunnelState(TeTunnelKey key, Tunnel.State state);
66
chenqinghui86320ae2016-12-01 15:40:39 +080067 /**
68 * Signifies that a TE LSP is created.
69 *
70 * @param lsp new created TE LSP attributes
71 * @return key of the TE LSP or null if failed
72 */
73 TeLspKey teLspAdded(TeLsp lsp);
74
75 /**
76 * Signifies that a TE LSP is removed.
77 *
78 * @param lsp removed TE LSP
79 */
80 void teLspRemoved(TeLsp lsp);
81
82 /**
83 * Updates TE LSP attributes.
84 *
85 * @param lsp new TE LSP attributes
86 */
87 void updateTeLsp(TeLsp lsp);
88
tony-liuaff59a72016-10-21 15:41:46 +080089 //TODO: add interfaces for teGlobal and teLspState
90}