Commit 56d8ac9a authored by Francis Dupont's avatar Francis Dupont
Browse files

[#1247] More renames

parent 35a0ccf1
......@@ -448,7 +448,7 @@ public:
<< audit_entry->getObjectId() << ", "
<< static_cast<int>(audit_entry->getModificationType()) << ", "
<< audit_entry->getModificationTime() << ", "
<< audit_entry->getModificationId() << ", "
<< audit_entry->getRevisionId() << ", "
<< audit_entry->getLogMessage()
<< std::endl;
}
......@@ -4130,7 +4130,7 @@ TEST_F(MySqlConfigBackendDHCPv4Test, multipleAuditEntries) {
size_t partial_size =
cbptr_->getRecentAuditEntries(server_selector,
(*it)->getModificationTime(),
(*it)->getModificationId()).size();
(*it)->getRevisionId()).size();
EXPECT_EQ(partial_size + 1,
std::distance(it, mod_time_idx.end()));
}
......
......@@ -496,7 +496,7 @@ public:
<< audit_entry->getObjectId() << ", "
<< static_cast<int>(audit_entry->getModificationType()) << ", "
<< audit_entry->getModificationTime() << ", "
<< audit_entry->getModificationId() << ", "
<< audit_entry->getRevisionId() << ", "
<< audit_entry->getLogMessage()
<< std::endl;
}
......@@ -4305,7 +4305,7 @@ TEST_F(MySqlConfigBackendDHCPv6Test, multipleAuditEntries) {
size_t partial_size =
cbptr_->getRecentAuditEntries(server_selector,
(*it)->getModificationTime(),
(*it)->getModificationId()).size();
(*it)->getRevisionId()).size();
EXPECT_EQ(partial_size + 1,
std::distance(it, mod_time_idx.end()));
}
......
......@@ -15,13 +15,13 @@ AuditEntry::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 id,
const uint64_t revision_id,
const std::string& log_message)
: object_type_(object_type),
object_id_(object_id),
modification_type_(modification_type),
modification_time_(modification_time),
id_(id),
revision_id_(revision_id),
log_message_(log_message) {
// Check if the provided values are sane.
validate();
......@@ -30,13 +30,13 @@ AuditEntry::AuditEntry(const std::string& object_type,
AuditEntry::AuditEntry(const std::string& object_type,
const uint64_t object_id,
const ModificationType& modification_type,
const uint64_t id,
const uint64_t revision_id,
const std::string& log_message)
: object_type_(object_type),
object_id_(object_id),
modification_type_(modification_type),
modification_time_(boost::posix_time::microsec_clock::local_time()),
id_(id),
revision_id_(revision_id),
log_message_(log_message) {
// Check if the provided values are sane.
validate();
......@@ -47,11 +47,12 @@ AuditEntry::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 id,
const uint64_t revision_id,
const std::string& log_message) {
return (boost::make_shared<AuditEntry>(object_type, object_id,
modification_type,
modification_time, id,
modification_time,
revision_id,
log_message));
}
......@@ -59,10 +60,11 @@ AuditEntryPtr
AuditEntry::create(const std::string& object_type,
const uint64_t object_id,
const ModificationType& modification_type,
const uint64_t id,
const uint64_t revision_id,
const std::string& log_message) {
return (boost::make_shared<AuditEntry>(object_type, object_id,
modification_type, id,
modification_type,
revision_id,
log_message));
}
......
......@@ -82,14 +82,14 @@ public:
/// @param object_id identifier of the modified record in this table.
/// @param modification_type type of the modification, e.g. DELETE.
/// @param modification_time time of modification for that record.
/// @param id identifier of the revision.
/// @param revision_id identifier of the revision.
/// @param log_message optional log message associated with the
/// modification.
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 id,
const uint64_t revision_id,
const std::string& log_message);
/// @brief Constructor using default modification time.
......@@ -97,13 +97,13 @@ public:
/// @param object_type name of the table where data was modified.
/// @param object_id identifier of the modified record in this table.
/// @param modification_type type of the modification, e.g. DELETE.
/// @param id identifier of the revision.
/// @param revision_id identifier of the revision.
/// @param log_message optional log message associated with the
/// modification.
AuditEntry(const std::string& object_type,
const uint64_t object_id,
const ModificationType& modification_type,
const uint64_t id,
const uint64_t revision_id,
const std::string& log_message);
/// @brief Factory function creating an instance of @c AuditEntry.
......@@ -117,7 +117,7 @@ public:
/// @param object_id identifier of the modified record in this table.
/// @param modification_type type of the modification, e.g. DELETE.
/// @param modification_time time of modification for that record.
/// @param id identifier of the revision.
/// @param revision_id identifier of the revision.
/// @param log_message optional log message associated with the
/// modification.
///
......@@ -126,7 +126,7 @@ public:
const uint64_t object_id,
const ModificationType& modification_type,
const boost::posix_time::ptime& modification_time,
const uint64_t id,
const uint64_t revision_id,
const std::string& log_message);
/// @brief Factory function creating an instance of @c AuditEntry.
......@@ -139,7 +139,7 @@ public:
/// @param object_type name of the table where data was modified.
/// @param object_id identifier of the modified record in this table.
/// @param modification_type type of the modification, e.g. DELETE.
/// @param id identifier of the revision.
/// @param revision_id identifier of the revision.
/// @param log_message optional log message associated with the
/// modification.
///
......@@ -147,7 +147,7 @@ public:
static AuditEntryPtr create(const std::string& object_type,
const uint64_t object_id,
const ModificationType& modification_type,
const uint64_t id,
const uint64_t revision_id,
const std::string& log_message);
/// @brief Returns object type.
......@@ -181,8 +181,8 @@ public:
/// @brief Returns revision id aka modification id.
///
/// @return Identifier of the revision.
uint64_t getModificationId() const {
return (id_);
uint64_t getRevisionId() const {
return (revision_id_);
}
/// @brief Returns log message.
......@@ -213,7 +213,7 @@ private:
boost::posix_time::ptime modification_time_;
/// @brief Revision id aka modification id.
uint64_t id_;
uint64_t revision_id_;
/// @brief Log message.
std::string log_message_;
......@@ -267,7 +267,7 @@ typedef boost::multi_index_container<
boost::multi_index::const_mem_fun<
AuditEntry,
uint64_t,
&AuditEntry::getModificationId
&AuditEntry::getRevisionId
>
>
>,
......
......@@ -96,7 +96,7 @@ TEST_F(AuditEntryTest, create) {
EXPECT_EQ(10, audit_entry->getObjectId());
EXPECT_EQ(AuditEntry::ModificationType::DELETE, audit_entry->getModificationType());
EXPECT_EQ(fixedTime(), audit_entry->getModificationTime());
EXPECT_EQ(123, audit_entry->getModificationId());
EXPECT_EQ(123, audit_entry->getRevisionId());
EXPECT_EQ("deleted subnet 10", audit_entry->getLogMessage());
}
......@@ -110,7 +110,7 @@ TEST_F(AuditEntryTest, create) {
EXPECT_EQ(123, audit_entry->getObjectId());
EXPECT_EQ(AuditEntry::ModificationType::CREATE, audit_entry->getModificationType());
EXPECT_TRUE(almostEqualTime(audit_entry->getModificationTime()));
EXPECT_EQ(234, audit_entry->getModificationId());
EXPECT_EQ(234, audit_entry->getRevisionId());
EXPECT_TRUE(audit_entry->getLogMessage().empty());
}
}
......
......@@ -341,7 +341,7 @@ protected:
// and pick the latest entry.
const auto& index = audit_entries.get<db::AuditEntryModificationTimeIdTag>();
last_audit_revision_time_ = (*index.rbegin())->getModificationTime();
last_audit_revision_id_ = (*index.rbegin())->getModificationId();
last_audit_revision_id_ = (*index.rbegin())->getRevisionId();
}
/// @brief Stores the most recent audit revision timestamp.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment