blob: f2d36229f87d3dce09128a0565912dc37d3589e0 [file] [log] [blame]
Priyanka B7991c752016-03-26 19:52:44 +05301/*
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 */
16package org.onosproject.pce.pceservice.api;
17
18import java.util.List;
19
20import org.onosproject.net.DeviceId;
21import org.onosproject.net.intent.Constraint;
22import org.onosproject.pce.pceservice.LspType;
Avantika-Huawei73862d42016-05-12 18:58:06 +053023import org.onosproject.incubator.net.tunnel.Tunnel;
24import org.onosproject.incubator.net.tunnel.TunnelId;
Priyanka B7991c752016-03-26 19:52:44 +053025
26/**
Avantika-Huawei73862d42016-05-12 18:58:06 +053027 * Service to compute path based on constraints, release path,
28 * update path with new constraints and query existing tunnels.
Priyanka B7991c752016-03-26 19:52:44 +053029 */
30public interface PceService {
31
32 /**
Avantika-Huawei73862d42016-05-12 18:58:06 +053033 * Creates new path based on constraints and LSP type.
Priyanka B7991c752016-03-26 19:52:44 +053034 *
35 * @param src source device
36 * @param dst destination device
Avantika-Huawei73862d42016-05-12 18:58:06 +053037 * @param tunnelName name of the tunnel
Priyanka B7991c752016-03-26 19:52:44 +053038 * @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-Huawei73862d42016-05-12 18:58:06 +053042 boolean setupPath(DeviceId src, DeviceId dst, String tunnelName, List<Constraint> constraints, LspType lspType);
Priyanka B7991c752016-03-26 19:52:44 +053043
Avantika-Huawei73862d42016-05-12 18:58:06 +053044 /**
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 B7991c752016-03-26 19:52:44 +053075}