Mahesh Poojary S | ba82729 | 2016-05-09 11:31:12 +0530 | [diff] [blame] | 1 | /* |
| 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 | package org.onosproject.pce.pcestore.api; |
| 17 | |
Priyanka B | bae0eeb1 | 2016-11-30 11:59:48 +0530 | [diff] [blame] | 18 | import java.util.List; |
| 19 | |
Mahesh Poojary S | ba82729 | 2016-05-09 11:31:12 +0530 | [diff] [blame] | 20 | import org.onosproject.incubator.net.tunnel.TunnelId; |
Mahesh Poojary S | ba82729 | 2016-05-09 11:31:12 +0530 | [diff] [blame] | 21 | import org.onosproject.net.resource.ResourceConsumer; |
Priyanka B | bae0eeb1 | 2016-11-30 11:59:48 +0530 | [diff] [blame] | 22 | import org.onosproject.pce.pceservice.ExplicitPathInfo; |
Mahesh Poojary S | f920ec0 | 2016-05-17 23:16:09 +0530 | [diff] [blame] | 23 | import org.onosproject.pce.pcestore.PcePathInfo; |
Mahesh Poojary S | ba82729 | 2016-05-09 11:31:12 +0530 | [diff] [blame] | 24 | |
| 25 | import java.util.Map; |
| 26 | |
| 27 | /** |
| 28 | * Abstraction of an entity providing pool of available labels to devices, links and tunnels. |
| 29 | */ |
| 30 | public interface PceStore { |
| 31 | /** |
Mahesh Poojary S | ba82729 | 2016-05-09 11:31:12 +0530 | [diff] [blame] | 32 | * Checks whether tunnel id is present in tunnel info store. |
| 33 | * |
| 34 | * @param tunnelId tunnel id |
| 35 | * @return success of failure |
| 36 | */ |
| 37 | boolean existsTunnelInfo(TunnelId tunnelId); |
| 38 | |
| 39 | /** |
Mahesh Poojary S | f920ec0 | 2016-05-17 23:16:09 +0530 | [diff] [blame] | 40 | * Checks whether path info is present in failed path info list. |
| 41 | * |
| 42 | * @param failedPathInfo failed path information |
| 43 | * @return success or failure |
| 44 | */ |
| 45 | boolean existsFailedPathInfo(PcePathInfo failedPathInfo); |
| 46 | |
| 47 | /** |
Mahesh Poojary S | ba82729 | 2016-05-09 11:31:12 +0530 | [diff] [blame] | 48 | * Retrieves the tunnel info count. |
| 49 | * |
| 50 | * @return tunnel info count |
| 51 | */ |
| 52 | int getTunnelInfoCount(); |
| 53 | |
| 54 | /** |
Mahesh Poojary S | f920ec0 | 2016-05-17 23:16:09 +0530 | [diff] [blame] | 55 | * Retrieves the failed path info count. |
| 56 | * |
| 57 | * @return failed path info count |
| 58 | */ |
| 59 | int getFailedPathInfoCount(); |
| 60 | |
| 61 | /** |
Mahesh Poojary S | ba82729 | 2016-05-09 11:31:12 +0530 | [diff] [blame] | 62 | * Retrieves tunnel id and pcecc tunnel info pairs collection from tunnel info store. |
| 63 | * |
Avantika-Huawei | 9e848e8 | 2016-09-01 12:12:42 +0530 | [diff] [blame] | 64 | * @return collection of tunnel id and resource consumer pairs |
Mahesh Poojary S | ba82729 | 2016-05-09 11:31:12 +0530 | [diff] [blame] | 65 | */ |
Avantika-Huawei | 9e848e8 | 2016-09-01 12:12:42 +0530 | [diff] [blame] | 66 | Map<TunnelId, ResourceConsumer> getTunnelInfos(); |
Mahesh Poojary S | ba82729 | 2016-05-09 11:31:12 +0530 | [diff] [blame] | 67 | |
| 68 | /** |
Mahesh Poojary S | f920ec0 | 2016-05-17 23:16:09 +0530 | [diff] [blame] | 69 | * Retrieves path info collection from failed path info store. |
| 70 | * |
| 71 | * @return collection of failed path info |
| 72 | */ |
| 73 | Iterable<PcePathInfo> getFailedPathInfos(); |
| 74 | |
| 75 | /** |
Mahesh Poojary S | ba82729 | 2016-05-09 11:31:12 +0530 | [diff] [blame] | 76 | * Retrieves local label info with tunnel consumer id from tunnel info store. |
| 77 | * |
| 78 | * @param tunnelId tunnel id |
Avantika-Huawei | 9e848e8 | 2016-09-01 12:12:42 +0530 | [diff] [blame] | 79 | * @return resource consumer |
Mahesh Poojary S | ba82729 | 2016-05-09 11:31:12 +0530 | [diff] [blame] | 80 | */ |
Avantika-Huawei | 9e848e8 | 2016-09-01 12:12:42 +0530 | [diff] [blame] | 81 | ResourceConsumer getTunnelInfo(TunnelId tunnelId); |
Mahesh Poojary S | ba82729 | 2016-05-09 11:31:12 +0530 | [diff] [blame] | 82 | |
| 83 | /** |
| 84 | * Stores local label info with tunnel consumer id into tunnel info store for specified tunnel id. |
| 85 | * |
| 86 | * @param tunnelId tunnel id |
Avantika-Huawei | 9e848e8 | 2016-09-01 12:12:42 +0530 | [diff] [blame] | 87 | * @param tunnelConsumerId tunnel consumer id |
Mahesh Poojary S | ba82729 | 2016-05-09 11:31:12 +0530 | [diff] [blame] | 88 | */ |
Avantika-Huawei | 9e848e8 | 2016-09-01 12:12:42 +0530 | [diff] [blame] | 89 | void addTunnelInfo(TunnelId tunnelId, ResourceConsumer tunnelConsumerId); |
Mahesh Poojary S | ba82729 | 2016-05-09 11:31:12 +0530 | [diff] [blame] | 90 | |
| 91 | /** |
Mahesh Poojary S | f920ec0 | 2016-05-17 23:16:09 +0530 | [diff] [blame] | 92 | * Stores path information into failed path info store. |
| 93 | * |
| 94 | * @param failedPathInfo failed path information |
| 95 | */ |
| 96 | void addFailedPathInfo(PcePathInfo failedPathInfo); |
| 97 | |
| 98 | /** |
Mahesh Poojary S | ba82729 | 2016-05-09 11:31:12 +0530 | [diff] [blame] | 99 | * Removes local label info with tunnel consumer id from tunnel info store for specified tunnel id. |
| 100 | * |
| 101 | * @param tunnelId tunnel id |
| 102 | * @return success or failure |
| 103 | */ |
| 104 | boolean removeTunnelInfo(TunnelId tunnelId); |
Mahesh Poojary S | f920ec0 | 2016-05-17 23:16:09 +0530 | [diff] [blame] | 105 | |
| 106 | /** |
| 107 | * Removes path info from failed path info store. |
| 108 | * |
| 109 | * @param failedPathInfo failed path information |
| 110 | * @return success or failure |
| 111 | */ |
| 112 | boolean removeFailedPathInfo(PcePathInfo failedPathInfo); |
Priyanka B | bae0eeb1 | 2016-11-30 11:59:48 +0530 | [diff] [blame] | 113 | |
| 114 | /** |
| 115 | * Adds explicit path info to the map with corresponding tunnel name. |
| 116 | * |
| 117 | * @param tunnelName tunnel name as key |
| 118 | * @param explicitPathInfo list of explicit path objects |
| 119 | * @return whether it is added to map |
| 120 | */ |
| 121 | boolean tunnelNameExplicitPathInfoMap(String tunnelName, List<ExplicitPathInfo> explicitPathInfo); |
| 122 | |
| 123 | /** |
| 124 | * Gets explicit path info based on tunnel name. |
| 125 | * |
| 126 | * @param tunnelName tunnel name as key |
| 127 | * @return list of explicit path info |
| 128 | */ |
| 129 | List<ExplicitPathInfo> getTunnelNameExplicitPathInfoMap(String tunnelName); |
Mahesh Poojary S | ba82729 | 2016-05-09 11:31:12 +0530 | [diff] [blame] | 130 | } |