Mohammad Shahid | 4c30ea3 | 2017-08-09 18:02:10 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Foundation |
| 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.evpnopenflow.rsc.vpnafconfig; |
| 18 | |
| 19 | import com.fasterxml.jackson.databind.JsonNode; |
| 20 | import org.onosproject.evpnopenflow.rsc.VpnAfConfig; |
Ray Milkey | a95193c | 2017-08-10 15:35:36 -0700 | [diff] [blame] | 21 | import org.onosproject.evpnrouteservice.VpnRouteTarget; |
Mohammad Shahid | 4c30ea3 | 2017-08-09 18:02:10 +0530 | [diff] [blame] | 22 | |
| 23 | import java.util.Collection; |
| 24 | |
| 25 | /** |
| 26 | * Service for interacting with the inventory of VPN af config instance. |
| 27 | */ |
| 28 | public interface VpnAfConfigService { |
| 29 | /** |
| 30 | * Returns if the route target is existed. |
| 31 | * |
| 32 | * @param routeTarget route target |
| 33 | * @return true or false if one with the given route target is not existed. |
| 34 | */ |
| 35 | boolean exists(VpnRouteTarget routeTarget); |
| 36 | |
| 37 | /** |
| 38 | * Returns the VPN af config with the route target. |
| 39 | * |
| 40 | * @param routeTarget route target |
| 41 | * @return VPN af config or null if one with the given route target is not |
| 42 | * know. |
| 43 | */ |
| 44 | VpnAfConfig getVpnAfConfig(VpnRouteTarget routeTarget); |
| 45 | |
| 46 | /** |
| 47 | * Returns the collection of the currently known VPN af configurations. |
| 48 | * |
| 49 | * @return collection of VPN af configurations. |
| 50 | */ |
| 51 | Collection<VpnAfConfig> getVpnAfConfigs(); |
| 52 | |
| 53 | /** |
| 54 | * Creates VPN af configurations by vpnAfConfigs. |
| 55 | * |
| 56 | * @param vpnAfConfigs the iterable collection of vpnAfConfigs |
| 57 | * @return true if all given VPN af configs created successfully |
| 58 | */ |
| 59 | boolean createVpnAfConfigs(Iterable<VpnAfConfig> vpnAfConfigs); |
| 60 | |
| 61 | /** |
| 62 | * Updates VPN af configurations by vpnAfConfigs. |
| 63 | * |
| 64 | * @param vpnAfConfigs the iterable collection of vpnAfConfigs |
| 65 | * @return true if all given VPN af configs created successfully. |
| 66 | */ |
| 67 | boolean updateVpnAfConfigs(Iterable<VpnAfConfig> vpnAfConfigs); |
| 68 | |
| 69 | /** |
| 70 | * Deletes vpnAfConfigs by route target. |
| 71 | * |
| 72 | * @param routeTarget the iterable collection of vpnAFConfigs |
| 73 | * @return true or false if one with the given route target to delete is |
| 74 | * successfully |
| 75 | */ |
| 76 | boolean removeVpnAfConfigs(Iterable<VpnRouteTarget> routeTarget); |
| 77 | |
| 78 | /** |
| 79 | * process gluon config for vpn af configuration. |
| 80 | * |
| 81 | * @param action can be either update or delete |
| 82 | * @param key can contain the id and also target information |
| 83 | * @param value content of the route targets configuration |
| 84 | */ |
| 85 | void processGluonConfig(String action, String key, JsonNode value); |
| 86 | |
| 87 | /** |
| 88 | * Adds the specified listener to Vpn Port manager. |
| 89 | * |
| 90 | * @param listener vpn af config listener |
| 91 | */ |
| 92 | void addListener(VpnAfConfigListener listener); |
| 93 | |
| 94 | /** |
| 95 | * Removes the specified listener to vpn af config manager. |
| 96 | * |
| 97 | * @param listener vpn af config listener |
| 98 | */ |
| 99 | void removeListener(VpnAfConfigListener listener); |
| 100 | } |