diff --git a/catalogue/Catalogue.hpp b/catalogue/Catalogue.hpp index 28eabac9e8ea8287afab898ea31c6d357ee2694f..81499d87cba3080322a7a666d8e463bdf6264ee3 100644 --- a/catalogue/Catalogue.hpp +++ b/catalogue/Catalogue.hpp @@ -112,7 +112,15 @@ public: */ virtual void fileWrittenToTape(const TapeFileWritten &event) = 0; - virtual void modifyTapeLastWrittenLog(const std::string &vid, const std::string &drive) = 0; // internal function (noCLI) + /** + * Notifies the CTA catalogue that the specified tape has been mounted in + * order to archive files. + * + * @param vid The volume identifier of the tape. + * @param drive The name of the drive where the tape was mounted. + */ + virtual void tapeMountedForArchive(const std::string &vid, const std::string &drive) = 0; // internal function (noCLI) + virtual void modifyTapeLastReadLog(const std::string &vid, const std::string &drive) = 0; // internal function (noCLI) /** diff --git a/catalogue/CatalogueTest.cpp b/catalogue/CatalogueTest.cpp index a9301b55301d98094097a7febd6b98d9d61dd689..2d8efa0bfe0588521ecb2b28c680fe1400443fd9 100644 --- a/catalogue/CatalogueTest.cpp +++ b/catalogue/CatalogueTest.cpp @@ -2616,7 +2616,7 @@ TEST_P(cta_catalogue_CatalogueTest, tapeLabelled_nonExistentTape) { ASSERT_THROW(m_catalogue->tapeLabelled(vid, labelDrive, lbpIsOn), exception::UserError); } -TEST_P(cta_catalogue_CatalogueTest, modifyTapeLastWrittenLog) { +TEST_P(cta_catalogue_CatalogueTest, tapeMountedForArchive) { using namespace cta; ASSERT_TRUE(m_catalogue->getTapes().empty()); @@ -2665,7 +2665,7 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapeLastWrittenLog) { } const std::string modifiedDrive = "modified_drive"; - m_catalogue->modifyTapeLastWrittenLog(vid, modifiedDrive); + m_catalogue->tapeMountedForArchive(vid, modifiedDrive); { const std::list<common::dataStructures::Tape> tapes = m_catalogue->getTapes(); @@ -2693,7 +2693,7 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapeLastWrittenLog) { } } -TEST_P(cta_catalogue_CatalogueTest, modifyTapeLastWrittenLog_nonExistentTape) { +TEST_P(cta_catalogue_CatalogueTest, tapeMountedForArchive_nonExistentTape) { using namespace cta; ASSERT_TRUE(m_catalogue->getTapes().empty()); @@ -2701,7 +2701,7 @@ TEST_P(cta_catalogue_CatalogueTest, modifyTapeLastWrittenLog_nonExistentTape) { const std::string vid = "vid"; const std::string drive = "drive"; - ASSERT_THROW(m_catalogue->modifyTapeLastWrittenLog(vid, drive), exception::UserError); + ASSERT_THROW(m_catalogue->tapeMountedForArchive(vid, drive), exception::UserError); } TEST_P(cta_catalogue_CatalogueTest, modifyTapeLastReadLog) { diff --git a/catalogue/RdbmsCatalogue.cpp b/catalogue/RdbmsCatalogue.cpp index 785964fe3cb640fd1010e1f3f7db22f7aa77f654..c8b9072a0b4b448dbfe187b456e4ec90f323464b 100644 --- a/catalogue/RdbmsCatalogue.cpp +++ b/catalogue/RdbmsCatalogue.cpp @@ -1906,9 +1906,9 @@ void RdbmsCatalogue::modifyTapeEncryptionKey(const common::dataStructures::Secur } //------------------------------------------------------------------------------ -// modifyTapeLastWrittenLog +// tapeMountedForArchive //------------------------------------------------------------------------------ -void RdbmsCatalogue::modifyTapeLastWrittenLog(const std::string &vid, const std::string &drive) { +void RdbmsCatalogue::tapeMountedForArchive(const std::string &vid, const std::string &drive) { try { const time_t now = time(nullptr); const char *const sql = diff --git a/catalogue/RdbmsCatalogue.hpp b/catalogue/RdbmsCatalogue.hpp index 80e981867bdc0eaaae52b8e50d34a0ce4363b4bb..def82d1707805855500b7d8a2e24f07640a1f582 100644 --- a/catalogue/RdbmsCatalogue.hpp +++ b/catalogue/RdbmsCatalogue.hpp @@ -106,7 +106,7 @@ public: */ virtual void noSpaceLeftOnTape(const std::string &vid) override; - virtual void modifyTapeLastWrittenLog(const std::string &vid, const std::string &drive) override; // internal function (noCLI) + virtual void tapeMountedForArchive(const std::string &vid, const std::string &drive) override; // internal function (noCLI) virtual void modifyTapeLastReadLog(const std::string &vid, const std::string &drive) override; // internal function (noCLI) ////////////////////////////////////////////////////////////////