chunks: switch to v2::ValidatorNull

refs #4089

Change-Id: If23ca4d202ad1b61ee1e56ba0e15a8750c184e03
diff --git a/tools/chunks/catchunks/consumer.hpp b/tools/chunks/catchunks/consumer.hpp
index 9996c14..3dcefe6 100644
--- a/tools/chunks/catchunks/consumer.hpp
+++ b/tools/chunks/catchunks/consumer.hpp
@@ -1,8 +1,8 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2016,  Regents of the University of California,
- *                      Colorado State University,
- *                      University Pierre & Marie Curie, Sorbonne University.
+ * Copyright (c) 2016-2017, Regents of the University of California,
+ *                          Colorado State University,
+ *                          University Pierre & Marie Curie, Sorbonne University.
  *
  * This file is part of ndn-tools (Named Data Networking Essential Tools).
  * See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -31,7 +31,8 @@
 #include "discover-version.hpp"
 #include "pipeline-interests.hpp"
 
-#include <ndn-cxx/security/validator.hpp>
+#include <ndn-cxx/security/v2/validation-error.hpp>
+#include <ndn-cxx/security/v2/validator.hpp>
 
 namespace ndn {
 namespace chunks {
@@ -56,10 +57,20 @@
     }
   };
 
+  class DataValidationError : public std::runtime_error
+  {
+  public:
+    explicit
+    DataValidationError(const security::v2::ValidationError& error)
+      : std::runtime_error(boost::lexical_cast<std::string>(error))
+    {
+    }
+  };
+
   /**
    * @brief Create the consumer
    */
-  Consumer(Validator& validator, bool isVerbose, std::ostream& os = std::cout);
+  Consumer(security::v2::Validator& validator, bool isVerbose, std::ostream& os = std::cout);
 
   /**
    * @brief Run the consumer
@@ -72,20 +83,14 @@
   startPipeline(const Data& data);
 
   void
-  onData(const Interest& interest, const Data& data);
-
-  void
-  onDataValidated(shared_ptr<const Data> data);
-
-  void
-  onFailure(const std::string& reason);
+  handleData(const Data& data);
 
 PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   void
   writeInOrderData();
 
 private:
-  Validator& m_validator;
+  security::v2::Validator& m_validator;
   std::ostream& m_outputStream;
   unique_ptr<DiscoverVersion> m_discover;
   unique_ptr<PipelineInterests> m_pipeline;