blob: 705896fcb7ac1d3237da3574e19b94685cefcf98 [file] [log] [blame]
tony-liuf7d2a262016-10-17 16:32:24 +08001/*
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
17package org.onosproject.actn.mdsc.pce;
18
19import org.onosproject.tetunnel.api.tunnel.TeTunnel;
20import org.onosproject.tetunnel.api.tunnel.path.TeRouteSubobject;
21
22import java.util.Collection;
23import java.util.List;
24
25/**
26 * PCE which calculates paths for TE tunnels.
27 */
28public interface TeTunnelPce {
29
30 static final int PRIORITY_HIGHEST = 255;
31 static final int PRIORITY_HIGH = PRIORITY_HIGHEST * 3 / 4;
32 static final int PRIORITY_MEDIUM = PRIORITY_HIGHEST / 2;
33 static final int PRIORITY_LOW = PRIORITY_HIGHEST / 4;
34 static final int PRIORITY_LOWEST = 0;
35
36 /**
37 * Returns priority of this PCE.
38 *
39 * @return priority of this PCE
40 */
41 int getPriority();
42
43 /**
44 * Signifies whether this PCE is suitable for the specified TE tunnel.
45 *
46 * @param teTunnel tunnel to check
47 * @return true if this PCE can calculate path for the TE tunnel
48 */
49 boolean isSuitable(TeTunnel teTunnel);
50
51 /**
52 * Calculates available paths for the specified TE tunnel.
53 *
54 * @param teTunnel tunnel information to be calculated
55 * @return available paths for the specified TE tunnel
56 */
57 Collection<List<TeRouteSubobject>> computePaths(TeTunnel teTunnel);
58}