11 #include <boost/make_shared.hpp>
17 const uint64_t object_id,
19 const boost::posix_time::ptime& modification_time,
20 const uint64_t revision_id,
21 const std::string& log_message)
22 : object_type_(object_type),
23 object_id_(object_id),
24 modification_type_(modification_type),
25 modification_time_(modification_time),
26 revision_id_(revision_id),
27 log_message_(log_message) {
33 const uint64_t object_id,
35 const uint64_t revision_id,
36 const std::string& log_message)
37 : object_type_(object_type),
38 object_id_(object_id),
39 modification_type_(modification_type),
40 modification_time_(
boost::posix_time::microsec_clock::local_time()),
41 revision_id_(revision_id),
42 log_message_(log_message) {
49 const uint64_t object_id,
51 const boost::posix_time::ptime& modification_time,
52 const uint64_t revision_id,
53 const std::string& log_message) {
54 return (boost::make_shared<AuditEntry>(object_type, object_id,
63 const uint64_t object_id,
65 const uint64_t revision_id,
66 const std::string& log_message) {
67 return (boost::make_shared<AuditEntry>(object_type, object_id,
74 AuditEntry::validate()
const {
76 if (object_type_.empty()) {
81 }
else if (modification_time_.is_not_a_date_time()) {
83 "object in the database audit entry");
boost::shared_ptr< AuditEntry > AuditEntryPtr
Pointer to the AuditEntry object.
#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...
Defines the logger used by the top-level component of kea-dhcp-ddns.
static AuditEntryPtr create(const std::string &object_type, const uint64_t object_id, const ModificationType &modification_type, const boost::posix_time::ptime &modification_time, const uint64_t revision_id, const std::string &log_message)
Factory function creating an instance of AuditEntry.
ModificationType
Types of the modifications.
AuditEntry(const std::string &object_type, const uint64_t object_id, const ModificationType &modification_type, const boost::posix_time::ptime &modification_time, const uint64_t revision_id, const std::string &log_message)
Constructor using explicit modification time and id.