Add unset strategy functionality
diff --git a/src/main/java/com/intel/jndn/management/NFD.java b/src/main/java/com/intel/jndn/management/NFD.java
index ed9c598..c5c8f20 100644
--- a/src/main/java/com/intel/jndn/management/NFD.java
+++ b/src/main/java/com/intel/jndn/management/NFD.java
@@ -441,9 +441,9 @@
* signing has been set up (e.g. forwarder.setCommandSigningInfo()).
*
* @param forwarder only a localhost Face
- * @param prefix
- * @param strategy
- * @throws Exception
+ * @param prefix the {@link Name} prefix
+ * @param strategy the {@link Name} of the strategy to set, e.g. /localhost/nfd/strategy/broadcast
+ * @throws Exception if the command fails
*/
public static void setStrategy(Face forwarder, Name prefix, Name strategy) throws Exception {
// build command name
@@ -458,6 +458,28 @@
}
/**
+ * Set a strategy on the forwarder; see
+ * {@link #setStrategy(net.named_data.jndn.Face, net.named_data.jndn.Name, net.named_data.jndn.Name)}
+ * for more information. Ensure the forwarding face is on the local machine
+ * (management requests are to /localhost/...) and that command signing has
+ * been set up (e.g. forwarder.setCommandSigningInfo()).
+ *
+ * @param forwarder only a localhost {@link Face}
+ * @param prefix the {@link Name} prefix
+ * @throws Exception if the command fails
+ */
+ public static void unsetStrategy(Face forwarder, Name prefix) throws Exception {
+ // build command name
+ Name command = new Name("/localhost/nfd/strategy-choice/unsetset");
+ ControlParameters parameters = new ControlParameters();
+ parameters.setName(prefix);
+ command.append(parameters.wireEncode());
+
+ // send the interest
+ sendCommand(forwarder, new Interest(command));
+ }
+
+ /**
* Build an interest to retrieve the NFD status.
*
* @param forwarder only a localhost {@link Face}