blob: 16cd4c46af51eab987609a8ffef26950f2a4d344 [file] [log] [blame]
nosignal5fd282e2016-09-16 16:11:40 -07001/*
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 */
16package org.onosproject.vpls.config;
17
18import com.google.common.collect.SetMultimap;
19import org.onlab.packet.VlanId;
20import org.onosproject.incubator.net.intf.Interface;
21import org.onosproject.net.ConnectPoint;
22
23import java.util.Set;
24
25/**
26 * Provides information about the VPLS configuration.
27 */
28public interface VplsConfigurationService {
29 Class<VplsConfig> CONFIG_CLASS = VplsConfig.class;
30
31 /**
32 * Adds a VPLS to the configuration.
33 *
34 * @param name the name of the VPLS
35 * @param ifaces the interfaces associated with the VPLS
36 */
37 void addVpls(String name, Set<String> ifaces);
38
39 /**
40 * Removes a VPLS from the configuration.
41 *
42 * @param name the name of the VPLS to be removed
43 */
44 void removeVpls(String name);
45
46 /**
47 * Adds a network interface to a VPLS.
48 *
49 * @param name the name of the VPLS
50 * @param iface the network interface to be added to the VPLS
51 */
52 void addInterfaceToVpls(String name, String iface);
53
54 /**
55 * Removes a network interface from a VPLS.
56 *
57 * @param iface the network interface to be removed from the VPLS
58 */
59 void removeInterfaceFromVpls(String iface);
60
61 /**
62 * Cleans up the VPLS configuration. Removes all VPLSs.
63 */
64 void cleanVpls();
65
66 /**
67 * Retrieves the VPLS names modified from CLI.
68 *
69 * @return a set of VPLS names modified from CLI
70 */
71 Set<String> getVplsAffectedByApi();
72 // TODO Removes this function after intent framework fix race condition
73
74 /**
75 * Retrieves the interfaces from the VPLS configuration.
76 *
77 * @return a set of interfaces contained in the VPLS configuration
78 */
79 Set<Interface> getAllInterfaces();
80
81 /**
82 * Retrieves the interfaces belonging to the VPLS.
83 *
84 * @param name the name of the VPLS
85 * @return a set of interfaces belonging to the VPLS
86 */
87 Set<Interface> getVplsInterfaces(String name);
88
89 /**
90 * Retrieves all VPLS names.
91 *
92 * @return a set of VPLS names
93 */
94 Set<String> getAllVpls();
95
96 /**
97 * Retrieves all VPLS names from the old config.
98 *
99 * @return a set of VPLS names
100 */
101 Set<String> getOldVpls();
102 // TODO Removes this function after intent framework fix race condition
103
104 /**
105 * Retrieves the VPLS names and associated interfaces from the configuration.
106 *
107 * @return a map VPLS names and associated interfaces
108 */
109 SetMultimap<String, Interface> getVplsNetworks();
110
111 /**
112 * Retrieves a VPLS network given a VLAN Id and a connect point.
113 *
114 * @param vlan the VLAN Id
115 * @param connectPoint the connect point
116 * @return a map VPLS names and associated interfaces; null otherwise
117 */
118 SetMultimap<String, Interface> getVplsNetwork(VlanId vlan,
119 ConnectPoint connectPoint);
120}