Commit fca66901 authored by Clemens Krug's avatar Clemens Krug
Browse files

Added Javadoc to class involved in the node debugging

parent db6cbf51
...@@ -8,7 +8,7 @@ import java.util.HashMap; ...@@ -8,7 +8,7 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
* Bridge to local debug monitoring. Provides logging capabilities and * Bridge to local node debug monitoring. Provides logging capabilities and
* data access for per node information. * data access for per node information.
*/ */
public class NodeDebugMonitor public class NodeDebugMonitor
...@@ -45,11 +45,21 @@ public class NodeDebugMonitor ...@@ -45,11 +45,21 @@ public class NodeDebugMonitor
} }
/**
* Gets the data of a node separated by the classes the information came from.
* @param nodeID The node of which the information should be collected.
* @return A hashmap of hashmaps with each inner hashmap holding the information provided by one
* specific class.
*/
public static Map<Class, HashMap<String, Object>> getNodeData(INodeID nodeID) public static Map<Class, HashMap<String, Object>> getNodeData(INodeID nodeID)
{ {
return getDebugMonitor().getNodeData(nodeID); return getDebugMonitor().getNodeData(nodeID);
} }
/**
* Add a listener which will be informed about data updates.
* @param listener The listener to add.
*/
public static void addUpdateListener(NodeDebugMonitorComponent.NodeDebugUpdateListener listener) public static void addUpdateListener(NodeDebugMonitorComponent.NodeDebugUpdateListener listener)
{ {
getDebugMonitor().addUpdateListener(listener); getDebugMonitor().addUpdateListener(listener);
......
...@@ -7,27 +7,59 @@ import java.util.HashMap; ...@@ -7,27 +7,59 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
* Created by Clemens on 02.04.2017. * The actual node debug monitoring component. As opposed to the {@link de.tudarmstadt.maki.simonstrator.api.NodeDebugMonitor}
* which only serves as a bridge, a class implementing this interface provides the actual functionality.
*/ */
public interface NodeDebugMonitorComponent extends GlobalComponent public interface NodeDebugMonitorComponent extends GlobalComponent
{ {
/**
* Update an entry for a node.
* @param subject The class which provided the info
* @param nodeID The node the info is about
* @param entry The string entry/key of the information
* @param value The value of the information
*/
void update(Class<?> subject, INodeID nodeID, String entry, Object value); void update(Class<?> subject, INodeID nodeID, String entry, Object value);
/**
* Gets the data of a node separated by the classes the information came from.
* @param nodeID The node of which the information should be collected.
* @return A hashmap of hashmaps with each inner hashmap holding the information provided by one
* specific class.
*/
Map<Class, HashMap<String, Object>> getNodeData(INodeID nodeID); Map<Class, HashMap<String, Object>> getNodeData(INodeID nodeID);
/**
* Add a listener which will be informed about data updates.
* @param listener The listener to add.
*/
void addUpdateListener(NodeDebugUpdateListener listener); void addUpdateListener(NodeDebugUpdateListener listener);
/**
* Removes a listener so that it won't be notified anymore.
* @param listener the listener to remove
*/
void removeUpdateListener(NodeDebugUpdateListener listener); void removeUpdateListener(NodeDebugUpdateListener listener);
/** /**
* When set to true this method needs to create the * When set to true this method needs to create the
* appropriate visualisation component. * appropriate visualisation component.
* @param enabled * @param enabled wether to enable the visualisation or not
*/ */
void setEnableVis(boolean enabled); void setEnableVis(boolean enabled);
/**
* Listener for updates of the per node information.
*/
interface NodeDebugUpdateListener interface NodeDebugUpdateListener
{ {
/**
* Called upon an update of the data of a node.
* @param subject The class that provided the info
* @param nodeId the node the info is about
* @param entry the actual entry/key of the info
* @param value the value of the info.
*/
void onNodeDebugUpdate(Class subject, INodeID nodeId, String entry, Object value); void onNodeDebugUpdate(Class subject, INodeID nodeId, String entry, Object value);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment