management: Controller accepts CommandOptions
refs #2039
The following are deprecated:
* Controller::start overloads, except the overload taking CommandOptions
* Controller::Sign typedef
* Controller::getDefaultCommandTimeout
* ControlCommand::getPrefix
* ControlCommand::getRequestName(ControlParameters)
Change-Id: I8c405498597bdca115b71eec87acf23d28a266b1
diff --git a/src/management/nfd-control-command.hpp b/src/management/nfd-control-command.hpp
index 8285a6d..e226486 100644
--- a/src/management/nfd-control-command.hpp
+++ b/src/management/nfd-control-command.hpp
@@ -47,16 +47,8 @@
}
};
- /** \return Name prefix of this ControlCommand
- */
- const Name&
- getPrefix() const
- {
- return m_prefix;
- }
-
/** \brief validate request parameters
- * \throw ArgumentError
+ * \throw ArgumentError if parameters are invalid
*/
virtual void
validateRequest(const ControlParameters& parameters) const;
@@ -67,7 +59,7 @@
applyDefaultsToRequest(ControlParameters& parameters) const;
/** \brief validate response parameters
- * \throw ArgumentError
+ * \throw ArgumentError if parameters are invalid
*/
virtual void
validateResponse(const ControlParameters& parameters) const;
@@ -78,6 +70,21 @@
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;
+
+public: // deprecated
+ /** \return Name prefix of this ControlCommand
+ * \deprecated use getRequestName
+ */
+ const Name&
+ getPrefix() const;
+
+ /** \brief construct the Name for a request Interest
+ * \throw ArgumentError if parameters are invalid
+ * \deprecated use the two-argument overload
*/
Name
getRequestName(const ControlParameters& parameters) const;
@@ -133,7 +140,12 @@
FieldValidator m_responseValidator;
private:
- Name m_prefix;
+ name::Component m_module;
+ name::Component m_verb;
+
+ /** \deprecated kept to support getPrefix
+ */
+ mutable Name m_prefix;
};