Priyanka B | 7991c75 | 2016-03-26 19:52:44 +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.pceservice.api; |
| 17 | |
| 18 | import java.util.List; |
| 19 | |
| 20 | import org.onosproject.net.DeviceId; |
| 21 | import org.onosproject.net.intent.Constraint; |
Priyanka B | bae0eeb1 | 2016-11-30 11:59:48 +0530 | [diff] [blame^] | 22 | import org.onosproject.pce.pceservice.ExplicitPathInfo; |
Priyanka B | 7991c75 | 2016-03-26 19:52:44 +0530 | [diff] [blame] | 23 | import org.onosproject.pce.pceservice.LspType; |
Avantika-Huawei | 73862d4 | 2016-05-12 18:58:06 +0530 | [diff] [blame] | 24 | import org.onosproject.incubator.net.tunnel.Tunnel; |
| 25 | import org.onosproject.incubator.net.tunnel.TunnelId; |
Priyanka B | 7991c75 | 2016-03-26 19:52:44 +0530 | [diff] [blame] | 26 | |
| 27 | /** |
Avantika-Huawei | 73862d4 | 2016-05-12 18:58:06 +0530 | [diff] [blame] | 28 | * Service to compute path based on constraints, release path, |
| 29 | * update path with new constraints and query existing tunnels. |
Priyanka B | 7991c75 | 2016-03-26 19:52:44 +0530 | [diff] [blame] | 30 | */ |
| 31 | public interface PceService { |
| 32 | |
| 33 | /** |
Avantika-Huawei | 73862d4 | 2016-05-12 18:58:06 +0530 | [diff] [blame] | 34 | * Creates new path based on constraints and LSP type. |
Priyanka B | 7991c75 | 2016-03-26 19:52:44 +0530 | [diff] [blame] | 35 | * |
| 36 | * @param src source device |
| 37 | * @param dst destination device |
Avantika-Huawei | 73862d4 | 2016-05-12 18:58:06 +0530 | [diff] [blame] | 38 | * @param tunnelName name of the tunnel |
Priyanka B | 7991c75 | 2016-03-26 19:52:44 +0530 | [diff] [blame] | 39 | * @param constraints list of constraints to be applied on path |
| 40 | * @param lspType type of path to be setup |
| 41 | * @return false on failure and true on successful path creation |
| 42 | */ |
Avantika-Huawei | 73862d4 | 2016-05-12 18:58:06 +0530 | [diff] [blame] | 43 | boolean setupPath(DeviceId src, DeviceId dst, String tunnelName, List<Constraint> constraints, LspType lspType); |
Priyanka B | 7991c75 | 2016-03-26 19:52:44 +0530 | [diff] [blame] | 44 | |
Avantika-Huawei | 73862d4 | 2016-05-12 18:58:06 +0530 | [diff] [blame] | 45 | /** |
Priyanka B | bae0eeb1 | 2016-11-30 11:59:48 +0530 | [diff] [blame^] | 46 | * Creates new path based on constraints and LSP type. |
| 47 | * |
| 48 | * @param src source device |
| 49 | * @param dst destination device |
| 50 | * @param tunnelName name of the tunnel |
| 51 | * @param constraints list of constraints to be applied on path |
| 52 | * @param lspType type of path to be setup |
| 53 | * @param explicitPathInfo list of explicit path info |
| 54 | * @return false on failure and true on successful path creation |
| 55 | */ |
| 56 | boolean setupPath(DeviceId src, DeviceId dst, String tunnelName, List<Constraint> constraints, LspType lspType, |
| 57 | List<ExplicitPathInfo> explicitPathInfo); |
| 58 | |
| 59 | /** |
Avantika-Huawei | 73862d4 | 2016-05-12 18:58:06 +0530 | [diff] [blame] | 60 | * Updates an existing path. |
| 61 | * |
| 62 | * @param tunnelId tunnel identifier |
| 63 | * @param constraints list of constraints to be applied on path |
| 64 | * @return false on failure and true on successful path update |
| 65 | */ |
| 66 | boolean updatePath(TunnelId tunnelId, List<Constraint> constraints); |
| 67 | |
| 68 | /** |
| 69 | * Releases an existing path. |
| 70 | * |
| 71 | * @param tunnelId tunnel identifier |
| 72 | * @return false on failure and true on successful path removal |
| 73 | */ |
| 74 | boolean releasePath(TunnelId tunnelId); |
| 75 | |
| 76 | /** |
| 77 | * Queries all paths. |
| 78 | * |
| 79 | * @return iterable of existing tunnels |
| 80 | */ |
| 81 | Iterable<Tunnel> queryAllPath(); |
| 82 | |
| 83 | /** |
| 84 | * Queries particular path based on tunnel identifier. |
| 85 | * |
| 86 | * @param tunnelId tunnel identifier |
| 87 | * @return tunnel if path exists, otherwise null |
| 88 | */ |
| 89 | Tunnel queryPath(TunnelId tunnelId); |
Priyanka B | bae0eeb1 | 2016-11-30 11:59:48 +0530 | [diff] [blame^] | 90 | |
| 91 | /** |
| 92 | * Returns list of explicit path info. |
| 93 | * |
| 94 | * @param tunnelName tunnel name |
| 95 | * @return list of explicit path info |
| 96 | */ |
| 97 | List<ExplicitPathInfo> explicitPathInfoList(String tunnelName); |
Priyanka B | 7991c75 | 2016-03-26 19:52:44 +0530 | [diff] [blame] | 98 | } |