[5] | 1 | package schedframe.scheduling.plugin.grid; |
---|
| 2 | |
---|
| 3 | |
---|
| 4 | import java.util.List; |
---|
| 5 | |
---|
| 6 | import org.joda.time.DateTime; |
---|
| 7 | |
---|
| 8 | import schedframe.net.Path; |
---|
| 9 | import schedframe.net.pce.topology.AbstractTopology; |
---|
| 10 | import schedframe.net.pce.topology.ExtendedVirtualLink; |
---|
| 11 | |
---|
| 12 | import gssim.schedframe.scheduling.plugin.grid.network.manager.NetworkReservationObject; |
---|
| 13 | |
---|
| 14 | /** |
---|
| 15 | * @author wojtek |
---|
| 16 | * |
---|
| 17 | */ |
---|
| 18 | public interface NetworkManager extends Module { |
---|
| 19 | |
---|
| 20 | /** |
---|
| 21 | * Creates reservation between two nodes with requested bandwidth in a given |
---|
| 22 | * period of time |
---|
| 23 | * |
---|
| 24 | * @param node1Name |
---|
| 25 | * @param node2Name |
---|
| 26 | * @param startDate |
---|
| 27 | * @param finishDate |
---|
| 28 | * @param bandwidth |
---|
| 29 | * @return ID of new reservation |
---|
| 30 | * @throws Exception |
---|
| 31 | */ |
---|
| 32 | public int createReservation(String node1Name, String node2Name, DateTime startDate, |
---|
| 33 | DateTime finishDate, long bandwidth) throws Exception; |
---|
| 34 | |
---|
| 35 | /** |
---|
| 36 | * Creates reservation between two nodes, on specified path with requested |
---|
| 37 | * bandwidth in a given period of time |
---|
| 38 | * |
---|
| 39 | * @param node1Name |
---|
| 40 | * @param node2Name |
---|
| 41 | * @param path |
---|
| 42 | * @param startDate |
---|
| 43 | * @param finishDate |
---|
| 44 | * @param bandwidth |
---|
| 45 | * @return ID of new reservation |
---|
| 46 | * @throws Exception |
---|
| 47 | */ |
---|
| 48 | public int createReservation(String node1Name,String node2Name, Path path, |
---|
| 49 | DateTime startDate, DateTime finishDate, long bandwidth) throws Exception; |
---|
| 50 | |
---|
| 51 | /** |
---|
| 52 | * Modifies a given reservation. It allows to change period of time and |
---|
| 53 | * requested bandwidth |
---|
| 54 | * |
---|
| 55 | * @param reservationID |
---|
| 56 | * @param startDate |
---|
| 57 | * @param finishDate |
---|
| 58 | * @param bandwidth |
---|
| 59 | * @return boolean status of modification |
---|
| 60 | * @throws Exception |
---|
| 61 | */ |
---|
| 62 | public boolean modifyReservation(int reservationID, DateTime startDate, |
---|
| 63 | DateTime finishDate, long bandwidth) throws Exception; |
---|
| 64 | |
---|
| 65 | /** |
---|
| 66 | * Cancels given reservation |
---|
| 67 | * |
---|
| 68 | * @param reservationID |
---|
| 69 | * @return boolean status of cancellation |
---|
| 70 | * @throws Exception |
---|
| 71 | */ |
---|
| 72 | public boolean cancelReservation(int reservationID) throws Exception; |
---|
| 73 | |
---|
| 74 | /** |
---|
| 75 | * Gets existing network topology |
---|
| 76 | * |
---|
| 77 | * @return network topology |
---|
| 78 | */ |
---|
| 79 | //public Topology getTopology(); |
---|
| 80 | |
---|
| 81 | /** |
---|
| 82 | * Gets existing abstract network topology |
---|
| 83 | * |
---|
| 84 | * @return abstract network topology |
---|
| 85 | */ |
---|
| 86 | public AbstractTopology getAbstractTopology(); |
---|
| 87 | |
---|
| 88 | /** |
---|
| 89 | * Calculates current maximum bandwidth between two nodes |
---|
| 90 | * |
---|
| 91 | * @param node1Name |
---|
| 92 | * @param node2Name |
---|
| 93 | * @return current bandwidth |
---|
| 94 | */ |
---|
| 95 | public long getBandwidth(String node1Name, String node2Name); |
---|
| 96 | |
---|
| 97 | /** |
---|
| 98 | * Calculates maximum bandwidth between two nodes in a given period of time |
---|
| 99 | * |
---|
| 100 | * @param node1Name |
---|
| 101 | * @param node2Name |
---|
| 102 | * @param startDate |
---|
| 103 | * @param finishDate |
---|
| 104 | * @return bandwidth |
---|
| 105 | */ |
---|
| 106 | public long getBandwidth(String node1Name, String node2Name, |
---|
| 107 | DateTime startDate, DateTime finishDate); |
---|
| 108 | |
---|
| 109 | /** |
---|
| 110 | * Calculates current bandwidth on a given path |
---|
| 111 | * |
---|
| 112 | * @param path |
---|
| 113 | * @return current bandwidth |
---|
| 114 | */ |
---|
| 115 | public long getBandwidth(Path path); |
---|
| 116 | |
---|
| 117 | /** |
---|
| 118 | * Calculates bandwidth on a given path in a given period of time |
---|
| 119 | * |
---|
| 120 | * @param path |
---|
| 121 | * @param startDate |
---|
| 122 | * @param finishDate |
---|
| 123 | * @return bandwidth |
---|
| 124 | */ |
---|
| 125 | public long getBandwidth(Path path, DateTime startDate, DateTime finishDate); |
---|
| 126 | |
---|
| 127 | /** |
---|
| 128 | * Calculates current maximum bandwidth between each node in topology |
---|
| 129 | * It returns current maximum bandwidth, each per one virtual link between the nodes. |
---|
| 130 | * |
---|
| 131 | * @return list of current bandwidth |
---|
| 132 | */ |
---|
| 133 | public List<ExtendedVirtualLink> getBandwidthMatrix(); |
---|
| 134 | |
---|
| 135 | /** |
---|
| 136 | * Calculates maximum bandwidth between each node in network topology in a |
---|
| 137 | * given period of time |
---|
| 138 | * It returns bandwidth in a given period of time, |
---|
| 139 | * each per one virtual link between the nodes. |
---|
| 140 | * |
---|
| 141 | * @param startDate |
---|
| 142 | * @param finishDate |
---|
| 143 | * @return list of bandwidth |
---|
| 144 | */ |
---|
| 145 | public List<ExtendedVirtualLink> getBandwidthMatrix(DateTime startDate, DateTime finishDate); |
---|
| 146 | |
---|
| 147 | /** |
---|
| 148 | * Calculates bandwidth between each node in topology during entire simulation |
---|
| 149 | * It returns a list of calendars, each per one virtual link between the nodes. |
---|
| 150 | * |
---|
| 151 | * @return list of virtual links |
---|
| 152 | */ |
---|
| 153 | public List<ExtendedVirtualLink> getAbsolutBandwidthMatrix(); |
---|
| 154 | |
---|
| 155 | /** |
---|
| 156 | * Calculates latency between two nodes |
---|
| 157 | * |
---|
| 158 | * @param node1Name |
---|
| 159 | * @param node2Name |
---|
| 160 | * @return latency |
---|
| 161 | */ |
---|
| 162 | public double getLatency(String node1Name, String node2Name); |
---|
| 163 | |
---|
| 164 | /** |
---|
| 165 | * Calculates latency on a give path |
---|
| 166 | * |
---|
| 167 | * @param path |
---|
| 168 | * @return latency |
---|
| 169 | */ |
---|
| 170 | public double getLatency(Path path); |
---|
| 171 | |
---|
| 172 | /** |
---|
| 173 | * Calculates latency between each node in network topology |
---|
| 174 | * |
---|
| 175 | * @return matrix of latency |
---|
| 176 | */ |
---|
| 177 | public double[][] getLatencyMatrix(); |
---|
| 178 | |
---|
| 179 | /** |
---|
| 180 | * Gets given reservation reserved links names |
---|
| 181 | * |
---|
| 182 | * @param reservationID |
---|
| 183 | * @return list of reserved links names |
---|
| 184 | */ |
---|
| 185 | public List<String> getReservedLinksNames(int reservationID); |
---|
| 186 | |
---|
| 187 | /** |
---|
| 188 | * Gets given reservation start time |
---|
| 189 | * |
---|
| 190 | * @param reservationID |
---|
| 191 | * @return start time of a given reservation |
---|
| 192 | */ |
---|
| 193 | public double getReservationStartTime(int reservationID); |
---|
| 194 | |
---|
| 195 | /** |
---|
| 196 | * Gets given reservation end time |
---|
| 197 | * |
---|
| 198 | * @param reservationID |
---|
| 199 | * @return end time of a given reservation |
---|
| 200 | */ |
---|
| 201 | public double getReservationEndTime(int reservationID); |
---|
| 202 | |
---|
| 203 | /** |
---|
| 204 | * Gets given reservation bandwidth |
---|
| 205 | * |
---|
| 206 | * @param reservationID |
---|
| 207 | * @return bandwidth of a given reservation |
---|
| 208 | */ |
---|
| 209 | public double getReservationBandwidth(int reservationID); |
---|
| 210 | |
---|
| 211 | /** |
---|
| 212 | * Gets all created network reservations |
---|
| 213 | * |
---|
| 214 | * @return list of network reservations objects |
---|
| 215 | */ |
---|
| 216 | public List<NetworkReservationObject> getReservations(); |
---|
| 217 | |
---|
| 218 | /** |
---|
| 219 | * Creates path from a given links |
---|
| 220 | * |
---|
| 221 | * @param linksNames |
---|
| 222 | * @return path |
---|
| 223 | */ |
---|
| 224 | public Path createPath(List<String> linkNames); |
---|
| 225 | |
---|
| 226 | /** |
---|
| 227 | * Finds shortest path between given nodes |
---|
| 228 | * |
---|
| 229 | * @param node1Name |
---|
| 230 | * @param node2Name |
---|
| 231 | * @param startDate |
---|
| 232 | * @param finishDate |
---|
| 233 | * @param bandwidth |
---|
| 234 | * @return list of links names |
---|
| 235 | * @throws Exception |
---|
| 236 | */ |
---|
| 237 | public List<String> findShortestPath(String node1Name, String node2Name, |
---|
| 238 | DateTime startDate, DateTime finishDate, long bandwidth) throws Exception; |
---|
| 239 | |
---|
| 240 | } |
---|