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