src: Update source code to use new API and fix compilation errors due to missing headers

Change-Id: I295fbcdcd6ab114a565d9b7531387728a6596884
Refs: 1629
diff --git a/src/handles/delete-handle.cpp b/src/handles/delete-handle.cpp
index 49e4d98..d88d523 100644
--- a/src/handles/delete-handle.cpp
+++ b/src/handles/delete-handle.cpp
@@ -36,6 +36,11 @@
                        bind(&DeleteHandle::onValidationFailed, this, _1, prefix));
 }
 
+void
+DeleteHandle::onRegisterSuccess(const Name& prefix)
+{
+  std::cerr << "Successfully registered prefix " << prefix << std::endl;
+}
 
 void
 DeleteHandle::onRegisterFailed(const Name& prefix, const std::string& reason)
@@ -103,6 +108,7 @@
 {
   getFace().setInterestFilter(Name(prefix).append("delete"),
                               bind(&DeleteHandle::onInterest, this, _1, _2),
+                              bind(&DeleteHandle::onRegisterSuccess, this, _1),
                               bind(&DeleteHandle::onRegisterFailed, this, _1, _2));
 }
 
diff --git a/src/handles/delete-handle.hpp b/src/handles/delete-handle.hpp
index 680e8dc..8ca1c56 100644
--- a/src/handles/delete-handle.hpp
+++ b/src/handles/delete-handle.hpp
@@ -52,6 +52,9 @@
   onInterest(const Name& prefix, const Interest& interest);
 
   void
+  onRegisterSuccess(const Name& prefix);
+
+  void
   onRegisterFailed(const Name& prefix, const std::string& reason);
 
   void
diff --git a/src/handles/read-handle.cpp b/src/handles/read-handle.cpp
index d0e80b3..e13a85c 100644
--- a/src/handles/read-handle.cpp
+++ b/src/handles/read-handle.cpp
@@ -31,6 +31,12 @@
 }
 
 void
+ReadHandle::onRegisterSuccess(const Name& prefix)
+{
+  std::cerr << "Successfully registered prefix " << prefix << std::endl;
+}
+
+void
 ReadHandle::onRegisterFailed(const Name& prefix, const std::string& reason)
 {
   std::cerr << "ERROR: Failed to register prefix in local hub's daemon" << std::endl;
@@ -42,6 +48,7 @@
 {
   getFace().setInterestFilter(prefix,
                               bind(&ReadHandle::onInterest, this, _1, _2),
+                              bind(&ReadHandle::onRegisterSuccess, this, _1),
                               bind(&ReadHandle::onRegisterFailed, this, _1, _2));
 }
 
diff --git a/src/handles/read-handle.hpp b/src/handles/read-handle.hpp
index 93468c0..7bf0484 100644
--- a/src/handles/read-handle.hpp
+++ b/src/handles/read-handle.hpp
@@ -44,6 +44,9 @@
   onInterest(const Name& prefix, const Interest& interest);
 
   void
+  onRegisterSuccess(const Name& prefix);
+
+  void
   onRegisterFailed(const Name& prefix, const std::string& reason);
 };
 
diff --git a/src/handles/write-handle.cpp b/src/handles/write-handle.cpp
index 0ea17ae..77c674b 100644
--- a/src/handles/write-handle.cpp
+++ b/src/handles/write-handle.cpp
@@ -51,6 +51,12 @@
                           bind(&WriteHandle::onValidationFailed, this, _1));
 }
 
+void
+WriteHandle::onRegisterSuccess(const Name& prefix)
+{
+  std::cerr << "Successfully registered prefix " << prefix << std::endl;
+}
+
 // onRegisterFailed.
 void
 WriteHandle::onRegisterFailed(const Name& prefix, const std::string& reason)
@@ -180,11 +186,13 @@
   insertPrefix.append(prefix).append("insert");
   getFace().setInterestFilter(insertPrefix,
                               bind(&WriteHandle::onInterest, this, _1, _2),
+                              bind(&WriteHandle::onRegisterSuccess, this, _1),
                               bind(&WriteHandle::onRegisterFailed, this, _1, _2));
   Name insertCheckPrefix;
   insertCheckPrefix.append(prefix).append("insert check");
   getFace().setInterestFilter(insertCheckPrefix,
                               bind(&WriteHandle::onCheckInterest, this, _1, _2),
+                              bind(&WriteHandle::onRegisterSuccess, this, _1),
                               bind(&WriteHandle::onRegisterFailed, this, _1, _2));
 }
 
diff --git a/src/handles/write-handle.hpp b/src/handles/write-handle.hpp
index 075e78c..59fefb6 100644
--- a/src/handles/write-handle.hpp
+++ b/src/handles/write-handle.hpp
@@ -112,6 +112,9 @@
   void
   onValidationFailed(const shared_ptr<const Interest>& interest);
 
+  void
+  onRegisterSuccess(const Name& prefix);
+
   /**
    * @brief insert command prefix register failed
    */