|
@@ -163,7 +163,49 @@ public class PacketCaptureController {
|
|
|
notifyObservers();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ /**
|
|
|
+ * Returns training or testing mode of the algorithm.
|
|
|
+ * @param collector Collector which is used
|
|
|
+ * @return true if testing or false if training the algorithm.
|
|
|
+ */
|
|
|
+ public boolean getMode(PacketCollector collector) {
|
|
|
+ if(collector == null)
|
|
|
+ return false;
|
|
|
+ return collector.getMode();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Sets the training or testing mode
|
|
|
+ * @param collector Collector which is used
|
|
|
+ * @param mode true if testing or false if training the algorithm.
|
|
|
+ */
|
|
|
+ public void setMode(PacketCollector collector, boolean mode) {
|
|
|
+ if(collector == null) return;
|
|
|
+ collector.setMode(mode);
|
|
|
+ notifyObservers();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Whether the algorithm should run
|
|
|
+ * @param collector Collector which is used
|
|
|
+ * @return true if algorithm will be executed
|
|
|
+ */
|
|
|
+ public boolean isActive(PacketCollector collector) {
|
|
|
+ if(collector == null)
|
|
|
+ return false;
|
|
|
+ return collector.isActive();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set to true, if it should run
|
|
|
+ * @param collector Collector which is used
|
|
|
+ * @param active true if it should be active
|
|
|
+ */
|
|
|
+ public void setActive(PacketCollector collector, boolean active) {
|
|
|
+ if(collector == null)return;
|
|
|
+ collector.setActive(active);
|
|
|
+ notifyObservers();
|
|
|
+ }
|
|
|
/**
|
|
|
* Notify all observers of the packet collection managers
|
|
|
*/
|