|
@@ -1,71 +1,79 @@
|
|
-package de.tu_darmstadt.tk.SmartHomeNetworkSim.core;
|
|
|
|
-
|
|
|
|
-import java.util.Collection;
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- * Connection between two or more SmartDevices, which sends packages according
|
|
|
|
- * to a specified protocol
|
|
|
|
- *
|
|
|
|
- * @author Andreas T. Meyer-Berg
|
|
|
|
- */
|
|
|
|
-public interface Connection {
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * Returns the Link, which the connection uses
|
|
|
|
- *
|
|
|
|
- * @return link this connection uses
|
|
|
|
- */
|
|
|
|
- public Link getLink();
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * Returns the SmartDevice which started this connection
|
|
|
|
- *
|
|
|
|
- * @return source SmartDevice
|
|
|
|
- */
|
|
|
|
- public SmartDevice getSource();
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * Returns the SmartDevices that are part of this connection
|
|
|
|
- *
|
|
|
|
- * @return SmartDevices participating in this connection
|
|
|
|
- */
|
|
|
|
- public Collection<SmartDevice> getParticipants();
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * Removes the SmartDevice from the Connection. Should create terminating
|
|
|
|
- * packages, that are returned on the next call of simulateTimeIntervall. If
|
|
|
|
- * the Connection will be fully closed, source should be set to null and
|
|
|
|
- * getTerminationPackages should return the lastPackages. If the connection
|
|
|
|
- * still continues, a new Device should become the source. The Calling
|
|
|
|
- * Method should remove the Connection in the SmartDevice and add the
|
|
|
|
- * Connection to Model.terminatedConnections(), if source was set to null.
|
|
|
|
- *
|
|
|
|
- * @param sd
|
|
|
|
- * SmartDevice to Remove
|
|
|
|
- */
|
|
|
|
- public void removeSmartDevice(SmartDevice sd);
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * Simulates the next Simulation interval and returns the packets that were
|
|
|
|
- * sent during this interval.
|
|
|
|
- *
|
|
|
|
- * @param startTime
|
|
|
|
- * Time the simulation interval starts in
|
|
|
|
- * System.currentTimeMillis() time
|
|
|
|
- * @param duration
|
|
|
|
- * Duration of the simulation interval in milliseconds
|
|
|
|
- * @return packets that were sent in this interval
|
|
|
|
- */
|
|
|
|
- public Collection<Packet> simulateTimeInterval(long startTime, long duration);
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * Returns the Packets, created to terminate the connection
|
|
|
|
- *
|
|
|
|
- * @param startTime
|
|
|
|
- * Time the simulation interval starts in
|
|
|
|
- * System.currentTimeMillis() time
|
|
|
|
- * @return packets that were sent
|
|
|
|
- */
|
|
|
|
- public Collection<Packet> getTerminationPackages(long startTime);
|
|
|
|
-
|
|
|
|
-}
|
|
|
|
|
|
+package de.tu_darmstadt.tk.SmartHomeNetworkSim.core;
|
|
|
|
+
|
|
|
|
+import java.util.Collection;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * Connection between two or more SmartDevices, which sends packages according
|
|
|
|
+ * to a specified protocol
|
|
|
|
+ *
|
|
|
|
+ * @author Andreas T. Meyer-Berg
|
|
|
|
+ */
|
|
|
|
+public interface Connection {
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Returns the Link, which the connection uses
|
|
|
|
+ *
|
|
|
|
+ * @return link this connection uses
|
|
|
|
+ */
|
|
|
|
+ public Link getLink();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Returns the SmartDevice which started this connection
|
|
|
|
+ *
|
|
|
|
+ * @return source SmartDevice
|
|
|
|
+ */
|
|
|
|
+ public SmartDevice getSource();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Returns the SmartDevices that are part of this connection
|
|
|
|
+ *
|
|
|
|
+ * @return SmartDevices participating in this connection
|
|
|
|
+ */
|
|
|
|
+ public Collection<SmartDevice> getParticipants();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Removes the SmartDevice from the Connection. Should create terminating
|
|
|
|
+ * packages, that are returned on the next call of simulateTimeIntervall. If
|
|
|
|
+ * the Connection will be fully closed, source should be set to null and
|
|
|
|
+ * getTerminationPackages should return the lastPackages. If the connection
|
|
|
|
+ * still continues, a new Device should become the source. The Calling
|
|
|
|
+ * Method should remove the Connection in the SmartDevice and add the
|
|
|
|
+ * Connection to Model.terminatedConnections(), if source was set to null.
|
|
|
|
+ *
|
|
|
|
+ * @param sd
|
|
|
|
+ * SmartDevice to Remove
|
|
|
|
+ */
|
|
|
|
+ public void removeSmartDevice(SmartDevice sd);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Simulates the next Simulation interval and returns the packets that were
|
|
|
|
+ * sent during this interval.
|
|
|
|
+ *
|
|
|
|
+ * @param startTime
|
|
|
|
+ * Time the simulation interval starts in
|
|
|
|
+ * System.currentTimeMillis() time
|
|
|
|
+ * @param duration
|
|
|
|
+ * Duration of the simulation interval in milliseconds
|
|
|
|
+ * @return packets that were sent in this interval
|
|
|
|
+ */
|
|
|
|
+ public Collection<Packet> simulateTimeInterval(long startTime, long duration);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Returns the Packets, created to terminate the connection
|
|
|
|
+ *
|
|
|
|
+ * @param startTime
|
|
|
|
+ * Time the simulation interval starts in
|
|
|
|
+ * System.currentTimeMillis() time
|
|
|
|
+ * @return packets that were sent
|
|
|
|
+ */
|
|
|
|
+ public Collection<Packet> getTerminationPackages(long startTime);
|
|
|
|
+
|
|
|
|
+ //public Protocol getProtocol();
|
|
|
|
+
|
|
|
|
+ //public void setProtocol(Protocol protocol);
|
|
|
|
+
|
|
|
|
+ //public void setTriggerIntervall(long intervall); - or via ports
|
|
|
|
+
|
|
|
|
+ //public long getTriggerIntervall();
|
|
|
|
+
|
|
|
|
+}
|