handles: consolidate command prefix registrations
Previously, each command handle performs prefix registrations
separately, creating an excessive number of FIB entries in NFD.
This commit consolidates those registrations into one place,
and uses ndn::Face to dispatch Interests to command handlers.
refs #2023
Change-Id: Ia74ff970797eceac4df260e84dec727952d96489
diff --git a/src/handles/delete-handle.cpp b/src/handles/delete-handle.cpp
index f39856f..d062399 100644
--- a/src/handles/delete-handle.cpp
+++ b/src/handles/delete-handle.cpp
@@ -36,28 +36,6 @@
bind(&DeleteHandle::onValidationFailed, this, _1, _2));
}
-
-void
-DeleteHandle::onRegisterFailed(const Name& prefix, const std::string& reason)
-{
- BOOST_THROW_EXCEPTION(Error("Delete prefix registration failed"));
-}
-
-
-void
-DeleteHandle::onCheckInterest(const Name& prefix, const Interest& interest)
-{
- BOOST_ASSERT(false); // Deletion progress check, not implemented
-}
-
-
-void
-DeleteHandle::onCheckRegisterFailed(const Name& prefix, const std::string& reason)
-{
- BOOST_THROW_EXCEPTION(Error("Delete check prefix registration failed"));
-}
-
-
void
DeleteHandle::onValidated(const shared_ptr<const Interest>& interest, const Name& prefix)
{
@@ -102,11 +80,8 @@
void
DeleteHandle::listen(const Name& prefix)
{
- ndn::Name deleteprefix = Name(prefix).append("delete");
- ndn::InterestFilter filter(deleteprefix);
- getFace().setInterestFilter(filter,
- bind(&DeleteHandle::onInterest, this, _1, _2),
- bind(&DeleteHandle::onRegisterFailed, this, _1, _2));
+ getFace().setInterestFilter(Name(prefix).append("delete"),
+ bind(&DeleteHandle::onInterest, this, _1, _2));
}
void