package schedframe.scheduling.plugin.grid; import java.util.List; import org.joda.time.DateTime; import schedframe.net.Path; import schedframe.net.pce.topology.AbstractTopology; import schedframe.net.pce.topology.ExtendedVirtualLink; import gssim.schedframe.scheduling.plugin.grid.network.manager.NetworkReservationObject; /** * @author wojtek * */ public interface NetworkManager extends Module { /** * Creates reservation between two nodes with requested bandwidth in a given * period of time * * @param node1Name * @param node2Name * @param startDate * @param finishDate * @param bandwidth * @return ID of new reservation * @throws Exception */ public int createReservation(String node1Name, String node2Name, DateTime startDate, DateTime finishDate, long bandwidth) throws Exception; /** * Creates reservation between two nodes, on specified path with requested * bandwidth in a given period of time * * @param node1Name * @param node2Name * @param path * @param startDate * @param finishDate * @param bandwidth * @return ID of new reservation * @throws Exception */ public int createReservation(String node1Name,String node2Name, Path path, DateTime startDate, DateTime finishDate, long bandwidth) throws Exception; /** * Modifies a given reservation. It allows to change period of time and * requested bandwidth * * @param reservationID * @param startDate * @param finishDate * @param bandwidth * @return boolean status of modification * @throws Exception */ public boolean modifyReservation(int reservationID, DateTime startDate, DateTime finishDate, long bandwidth) throws Exception; /** * Cancels given reservation * * @param reservationID * @return boolean status of cancellation * @throws Exception */ public boolean cancelReservation(int reservationID) throws Exception; /** * Gets existing network topology * * @return network topology */ //public Topology getTopology(); /** * Gets existing abstract network topology * * @return abstract network topology */ public AbstractTopology getAbstractTopology(); /** * Calculates current maximum bandwidth between two nodes * * @param node1Name * @param node2Name * @return current bandwidth */ public long getBandwidth(String node1Name, String node2Name); /** * Calculates maximum bandwidth between two nodes in a given period of time * * @param node1Name * @param node2Name * @param startDate * @param finishDate * @return bandwidth */ public long getBandwidth(String node1Name, String node2Name, DateTime startDate, DateTime finishDate); /** * Calculates current bandwidth on a given path * * @param path * @return current bandwidth */ public long getBandwidth(Path path); /** * Calculates bandwidth on a given path in a given period of time * * @param path * @param startDate * @param finishDate * @return bandwidth */ public long getBandwidth(Path path, DateTime startDate, DateTime finishDate); /** * Calculates current maximum bandwidth between each node in topology * It returns current maximum bandwidth, each per one virtual link between the nodes. * * @return list of current bandwidth */ public List getBandwidthMatrix(); /** * Calculates maximum bandwidth between each node in network topology in a * given period of time * It returns bandwidth in a given period of time, * each per one virtual link between the nodes. * * @param startDate * @param finishDate * @return list of bandwidth */ public List getBandwidthMatrix(DateTime startDate, DateTime finishDate); /** * Calculates bandwidth between each node in topology during entire simulation * It returns a list of calendars, each per one virtual link between the nodes. * * @return list of virtual links */ public List getAbsolutBandwidthMatrix(); /** * Calculates latency between two nodes * * @param node1Name * @param node2Name * @return latency */ public double getLatency(String node1Name, String node2Name); /** * Calculates latency on a give path * * @param path * @return latency */ public double getLatency(Path path); /** * Calculates latency between each node in network topology * * @return matrix of latency */ public double[][] getLatencyMatrix(); /** * Gets given reservation reserved links names * * @param reservationID * @return list of reserved links names */ public List getReservedLinksNames(int reservationID); /** * Gets given reservation start time * * @param reservationID * @return start time of a given reservation */ public double getReservationStartTime(int reservationID); /** * Gets given reservation end time * * @param reservationID * @return end time of a given reservation */ public double getReservationEndTime(int reservationID); /** * Gets given reservation bandwidth * * @param reservationID * @return bandwidth of a given reservation */ public double getReservationBandwidth(int reservationID); /** * Gets all created network reservations * * @return list of network reservations objects */ public List getReservations(); /** * Creates path from a given links * * @param linksNames * @return path */ public Path createPath(List linkNames); /** * Finds shortest path between given nodes * * @param node1Name * @param node2Name * @param startDate * @param finishDate * @param bandwidth * @return list of links names * @throws Exception */ public List findShortestPath(String node1Name, String node2Name, DateTime startDate, DateTime finishDate, long bandwidth) throws Exception; }