blob: fdfdb73b3c5bdc0602f88219abcc6de7a27036dc [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;
Priyanka Bbae0eeb12016-11-30 11:59:48 +053022import org.onosproject.pce.pceservice.ExplicitPathInfo;
Priyanka B7991c752016-03-26 19:52:44 +053023import org.onosproject.pce.pceservice.LspType;
Avantika-Huawei73862d42016-05-12 18:58:06 +053024import org.onosproject.incubator.net.tunnel.Tunnel;
25import org.onosproject.incubator.net.tunnel.TunnelId;
Priyanka B7991c752016-03-26 19:52:44 +053026
27/**
Avantika-Huawei73862d42016-05-12 18:58:06 +053028 * Service to compute path based on constraints, release path,
29 * update path with new constraints and query existing tunnels.
Priyanka B7991c752016-03-26 19:52:44 +053030 */
31public interface PceService {
32
33 /**
Avantika-Huawei73862d42016-05-12 18:58:06 +053034 * Creates new path based on constraints and LSP type.
Priyanka B7991c752016-03-26 19:52:44 +053035 *
36 * @param src source device
37 * @param dst destination device
Avantika-Huawei73862d42016-05-12 18:58:06 +053038 * @param tunnelName name of the tunnel
Priyanka B7991c752016-03-26 19:52:44 +053039 * @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-Huawei73862d42016-05-12 18:58:06 +053043 boolean setupPath(DeviceId src, DeviceId dst, String tunnelName, List<Constraint> constraints, LspType lspType);
Priyanka B7991c752016-03-26 19:52:44 +053044
Avantika-Huawei73862d42016-05-12 18:58:06 +053045 /**
Priyanka Bbae0eeb12016-11-30 11:59:48 +053046 * 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-Huawei73862d42016-05-12 18:58:06 +053060 * 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 Bbae0eeb12016-11-30 11:59:48 +053090
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 B7991c752016-03-26 19:52:44 +053098}