24 CalloutHandle::CalloutHandle(
const boost::shared_ptr<CalloutManager>& manager,
25 const boost::shared_ptr<LibraryManagerCollection>& lmcoll)
26 : lm_collection_(lmcoll), arguments_(), context_collection_(),
27 manager_(manager), server_hooks_(
ServerHooks::getServerHooks()),
28 current_library_(-1), current_hook_(-1), next_step_(NEXT_STEP_CONTINUE) {
46 context_collection_.clear();
67 for (ElementCollection::const_iterator i = arguments_.begin();
68 i != arguments_.end(); ++i) {
69 names.push_back(i->first);
77 return (boost::make_shared<ParkingLotHandle>(server_hooks_.
getParkingLotPtr(current_hook_)));
85 CalloutHandle::getContextForLibrary() {
88 return (context_collection_[current_library_]);
95 CalloutHandle::getContextForLibrary()
const {
96 auto libcontext = context_collection_.find(current_library_);
97 if (libcontext == context_collection_.end()) {
98 isc_throw(NoSuchCalloutContext,
"unable to find callout context "
99 "associated with the current library index (" << current_library_ <<
104 return (libcontext->second);
112 vector<string> names;
114 for (ElementCollection::const_iterator i = elements.begin();
115 i != elements.end(); ++i) {
116 names.push_back(i->first);
130 hook = server_hooks_.
getName(current_hook_);
142 : callout_handle_(callout_handle) {
143 if (!callout_handle_) {
155 ScopedCalloutHandleState::resetState() {
158 callout_handle_->deleteAllArguments();
static const int CONTEXT_CREATE
Index numbers for pre-defined hooks.
std::string getHookName() const
Get hook name.
ParkingLotPtr getParkingLotPtr(const int hook_index)
Returns pointer to the ParkingLot for the specified hook index.
~ScopedCalloutHandleState()
Destructor.
ParkingLotHandlePtr getParkingLotHandlePtr() const
Returns pointer to the parking lot handle for this hook point.
ScopedCalloutHandleState(const CalloutHandlePtr &callout_handle)
Constructor.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
std::string getName(int index) const
Get hook name.
~CalloutHandle()
Destructor.
std::map< std::string, boost::any > ElementCollection
Typedef to allow abbreviation of iterator specification in methods.
static const int CONTEXT_DESTROY
Defines the logger used by the top-level component of kea-dhcp-ddns.
boost::shared_ptr< CalloutHandle > CalloutHandlePtr
A shared pointer to a CalloutHandle object.
std::vector< std::string > getArgumentNames() const
Get argument names.
boost::shared_ptr< ParkingLotHandle > ParkingLotHandlePtr
Pointer to the parking lot handle.
std::vector< std::string > getContextNames() const
Get context names.