blob: d4dd4b34503374b52e371623bfc0a6eb243d32d3 [file] [log] [blame]
tony-liuaff59a72016-10-21 15:41:46 +08001/*
2 * Copyright 2016-present 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 */
16
17package org.onosproject.tetunnel.api;
18
19import org.onosproject.incubator.net.tunnel.TunnelId;
20import org.onosproject.tetopology.management.api.TeTopologyKey;
21import org.onosproject.tetunnel.api.tunnel.TeTunnel;
22import org.onosproject.tetunnel.api.tunnel.TeTunnelKey;
23
24import java.util.Collection;
25
26/**
27 * Service for TE Tunnel attributes management.
28 * <p>
29 * Please note that this service works with the existing Tunnel subsystem
30 * together, just as an extension to the tunnel subsystem, and only focus on TE
31 * Tunnel attributes management.
32 */
33public interface TeTunnelService {
34
35 /**
36 * Returns the TE Tunnel with the specified key.
37 *
38 * @param teTunnelKey TE Tunnel key
39 * @return TeTunnel or null if one with the given key is not known
40 */
41 TeTunnel getTeTunnel(TeTunnelKey teTunnelKey);
42
43 /**
44 * Returns the TE Tunnel with the specified identifier.
45 *
46 * @param tunnelId corresponding tunnel identifier
47 * @return TeTunnel or null if one with the given identifier is not known
48 */
49 TeTunnel getTeTunnel(TunnelId tunnelId);
50
51 /**
52 * Returns the corresponding tunnel identifier of a TE tunnel with the
53 * specified key.
54 *
55 * @param teTunnelKey TE Tunnel key
56 * @return corresponding tunnel identifier or null if one with the given
57 * key is not known
58 */
59 TunnelId getTunnelId(TeTunnelKey teTunnelKey);
60
61 /**
62 * Returns a collection of currently known TE tunnels.
63 *
64 * @return collection of TE tunnels
65 */
66 Collection<TeTunnel> getTeTunnels();
67
68 /**
69 * Returns a collection of currently known TE Tunnels filtered by the
70 * specified TE tunnel type.
71 *
72 * @param type TE tunnel type to filter by
73 * @return filtered collection of TE tunnels
74 */
75 Collection<TeTunnel> getTeTunnels(TeTunnel.Type type);
76
77 /**
78 * Returns a collection of currently known TE tunnels filtered by specified
79 * TE topology key.
80 *
81 * @param teTopologyKey TE topology key to filter by
82 * @return filtered collection of TE tunnels
83 */
84 Collection<TeTunnel> getTeTunnels(TeTopologyKey teTopologyKey);
85
86 //TODO: add interfaces for teGlobal and teLspState
87}