-// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
#include <boost/foreach.hpp>
+using namespace isc::process;
+
namespace isc {
namespace d2 {
/// and any other DHCP-DDNS specific information that needs to be accessible
/// during configuration parsing as well as to the application as a whole.
/// It is derived from the context base class, DCfgContextBase.
-class D2CfgContext : public DCfgContextBase {
+class D2CfgContext : public process::DCfgContextBase {
public:
/// @brief Constructor
D2CfgContext();
/// @brief Creates a clone of this context object.
///
/// @return returns a pointer to the new clone.
- virtual DCfgContextBasePtr clone() {
- return (DCfgContextBasePtr(new D2CfgContext(*this)));
+ virtual process::DCfgContextBasePtr clone() {
+ return (process::DCfgContextBasePtr(new D2CfgContext(*this)));
}
/// @brief Fetches a reference to the D2Params
/// configuration. This includes services for parsing sets of configuration
/// values, storing the parsed information in its converted form,
/// and retrieving the information on demand.
-class D2CfgMgr : public DCfgMgrBase {
+class D2CfgMgr : public process::DCfgMgrBase {
public:
/// @brief Reverse zone suffix added to IPv4 addresses for reverse lookups
/// @todo This should be configurable.
/// error.
///
/// @return Returns a DCfgContextBasePtr to the new context instance.
- virtual DCfgContextBasePtr createNewContext();
+ virtual process::DCfgContextBasePtr createNewContext();
};
/// @brief Defines a shared pointer to D2CfgMgr.
-// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
#include <sstream>
#include <string>
+using namespace isc::process;
+
namespace isc {
namespace d2 {
///
/// This class implements a concrete version of the base class by supplying a
/// "clone" method.
-class DScalarContext : public DCfgContextBase {
+class DScalarContext : public process::DCfgContextBase {
public:
/// @brief Constructor
/// @brief Creates a clone of a DStubContext.
///
/// @return returns a pointer to the new clone.
- virtual DCfgContextBasePtr clone() {
- return (DCfgContextBasePtr(new DScalarContext(*this)));
+ virtual process::DCfgContextBasePtr clone() {
+ return (process::DCfgContextBasePtr(new DScalarContext(*this)));
}
protected:
#include <stdlib.h>
+using namespace isc::process;
+
namespace isc {
namespace d2 {
/// DControllerBase a templated class but the labor savings versus the
/// potential number of virtual methods which may be overridden didn't seem
/// worth the clutter at this point.
-class D2Controller : public DControllerBase {
+class D2Controller : public process::DControllerBase {
public:
/// @brief Static singleton instance method. This method returns the
/// base class singleton instance member. It instantiates the singleton
/// and sets the base class instance member upon first invocation.
///
/// @return returns the pointer reference to the singleton instance.
- static DControllerBasePtr& instance();
+ static process::DControllerBasePtr& instance();
/// @brief Destructor.
virtual ~D2Controller();
/// Note the caller is responsible for destructing the process. This
/// is handled by the base class, which wraps this pointer with a smart
/// pointer.
- virtual DProcessBase* createProcess();
+ virtual process::DProcessBase* createProcess();
/// @brief Constructor is declared private to maintain the integrity of
/// the singleton instance.
#include <d2/d2_cfg_mgr.h>
#include <d2/d2_process.h>
+using namespace isc::process;
+
namespace isc {
namespace d2 {
/// to receive DNS mapping change requests and carry them out.
/// It implements the DProcessBase interface, which structures it such that it
/// is a managed "application", controlled by a management layer.
-class D2Process : public DProcessBase {
+class D2Process : public process::DProcessBase {
public:
/// @brief Defines the shutdown types supported by D2Process
#include <iostream>
using namespace isc::d2;
+using namespace isc::process;
using namespace std;
/// This file contains entry point (main() function) for standard DHCP-DDNS
using namespace std;
using namespace isc;
using namespace isc::d2;
+using namespace isc::process;
namespace {
#include <sstream>
+using namespace isc::process;
using namespace boost::posix_time;
namespace isc {
using namespace isc;
using namespace isc::config;
using namespace isc::d2;
+using namespace isc::process;
using namespace boost::posix_time;
namespace {
using namespace isc;
using namespace isc::dhcp_ddns;
using namespace isc::d2;
+using namespace isc::process;
namespace {
using namespace isc::asiolink;
namespace isc {
-namespace d2 {
+namespace process {
// *********************** DCfgContextBase *************************
-// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
#endif
namespace isc {
-namespace d2 {
+namespace process {
/// @brief Defines a map of ConstElementPtrs keyed by name
typedef std::map<std::string, isc::data::ConstElementPtr> ElementMap;
typedef boost::shared_ptr<DCfgMgrBase> DCfgMgrBasePtr;
-}; // end of isc::d2 namespace
+}; // end of isc::process namespace
}; // end of isc namespace
#endif // D_CFG_MGR_H
#include <unistd.h>
namespace isc {
-namespace d2 {
+namespace process {
DControllerBasePtr DControllerBase::controller_;
return (tmp.str());
}
-}; // namespace isc::d2
+}; // namespace isc::process
}; // namespace isc
namespace isc {
-namespace d2 {
+namespace process {
/// @brief Exception thrown when the command line is invalid.
class InvalidUsage : public isc::Exception {
friend class DControllerTest;
};
-}; // namespace isc::d2
+}; // namespace isc::process
}; // namespace isc
#endif
#include <process/d_log.h>
namespace isc {
-namespace d2 {
+namespace process {
/// @brief Defines the logger used within libkea-process library.
isc::log::Logger dctl_logger("dctl");
-} // namespace d2
+} // namespace process
} // namespace isc
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef D2_LOG_H
-#define D2_LOG_H
+#ifndef D_LOG_H
+#define D_LOG_H
#include <log/logger_support.h>
#include <log/macros.h>
#include <process/process_messages.h>
namespace isc {
-namespace d2 {
+namespace process {
/// Define the loggers used within libkea-process library.
extern isc::log::Logger dctl_logger;
-} // namespace d2
+} // namespace process
} // namespace isc
-#endif // D2_LOG_H
+#endif // D_LOG_H
#include <exceptions/exceptions.h>
namespace isc {
-namespace d2 {
+namespace process {
/// @brief Exception thrown if the process encountered an operational error.
class DProcessBaseError : public isc::Exception {
/// @brief Defines a shared pointer to DProcessBase.
typedef boost::shared_ptr<DProcessBase> DProcessBasePtr;
-}; // namespace isc::d2
+}; // namespace isc::process
}; // namespace isc
#endif
#include <process/io_service_signal.h>
namespace isc {
-namespace d2 {
+namespace process {
IOSignal::IOSignal (asiolink::IOService& io_service, int signum,
IOSignalHandler handler)
signals_.clear();
}
-}; // end of isc::d2 namespace
+}; // end of isc::process namespace
}; // end of isc namespace
-// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
#include <stdint.h>
namespace isc {
-namespace d2 {
+namespace process {
/// @brief Exception thrown if IOSignal encounters an error.
class IOSignalError : public isc::Exception {
/// create the signals, house them until they are delivered, and dequeue them
/// so they can be been handled. To generate an IOSignal when an OS signal
/// arrives, the process's OS signal handler simply calls @ref
-/// isc::d2::IOSignalQueue::pushSignal() with the appropriate values.
+/// isc::process::IOSignalQueue::pushSignal() with the appropriate values.
///
/// @note that an IOSignalQueue requires a non-null IOServicePtr to construct.
/// This ensures that the IOService cannot be destroyed before any pending
/// one service, each service must have its own queue.
///
/// To dequeue the IOSignal inside the caller's IOSignalHandler, one simply
-/// invokes @ref isc::d2::IOSignalQueue::popSignal() passing it the sequence_id
-/// parameter passed to the handler. This method returns a pointer to
-/// instigating IOSignal from which the value of OS signal (i.e. SIGINT,
-/// SIGUSR1...) can be obtained. Note that calling popSignal() removes the
-/// IOSignalPtr from the queue, which should reduce its reference count to
-/// zero upon exiting the handler (unless a delibrate copy of it is made).
+/// invokes @ref isc::process::IOSignalQueue::popSignal() passing it the
+/// sequence_id parameter passed to the handler. This method returns a
+/// pointer to instigating IOSignal from which the value of OS signal (i.e.
+/// SIGINT, SIGUSR1...) can be obtained. Note that calling popSignal()
+/// removes the IOSignalPtr from the queue, which should reduce its
+/// reference count to zero upon exiting the handler (unless a delibrate
+/// copy of it is made).
///
/// A typical IOSignalHandler might be structured as follows:
/// @code
typedef boost::shared_ptr<IOSignalQueue> IOSignalQueuePtr;
-}; // end of isc::d2 namespace
+}; // end of isc::process namespace
}; // end of isc namespace
#endif // IO_SERVICE_SIGNAL_H
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-$NAMESPACE isc::d2
+$NAMESPACE isc::process
% DCTL_ALREADY_RUNNING %1 already running? %2
This is an error message that occurs when a module encounters a pre-existing
using namespace std;
using namespace isc;
using namespace isc::config;
-using namespace isc::d2;
+using namespace isc::process;
using namespace boost::posix_time;
namespace {
using namespace boost::posix_time;
namespace isc {
-namespace d2 {
+namespace process {
/// @brief Test fixture class for testing DControllerBase class. This class
/// derives from DControllerTest and wraps a DStubController. DStubController
#include <queue>
namespace isc {
-namespace d2 {
+namespace process {
/// @brief Test fixture for testing the use of IOSignals.
///
EXPECT_EQ(sigusr2_cnt, (stop_at_count_/3));
}
-}; // end of isc::d2 namespace
+}; // end of isc::process namespace
}; // end of isc namespace
using namespace boost::asio;
namespace isc {
-namespace d2 {
+namespace process {
const char* valid_d2_config = "{ "
"\"ip-address\" : \"127.0.0.1\" , "
return (parser);
}
-}; // namespace isc::d2
+}; // namespace isc::process
}; // namespace isc
#include <sstream>
namespace isc {
-namespace d2 {
+namespace process {
/// @brief Provides a valid DHCP-DDNS configuration for testing basic
/// parsing fundamentals.
/// testing configuration parsing fundamentals.
extern const char* valid_d2_config;
-}; // namespace isc::d2
+}; // namespace isc::process
}; // namespace isc
#endif