Remove dependency on Selectors and refactor codebase.
Change-Id: Ic3024b76ba0eea61f790c91c36090b4aa68702a3
Refs: #4522
diff --git a/src/handles/delete-handle.cpp b/src/handles/delete-handle.cpp
index dc0f5f1..c892583 100644
--- a/src/handles/delete-handle.cpp
+++ b/src/handles/delete-handle.cpp
@@ -19,8 +19,12 @@
#include "delete-handle.hpp"
+#include <ndn-cxx/util/logger.hpp>
+
namespace repo {
+NDN_LOG_INIT(repo.DeleteHandle);
+
DeleteHandle::DeleteHandle(Face& face, RepoStorage& storageHandle,
ndn::mgmt::Dispatcher& dispatcher, Scheduler& scheduler,
Validator& validator)
@@ -40,12 +44,6 @@
{
const RepoCommandParameter& repoParameter = dynamic_cast<const RepoCommandParameter&>(parameter);
- if (repoParameter.hasSelectors()) {
- //choose data with selector and delete it
- processSelectorDeleteCommand(interest, repoParameter, done);
- return;
- }
-
if (!repoParameter.hasStartBlockId() && !repoParameter.hasEndBlockId()) {
processSingleDeleteCommand(interest, repoParameter, done);
return;
@@ -87,7 +85,7 @@
{
int64_t nDeletedData = storageHandle.deleteData(parameter.getName());
if (nDeletedData == -1) {
- std::cerr << "Deletion Failed!" <<std::endl;
+ NDN_LOG_DEBUG("Deletion Failed");
done(negativeReply(interest, 405, "Deletion Failed"));
}
else
@@ -95,20 +93,6 @@
}
void
-DeleteHandle::processSelectorDeleteCommand(const Interest& interest, const RepoCommandParameter& parameter,
- const ndn::mgmt::CommandContinuation& done) const
-{
- int64_t nDeletedData = storageHandle.deleteData(Interest(parameter.getName())
- .setSelectors(parameter.getSelectors()));
- if (nDeletedData == -1) {
- std::cerr << "Deletion Failed!" <<std::endl;
- done(negativeReply(interest, 405, "Deletion Failed"));
- }
- else
- done(positiveReply(interest, parameter, 200, nDeletedData));
-}
-
-void
DeleteHandle::processSegmentDeleteCommand(const Interest& interest, const RepoCommandParameter& parameter,
const ndn::mgmt::CommandContinuation& done) const
{