blob: 8486f2c6219c53130776af76af99f7e68aa2fb61 [file] [log] [blame]
Yi Tsengf4e13e32017-03-30 15:38:39 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
Yi Tsengf4e13e32017-03-30 15:38:39 -07003 *
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.vpls.api;
18
19import org.onosproject.incubator.net.intf.Interface;
20import org.onosproject.net.EncapsulationType;
21
22import java.util.Collection;
23
24public interface Vpls {
25
26 /**
27 * Creates a new VPLS.
28 *
29 * @param vplsName the name of the VPLS
30 * @param encapsulationType the encapsulation type
31 * @return a VPLS instance if the operation is successful; null otherwise
32 */
33 VplsData createVpls(String vplsName, EncapsulationType encapsulationType);
34
35 /**
36 * Removes a VPLS.
37 *
38 * @param vplsData the VPLS to be removed
39 * @return the VPLS removed if the operation is successful; null otherwise
40 */
41 VplsData removeVpls(VplsData vplsData);
42
43 /**
44 * Adds network interfaces to a VPLS.
45 *
46 * @param vplsData the VPLS to which the interfaces have to be added to
47 * @param interfaces the interfaces to add
48 */
49 void addInterfaces(VplsData vplsData, Collection<Interface> interfaces);
50
51 /**
52 * Adds a network interface to a VPLS.
53 *
54 * @param vplsData the VPLS to which the interface has to be added to
55 * @param iface the interface to add
56 */
57 void addInterface(VplsData vplsData, Interface iface);
58
59 /**
60 * Sets an encapsulation type for a VPLS.
61 *
62 * @param vplsData the VPLS for which the encapsulation has to be set
63 * @param encapsulationType the encapsulation type
64 */
65 void setEncapsulationType(VplsData vplsData, EncapsulationType encapsulationType);
66
67 /**
68 * Retrieves a VPLS.
69 *
70 * @param vplsName the name of the VPLS
71 * @return the VPLS instance if the VPLS exists; null otherwise
72 */
73 VplsData getVpls(String vplsName);
74
75 /**
76 * Gets all VPLSs.
77 *
78 * @return a collection of VPLSs
79 */
80 Collection<VplsData> getAllVpls();
81
82 /**
83 * Removes the interfaces specified from a VPLS.
84 *
85 * @param vplsData the VPLS from which the interfaces are to be removed
86 * @param interfaces the interfaces to remove
87 * @return the interfaces removed
88 */
89 Collection<Interface> removeInterfaces(VplsData vplsData, Collection<Interface> interfaces);
90
91 /**
92 * Removes the interface specified from a VPLS.
93 *
94 * @param vplsData the VPLS from which the interface is to be removed
95 * @param iface the interface to remove
96 * @return the interface removed
97 */
98 Interface removeInterface(VplsData vplsData, Interface iface);
99
100 /**
101 * Removes all VPLSs and cleans up the VPLS configuration.
102 */
103 void removeAllVpls();
104}