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