Open Kilda Java Documentation
PathComputer.java
Go to the documentation of this file.
1 /* Copyright 2017 Telstra Open Source
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 package org.openkilda.pce.provider;
17 
25 
26 import java.io.Serializable;
27 import java.util.ArrayList;
28 import java.util.List;
29 
33 public interface PathComputer extends Serializable {
34 
39  enum Strategy {
40  HOPS, COST, LATENCY, EXTERNAL
41  }
42 
49  default Long getWeight(IslInfoData isl) {
50  return 1L;
51  }
52 
62 
71 
77  default List<FlowInfo> getFlowInfo() {
78  return new ArrayList<>();
79  }
80 
87  default List<Flow> getAllFlows() {
88  return new ArrayList<>();
89  }
90 
97  default List<Flow> getFlow(String flowId) {
98  return null;
99  }
100 
101  /*
102  * @return all flows (forward and reverse) by id, if exist.
103  */
104  default List<Flow> getFlows(String flowId) {
105  return null;
106  }
107 
108  default List<SwitchInfoData> getSwitches() {
109  return null;
110  }
111 
112  default List<IslInfoData> getIsls() {
113  return null;
114  }
115 
122  AvailableNetwork getAvailableNetwork(boolean ignoreBandwidth, long requestedBandwidth);
123 }
default List< IslInfoData > getIsls()
default List< Flow > getFlows(String flowId)
ImmutablePair< PathInfoData, PathInfoData > getPath(Flow flow, AvailableNetwork network, Strategy strategy)
default List< SwitchInfoData > getSwitches()
default List< FlowInfo > getFlowInfo()
AvailableNetwork getAvailableNetwork(boolean ignoreBandwidth, long requestedBandwidth)
default Long getWeight(IslInfoData isl)
default List< Flow > getFlow(String flowId)