Kea  1.9.9-git
simple_remove.h
Go to the documentation of this file.
1 // Copyright (C) 2020 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
7 #ifndef SIMPLE_REMOVE_H
8 #define SIMPLE_REMOVE_H
9 
11 
12 #include <d2/nc_trans.h>
13 
14 namespace isc {
15 namespace d2 {
16 
19 public:
20  SimpleRemoveTransactionError(const char* file, size_t line,
21  const char* what) :
22  isc::Exception(file, line, what) { };
23 };
24 
50 public:
51 
53  static const int REMOVING_FWD_RRS_ST = NCT_DERIVED_STATE_MIN + 2;
55 
59 
61 
64 
79  DdnsDomainPtr& forward_domain,
80  DdnsDomainPtr& reverse_domain,
81  D2CfgMgrPtr& cfg_mgr);
82 
84  virtual ~SimpleRemoveTransaction();
85 
86 protected:
93  virtual void defineEvents();
94 
102  virtual void verifyEvents();
103 
110  virtual void defineStates();
111 
119  virtual void verifyStates();
120 
141  void readyHandler();
142 
165 
189 
233  void removingFwdRRsHandler();
234 
275  void removingRevPtrsHandler();
276 
291  void processRemoveOkHandler();
292 
311 
327 
343 };
344 
346 typedef boost::shared_ptr<SimpleRemoveTransaction> SimpleRemoveTransactionPtr;
347 
348 
349 } // namespace isc::d2
350 } // namespace isc
351 #endif
This file defines the class NameChangeTransaction.
virtual void verifyStates()
Validates the contents of the set of states.
void processRemoveOkHandler()
State handler for PROCESS_TRANS_OK_ST.
void selectingFwdServerHandler()
State handler for SELECTING_FWD_SERVER_ST.
static const int REMOVING_REV_PTRS_ST
State that attempts to remove reverse PTR records.
Definition: simple_remove.h:57
virtual ~SimpleRemoveTransaction()
Destructor.
void readyHandler()
State handler for READY_ST.
boost::shared_ptr< DdnsDomain > DdnsDomainPtr
Defines a pointer for DdnsDomain instances.
Definition: d2_config.h:591
static const int REMOVING_FWD_RRS_ST
State that attempts to remove FQDN/IP and DHCID RRs for an FQDN.
Definition: simple_remove.h:54
boost::shared_ptr< NameChangeRequest > NameChangeRequestPtr
Defines a pointer to a NameChangeRequest.
Definition: ncr_msg.h:212
void selectingRevServerHandler()
State handler for SELECTING_REV_SERVER_ST.
static const int NCT_DERIVED_STATE_MIN
Value at which custom states in a derived class should begin.
Definition: nc_trans.h:108
SimpleRemoveTransaction(asiolink::IOServicePtr &io_service, dhcp_ddns::NameChangeRequestPtr &ncr, DdnsDomainPtr &forward_domain, DdnsDomainPtr &reverse_domain, D2CfgMgrPtr &cfg_mgr)
Event sent when replace attempt to fails with address not in use.
Thrown if the SimpleRemoveTransaction encounters a general error.
Definition: simple_remove.h:18
virtual void defineEvents()
Adds events defined by SimpleRemoveTransaction to the event set.
void buildRemoveFwdRRsRequest()
Builds a DNS request to remove all forward DNS RRs for a FQDN.
boost::shared_ptr< D2CfgMgr > D2CfgMgrPtr
Defines a shared pointer to D2CfgMgr.
Definition: d2_cfg_mgr.h:334
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-dhcp-ddns.
boost::shared_ptr< SimpleRemoveTransaction > SimpleRemoveTransactionPtr
Defines a pointer to a SimpleRemoveTransaction.
void buildRemoveRevPtrsRequest()
Builds a DNS request to remove a reverse DNS entry for a FQDN.
Embodies the "life-cycle" required to carry out a DDNS Remove update.
Definition: simple_remove.h:49
Embodies the "life-cycle" required to carry out a DDNS update.
Definition: nc_trans.h:77
void removingRevPtrsHandler()
State handler for REMOVING_REV_PTRS_ST.
void removingFwdRRsHandler()
State handler for REMOVING_FWD_RRS_ST.
SimpleRemoveTransactionError(const char *file, size_t line, const char *what)
Definition: simple_remove.h:20
void processRemoveFailedHandler()
State handler for PROCESS_TRANS_FAILED_ST.
virtual void defineStates()
Adds states defined by SimpleRemoveTransaction to the state set.
virtual void verifyEvents()
Validates the contents of the set of events.