management: delete deprecated Command Interest
This commit deletes deprecated ControlCommand::makeCommandInterest method,
and edits a few documentation items and test cases where "command Interest"
is referred to.
This commit also removes a deprecated feature in ndn::nfd::Controller::start(
ControlParameter, CommandSuccessCallback, CommandFailCallback,
IdentityCertificate, time::milliseconds), where empty IdentityCertificate()
was previously acceptable as the fourth parameter to pick the default
certificate, but now it's interpreted as a certificate with empty Name.
refs #2008
Change-Id: I54c1b579cfb18c7662c20de40193be5543286841
diff --git a/src/face.hpp b/src/face.hpp
index 3407d92..9f11b0a 100644
--- a/src/face.hpp
+++ b/src/face.hpp
@@ -246,8 +246,8 @@
* @param onFailure A callback to be called when prefixRegister command fails
* @param flags (optional) RIB flags (not used when direct FIB management is requested)
* @param certificate (optional) A certificate under which the prefix registration
- * command interest is signed. When omitted, a default certificate
- * of the default identity is used to sign the registration command
+ * command is signed. When omitted, a default certificate of
+ * the default identity is used to sign the registration command
*
* @return Opaque registered prefix ID which can be used with unsetInterestFilter or
* removeRegisteredPrefix
@@ -275,8 +275,8 @@
* @param onFailure A callback to be called when prefixRegister command fails
* @param flags (optional) RIB flags (not used when direct FIB management is requested)
* @param certificate (optional) A certificate under which the prefix registration
- * command interest is signed. When omitted, a default certificate
- * of the default identity is used to sign the registration command
+ * command is signed. When omitted, a default certificate of
+ * the default identity is used to sign the registration command
*
* @return Opaque registered prefix ID which can be used with unsetInterestFilter or
* removeRegisteredPrefix
@@ -302,8 +302,8 @@
* @param onInterest A callback to be called when a matching interest is received
* @param onSuccess A callback to be called when prefixRegister command succeeds
* @param onFailure A callback to be called when prefixRegister command fails
- * @param identity A signing identity. A command interest is signed under the default
- * certificate of this identity
+ * @param identity A signing identity. A prefix registration command is signed
+ * under the default certificate of this identity
* @param flags (optional) RIB flags (not used when direct FIB management is requested)
*
* @return Opaque registered prefix ID which can be used with removeRegisteredPrefix
@@ -329,8 +329,8 @@
* @param interestFilter Interest filter (prefix part will be registered with the forwarder)
* @param onInterest A callback to be called when a matching interest is received
* @param onFailure A callback to be called when prefixRegister command fails
- * @param identity A signing identity. A command interest is signed under the default
- * certificate of this identity
+ * @param identity A signing identity. A prefix registration command is signed
+ * under the default certificate of this identity
* @param flags (optional) RIB flags (not used when direct FIB management is requested)
*
* @return Opaque registered prefix ID which can be used with removeRegisteredPrefix
@@ -370,8 +370,8 @@
* @param onSuccess A callback to be called when prefixRegister command succeeds
* @param onFailure A callback to be called when prefixRegister command fails
* @param certificate (optional) A certificate under which the prefix registration
- * command interest is signed. When omitted, a default certificate
- * of the default identity is used to sign the registration command
+ * command is signed. When omitted, a default certificate of
+ * the default identity is used to sign the registration command
* @param flags (optional) RIB flags (not used when direct FIB management is requested)
*
* @return The registered prefix ID which can be used with unregisterPrefix
@@ -394,8 +394,8 @@
* @param prefix A prefix to register with the connected NDN forwarder
* @param onSuccess A callback to be called when prefixRegister command succeeds
* @param onFailure A callback to be called when prefixRegister command fails
- * @param identity A signing identity. A command interest is signed under the default
- * certificate of this identity
+ * @param identity A signing identity. A prefix registration command is signed
+ * under the default certificate of this identity
* @param flags (optional) RIB flags (not used when direct FIB management is requested)
*
* @return The registered prefix ID which can be used with unregisterPrefix
diff --git a/src/management/nfd-control-command.cpp b/src/management/nfd-control-command.cpp
index ac7a40d..fd9ec6b 100644
--- a/src/management/nfd-control-command.cpp
+++ b/src/management/nfd-control-command.cpp
@@ -62,15 +62,6 @@
return name;
}
-Interest
-ControlCommand::makeCommandInterest(const ControlParameters& parameters,
- const Sign& sign) const
-{
- Interest commandInterest(this->getRequestName(parameters));
- sign(commandInterest);
- return commandInterest;
-}
-
ControlCommand::FieldValidator::FieldValidator()
: m_required(CONTROL_PARAMETER_UBOUND)
, m_optional(CONTROL_PARAMETER_UBOUND)
diff --git a/src/management/nfd-control-command.hpp b/src/management/nfd-control-command.hpp
index bc4ef53..8285a6d 100644
--- a/src/management/nfd-control-command.hpp
+++ b/src/management/nfd-control-command.hpp
@@ -23,7 +23,6 @@
#define NDN_MANAGEMENT_NFD_CONTROL_COMMAND_HPP
#include "nfd-control-parameters.hpp"
-#include "../util/command-interest-generator.hpp"
namespace ndn {
namespace nfd {
@@ -83,18 +82,6 @@
Name
getRequestName(const ControlParameters& parameters) const;
-public: // deprecated
- /** \brief a callback on signing command interest
- */
- typedef function<void(Interest&)> Sign;
-
- /** \brief make a Command Interest from parameters
- * \deprecated use .getCommandName and sign with KeyChain
- */
- Interest
- makeCommandInterest(const ControlParameters& parameters,
- const Sign& sign) const;
-
protected:
ControlCommand(const std::string& module, const std::string& verb);
diff --git a/src/management/nfd-controller.hpp b/src/management/nfd-controller.hpp
index 3899de6..ef82cac 100644
--- a/src/management/nfd-controller.hpp
+++ b/src/management/nfd-controller.hpp
@@ -79,8 +79,6 @@
/** \brief start command execution
* \param certificate the certificate used to sign request Interests
- * \deprecated passing IdentityCertificate() empty certificate as fourth argument
- * is deprecated, use four-parameter overload instead
*/
template<typename Command>
void
@@ -90,11 +88,6 @@
const IdentityCertificate& certificate,
const time::milliseconds& timeout = getDefaultCommandTimeout())
{
- if (certificate.getName().empty()) { // deprecated usage
- start<Command>(parameters, onSuccess, onFailure, timeout);
- return;
- }
-
start<Command>(parameters, onSuccess, onFailure,
bind(static_cast<void(KeyChain::*)(Interest&,const Name&)>(&KeyChain::sign<Interest>),
&m_keyChain, _1, cref(certificate.getName())),
diff --git a/tests/unit-tests/management/test-nfd-controller.cpp b/tests/unit-tests/management/test-nfd-controller.cpp
index 3792f2c..2ec9285 100644
--- a/tests/unit-tests/management/test-nfd-controller.cpp
+++ b/tests/unit-tests/management/test-nfd-controller.cpp
@@ -22,11 +22,10 @@
#include "management/nfd-controller.hpp"
#include "management/nfd-control-response.hpp"
-#include "../dummy-client-face.hpp"
-
#include <boost/tuple/tuple.hpp>
#include "boost-test.hpp"
+#include "../dummy-client-face.hpp"
namespace ndn {
namespace nfd {
@@ -86,18 +85,18 @@
face->processEvents(time::milliseconds(1));
BOOST_REQUIRE_EQUAL(face->m_sentInterests.size(), 1);
- const Interest& commandInterest = face->m_sentInterests[0];
+ const Interest& requestInterest = face->m_sentInterests[0];
FaceCreateCommand command;
- BOOST_CHECK(command.getPrefix().isPrefixOf(commandInterest.getName()));
- // 9 components: ndn:/localhost/nfd/face/create/<parameters>/<command Interest signature x4>
- BOOST_REQUIRE_EQUAL(commandInterest.getName().size(), 9);
+ BOOST_CHECK(command.getPrefix().isPrefixOf(requestInterest.getName()));
+ // 9 components: ndn:/localhost/nfd/face/create/<parameters>/<signed Interest x4>
+ BOOST_REQUIRE_EQUAL(requestInterest.getName().size(), 9);
ControlParameters request;
// 4th component: <parameters>
- BOOST_REQUIRE_NO_THROW(request.wireDecode(commandInterest.getName().at(4).blockFromValue()));
+ BOOST_REQUIRE_NO_THROW(request.wireDecode(requestInterest.getName().at(4).blockFromValue()));
BOOST_CHECK_NO_THROW(command.validateRequest(request));
BOOST_CHECK_EQUAL(request.getUri(), parameters.getUri());
- BOOST_CHECK_EQUAL(commandInterest.getInterestLifetime(), Controller::getDefaultCommandTimeout());
+ BOOST_CHECK_EQUAL(requestInterest.getInterestLifetime(), Controller::getDefaultCommandTimeout());
ControlParameters responseBody;
responseBody.setUri("tcp4://192.0.2.1:6363")
@@ -105,7 +104,7 @@
ControlResponse responsePayload(201, "created");
responsePayload.setBody(responseBody.wireEncode());
- Data responseData(commandInterest.getName());
+ Data responseData(requestInterest.getName());
responseData.setContent(responsePayload.wireEncode());
keyChain.sign(responseData);
face->receive(responseData);
@@ -143,11 +142,11 @@
face->processEvents(time::milliseconds(1));
BOOST_REQUIRE_EQUAL(face->m_sentInterests.size(), 1);
- const Interest& commandInterest = face->m_sentInterests[0];
+ const Interest& requestInterest = face->m_sentInterests[0];
ControlResponse responsePayload(401, "Not Authenticated");
- Data responseData(commandInterest.getName());
+ Data responseData(requestInterest.getName());
responseData.setContent(responsePayload.wireEncode());
keyChain.sign(responseData);
face->receive(responseData);
@@ -170,7 +169,7 @@
face->processEvents(time::milliseconds(1));
BOOST_REQUIRE_EQUAL(face->m_sentInterests.size(), 1);
- const Interest& commandInterest = face->m_sentInterests[0];
+ const Interest& requestInterest = face->m_sentInterests[0];
ControlParameters responseBody;
responseBody.setUri("tcp4://192.0.2.1:6363")
@@ -179,7 +178,7 @@
ControlResponse responsePayload(201, "created");
responsePayload.setBody(responseBody.wireEncode());
- Data responseData(commandInterest.getName());
+ Data responseData(requestInterest.getName());
responseData.setContent(responsePayload.wireEncode());
keyChain.sign(responseData);
face->receive(responseData);