Yi Tseng | f4e13e3 | 2017-03-30 15:38:39 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
Yi Tseng | f4e13e3 | 2017-03-30 15:38:39 -0700 | [diff] [blame] | 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 | |
| 17 | package org.onosproject.vpls.api; |
| 18 | |
| 19 | import org.onosproject.incubator.net.intf.Interface; |
| 20 | import org.onosproject.net.EncapsulationType; |
| 21 | |
| 22 | import java.util.Collection; |
| 23 | |
| 24 | public 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 | } |