mgmt: move management/nfd-* to mgmt/nfd/
refs #3760
Change-Id: Ib4bde3412b5c39b9f4f46113199cebe78704505e
diff --git a/src/management/nfd-control-command.hpp b/src/management/nfd-control-command.hpp
index 169d837..393e174 100644
--- a/src/management/nfd-control-command.hpp
+++ b/src/management/nfd-control-command.hpp
@@ -19,330 +19,7 @@
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
*/
-#ifndef NDN_MANAGEMENT_NFD_CONTROL_COMMAND_HPP
-#define NDN_MANAGEMENT_NFD_CONTROL_COMMAND_HPP
-
-#include "nfd-control-parameters.hpp"
-
-namespace ndn {
-namespace nfd {
-
-/**
- * \ingroup management
- * \brief base class of NFD ControlCommand
- * \sa http://redmine.named-data.net/projects/nfd/wiki/ControlCommand
+/** \file
+ * \deprecated Use mgmt/nfd/control-command.hpp
*/
-class ControlCommand : noncopyable
-{
-public:
- /** \brief represents an error in ControlParameters
- */
- class ArgumentError : public std::invalid_argument
- {
- public:
- explicit
- ArgumentError(const std::string& what)
- : std::invalid_argument(what)
- {
- }
- };
-
- virtual
- ~ControlCommand();
-
- /** \brief validate request parameters
- * \throw ArgumentError if parameters are invalid
- */
- virtual void
- validateRequest(const ControlParameters& parameters) const;
-
- /** \brief apply default values to missing fields in request
- */
- virtual void
- applyDefaultsToRequest(ControlParameters& parameters) const;
-
- /** \brief validate response parameters
- * \throw ArgumentError if parameters are invalid
- */
- virtual void
- validateResponse(const ControlParameters& parameters) const;
-
- /** \brief apply default values to missing fields in response
- */
- virtual void
- applyDefaultsToResponse(ControlParameters& parameters) const;
-
- /** \brief construct the Name for a request Interest
- * \throw ArgumentError if parameters are invalid
- */
- Name
- getRequestName(const Name& commandPrefix, const ControlParameters& parameters) const;
-
-protected:
- ControlCommand(const std::string& module, const std::string& verb);
-
- class FieldValidator
- {
- public:
- FieldValidator();
-
- /** \brief declare a required field
- */
- FieldValidator&
- required(ControlParameterField field)
- {
- m_required[field] = true;
- return *this;
- }
-
- /** \brief declare an optional field
- */
- FieldValidator&
- optional(ControlParameterField field)
- {
- m_optional[field] = true;
- return *this;
- }
-
- /** \brief verify that all required fields are present,
- * and all present fields are either required or optional
- * \throw ArgumentError
- */
- void
- validate(const ControlParameters& parameters) const;
-
- private:
- std::vector<bool> m_required;
- std::vector<bool> m_optional;
- };
-
-protected:
- /** \brief FieldValidator for request ControlParameters
- *
- * Constructor of subclass should populate this validator.
- */
- FieldValidator m_requestValidator;
- /** \brief FieldValidator for response ControlParameters
- *
- * Constructor of subclass should populate this validator.
- */
- FieldValidator m_responseValidator;
-
-private:
- name::Component m_module;
- name::Component m_verb;
-};
-
-
-/**
- * \ingroup management
- * \brief represents a faces/create command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Create-a-face
- */
-class FaceCreateCommand : public ControlCommand
-{
-public:
- FaceCreateCommand();
-
- virtual void
- applyDefaultsToRequest(ControlParameters& parameters) const override;
-
- virtual void
- validateRequest(const ControlParameters& parameters) const override;
-
- virtual void
- validateResponse(const ControlParameters& parameters) const override;
-};
-
-
-/**
- * \ingroup management
- * \brief represents a faces/update command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Update-a-face
- */
-class FaceUpdateCommand : public ControlCommand
-{
-public:
- FaceUpdateCommand();
-
- virtual void
- applyDefaultsToRequest(ControlParameters& parameters) const override;
-
- virtual void
- validateRequest(const ControlParameters& parameters) const override;
-
- /**
- * \note This can only validate ControlParameters in a success response.
- * Failure responses should be validated with validateRequest.
- */
- virtual void
- validateResponse(const ControlParameters& parameters) const override;
-};
-
-
-/**
- * \ingroup management
- * \brief represents a faces/destroy command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Destroy-a-face
- */
-class FaceDestroyCommand : public ControlCommand
-{
-public:
- FaceDestroyCommand();
-
- virtual void
- validateRequest(const ControlParameters& parameters) const override;
-
- virtual void
- validateResponse(const ControlParameters& parameters) const override;
-};
-
-
-/**
- * \ingroup management
- * \brief Base class for faces/[*]-local-control commands
- */
-class FaceLocalControlCommand : public ControlCommand
-{
-public:
- virtual void
- validateRequest(const ControlParameters& parameters) const override;
-
- virtual void
- validateResponse(const ControlParameters& parameters) const override;
-
-protected:
- explicit
- FaceLocalControlCommand(const std::string& verb);
-};
-
-
-/**
- * \ingroup management
- * \brief represents a faces/enable-local-control command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Enable-a-LocalControlHeader-feature
- */
-class FaceEnableLocalControlCommand : public FaceLocalControlCommand
-{
-public:
- FaceEnableLocalControlCommand();
-};
-
-
-/**
- * \ingroup management
- * \brief represents a faces/disable-local-control command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FaceMgmt#Disable-a-LocalControlHeader-feature
- */
-class FaceDisableLocalControlCommand : public FaceLocalControlCommand
-{
-public:
- FaceDisableLocalControlCommand();
-};
-
-
-/**
- * \ingroup management
- * \brief represents a fib/add-nexthop command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FibMgmt#Add-a-nexthop
- */
-class FibAddNextHopCommand : public ControlCommand
-{
-public:
- FibAddNextHopCommand();
-
- virtual void
- applyDefaultsToRequest(ControlParameters& parameters) const override;
-
- virtual void
- validateResponse(const ControlParameters& parameters) const override;
-};
-
-
-/**
- * \ingroup management
- * \brief represents a fib/remove-nexthop command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/FibMgmt#Remove-a-nexthop
- */
-class FibRemoveNextHopCommand : public ControlCommand
-{
-public:
- FibRemoveNextHopCommand();
-
- virtual void
- applyDefaultsToRequest(ControlParameters& parameters) const override;
-
- virtual void
- validateResponse(const ControlParameters& parameters) const override;
-};
-
-
-/**
- * \ingroup management
- * \brief represents a strategy-choice/set command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/StrategyChoice#Set-the-strategy-for-a-namespace
- */
-class StrategyChoiceSetCommand : public ControlCommand
-{
-public:
- StrategyChoiceSetCommand();
-};
-
-
-/**
- * \ingroup management
- * \brief represents a strategy-choice/set command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/StrategyChoice#Unset-the-strategy-for-a-namespace
- */
-class StrategyChoiceUnsetCommand : public ControlCommand
-{
-public:
- StrategyChoiceUnsetCommand();
-
- virtual void
- validateRequest(const ControlParameters& parameters) const override;
-
- virtual void
- validateResponse(const ControlParameters& parameters) const override;
-};
-
-
-/**
- * \ingroup management
- * \brief represents a rib/register command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt#Register-a-route
- */
-class RibRegisterCommand : public ControlCommand
-{
-public:
- RibRegisterCommand();
-
- virtual void
- applyDefaultsToRequest(ControlParameters& parameters) const override;
-
- virtual void
- validateResponse(const ControlParameters& parameters) const override;
-};
-
-
-/**
- * \ingroup management
- * \brief represents a rib/unregister command
- * \sa http://redmine.named-data.net/projects/nfd/wiki/RibMgmt#Unregister-a-route
- */
-class RibUnregisterCommand : public ControlCommand
-{
-public:
- RibUnregisterCommand();
-
- virtual void
- applyDefaultsToRequest(ControlParameters& parameters) const override;
-
- virtual void
- validateResponse(const ControlParameters& parameters) const override;
-};
-
-} // namespace nfd
-} // namespace ndn
-
-#endif // NDN_MANAGEMENT_NFD_CONTROL_COMMAND_HPP
+#include "../mgmt/nfd/control-command.hpp"