Kea  1.9.9-git
simple_add.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_ADD_H
8 #define SIMPLE_ADD_H
9 
11 
12 #include <d2/nc_trans.h>
13 #include <dns/rdata.h>
14 
15 namespace isc {
16 namespace d2 {
17 
20 public:
21  SimpleAddTransactionError(const char* file, size_t line,
22  const char* what) :
23  isc::Exception(file, line, what) { };
24 };
25 
48 public:
49 
51  static const int REPLACING_FWD_ADDRS_ST = NCT_DERIVED_STATE_MIN + 1;
53 
57 
59  static const int FQDN_IN_USE_EVT = NCT_DERIVED_EVENT_MIN + 1;
61 
65 
80  DdnsDomainPtr& forward_domain,
81  DdnsDomainPtr& reverse_domain,
82  D2CfgMgrPtr& cfg_mgr);
83 
85  virtual ~SimpleAddTransaction();
86 
87 protected:
94  virtual void defineEvents();
95 
103  virtual void verifyEvents();
104 
111  virtual void defineStates();
112 
120  virtual void verifyStates();
121 
142  void readyHandler();
143 
166 
190 
235 
277 
292  void processAddOkHandler();
293 
311 
330 
348 };
349 
351 typedef boost::shared_ptr<SimpleAddTransaction> SimpleAddTransactionPtr;
352 
353 } // namespace isc::d2
354 } // namespace isc
355 #endif
This file defines the class NameChangeTransaction.
virtual void defineEvents()
Adds events defined by SimpleAddTransaction to the event set.
Definition: simple_add.cc:47
Embodies the "life-cycle" required to carry out a DDNS Add update.
Definition: simple_add.h:47
void selectingFwdServerHandler()
State handler for SELECTING_FWD_SERVER_ST.
Definition: simple_add.cc:139
boost::shared_ptr< DdnsDomain > DdnsDomainPtr
Defines a pointer for DdnsDomain instances.
Definition: d2_config.h:591
static const int REPLACING_FWD_ADDRS_ST
State that attempts to add forward address records.
Definition: simple_add.h:52
void replacingFwdAddrsHandler()
State handler for REPLACING_FWD_ADDRS_ST.
Definition: simple_add.cc:168
virtual ~SimpleAddTransaction()
Destructor.
Definition: simple_add.cc:43
boost::shared_ptr< NameChangeRequest > NameChangeRequestPtr
Defines a pointer to a NameChangeRequest.
Definition: ncr_msg.h:212
virtual void verifyStates()
Validates the contents of the set of states.
Definition: simple_add.cc:103
static const int NCT_DERIVED_STATE_MIN
Value at which custom states in a derived class should begin.
Definition: nc_trans.h:108
static const int FQDN_IN_USE_EVT
Event sent when an add attempt fails with address in use.
Definition: simple_add.h:60
void processAddOkHandler()
State handler for PROCESS_TRANS_OK_ST.
Definition: simple_add.cc:416
static const int NCT_DERIVED_EVENT_MIN
Value at which custom events in a derived class should begin.
Definition: nc_trans.h:144
void selectingRevServerHandler()
State handler for SELECTING_REV_SERVER_ST.
Definition: simple_add.cc:277
void replacingRevPtrsHandler()
State handler for REPLACING_REV_PTRS_ST.
Definition: simple_add.cc:307
void buildReplaceRevPtrsRequest()
Builds a DNS request to replace a reverse DNS entry for an FQDN.
Definition: simple_add.cc:501
boost::shared_ptr< D2CfgMgr > D2CfgMgrPtr
Defines a shared pointer to D2CfgMgr.
Definition: d2_cfg_mgr.h:334
void readyHandler()
State handler for READY_ST.
Definition: simple_add.cc:119
static const int FQDN_NOT_IN_USE_EVT
Event sent when replace attempt to fails with address not in use.
Definition: simple_add.h:63
static const int REPLACING_REV_PTRS_ST
State that attempts to replace reverse PTR records.
Definition: simple_add.h:55
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.
void buildReplaceFwdAddressRequest()
Builds a DNS request to add/replace a forward DNS entry for an FQDN.
Definition: simple_add.cc:451
boost::shared_ptr< SimpleAddTransaction > SimpleAddTransactionPtr
Defines a pointer to a SimpleAddTransaction.
Definition: simple_add.h:351
Thrown if the SimpleAddTransaction encounters a general error.
Definition: simple_add.h:19
virtual void defineStates()
Adds states defined by SimpleAddTransaction to the state set.
Definition: simple_add.cc:75
Embodies the "life-cycle" required to carry out a DDNS update.
Definition: nc_trans.h:77
virtual void verifyEvents()
Validates the contents of the set of events.
Definition: simple_add.cc:57
SimpleAddTransactionError(const char *file, size_t line, const char *what)
Definition: simple_add.h:21
SimpleAddTransaction(asiolink::IOServicePtr &io_service, dhcp_ddns::NameChangeRequestPtr &ncr, DdnsDomainPtr &forward_domain, DdnsDomainPtr &reverse_domain, D2CfgMgrPtr &cfg_mgr)
Constructor.
Definition: simple_add.cc:30
void processAddFailedHandler()
State handler for PROCESS_TRANS_FAILED_ST.
Definition: simple_add.cc:433