Commit 1e1dff35 authored by Daniele Kruse's avatar Daniele Kruse
Browse files

Added comments in the EOS interface doc.\nRenamed MountGroup into MountPolicy...

Added comments in the EOS interface doc.\nRenamed MountGroup into MountPolicy and removed MountPolicy (adapted SQL code).\nRemoved amount of data to warrant a mount from LogicalLibrary.
parent b4635512
......@@ -56,7 +56,6 @@
#include "common/dataStructures/TapeFileLocation.hpp"
#include "common/dataStructures/TapePool.hpp"
#include "common/dataStructures/UpdateFileInfoRequest.hpp"
#include "common/dataStructures/MountGroup.hpp"
#include "common/dataStructures/UserIdentity.hpp"
#include "common/dataStructures/VerifyInfo.hpp"
#include "common/dataStructures/WriteTestResult.hpp"
......@@ -108,12 +107,10 @@ public:
virtual void modifyArchiveRouteTapePoolName(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &storageClassName, const uint64_t copyNb, const std::string &tapePoolName) = 0;
virtual void modifyArchiveRouteComment(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &storageClassName, const uint64_t copyNb, const std::string &comment) = 0;
virtual void createLogicalLibrary(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t archiveMinBytesQueued, const uint64_t retrieveMinBytesQueued, const std::string &comment) = 0;
virtual void createLogicalLibrary(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const std::string &comment) = 0;
virtual void deleteLogicalLibrary(const std::string &name) = 0;
virtual std::list<cta::common::dataStructures::LogicalLibrary> getLogicalLibraries() const = 0;
virtual void modifyLogicalLibraryComment(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const std::string &comment) = 0;
virtual void modifyLogicalLibraryMinArchiveBytesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, uint64_t const archiveMinBytesQueued) = 0;
virtual void modifyLogicalLibraryMinRetrieveBytesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, uint64_t const retrieveMinBytesQueued) = 0;
virtual void createTape(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &vid, const std::string &logicalLibraryName, const std::string &tapePoolName,
const std::string &encryptionKey, const uint64_t capacityInBytes, const bool disabledValue, const bool fullValue, const std::string &comment) = 0;
......@@ -137,15 +134,15 @@ public:
virtual void createRequester(
const cta::common::dataStructures::SecurityIdentity &cliIdentity,
const cta::common::dataStructures::UserIdentity &user,
const std::string &mountGroup,
const std::string &mountPolicy,
const std::string &comment) = 0;
virtual void deleteRequester(const cta::common::dataStructures::UserIdentity &user) = 0;
virtual std::list<cta::common::dataStructures::Requester> getRequesters() const = 0;
virtual void modifyRequesterMountGroup(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const cta::common::dataStructures::UserIdentity &user, const std::string &mountGroup) = 0;
virtual void modifyRequesterMountPolicy(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const cta::common::dataStructures::UserIdentity &user, const std::string &mountPolicy) = 0;
virtual void modifyRequesterComment(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const cta::common::dataStructures::UserIdentity &user, const std::string &comment) = 0;
virtual void createMountGroup(
virtual void createMountPolicy(
const cta::common::dataStructures::SecurityIdentity &cliIdentity,
const std::string &name,
const uint64_t archivePriority,
......@@ -155,25 +152,24 @@ public:
const uint64_t maxDrivesAllowed,
const std::string &comment) = 0;
virtual void deleteMountGroup(const std::string &name) = 0;
virtual std::list<cta::common::dataStructures::MountGroup> getMountGroups() const = 0;
virtual void modifyMountGroupArchivePriority(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t archivePriority) = 0;
virtual void modifyMountGroupArchiveMinFilesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minArchiveFilesQueued) = 0;
virtual void modifyMountGroupArchiveMinBytesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t archiveMinBytesQueued) = 0;
virtual void modifyMountGroupArchiveMinRequestAge(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minArchiveRequestAge) = 0;
virtual void modifyMountGroupRetrievePriority(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t retrievePriority) = 0;
virtual void modifyMountGroupRetrieveMinFilesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minRetrieveFilesQueued) = 0;
virtual void modifyMountGroupRetrieveMinBytesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t retrieveMinBytesQueued) = 0;
virtual void modifyMountGroupRetrieveMinRequestAge(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minRetrieveRequestAge) = 0;
virtual void modifyMountGroupMaxDrivesAllowed(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t maxDrivesAllowed) = 0;
virtual void modifyMountGroupComment(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const std::string &comment) = 0;
virtual void createDedication(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const cta::common::dataStructures::DedicationType dedicationType, const std::string &mountGroup,
virtual void deleteMountPolicy(const std::string &name) = 0;
virtual std::list<cta::common::dataStructures::MountPolicy> getMountPolicies() const = 0;
virtual void modifyMountPolicyArchivePriority(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t archivePriority) = 0;
virtual void modifyMountPolicyArchiveMinFilesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minArchiveFilesQueued) = 0;
virtual void modifyMountPolicyArchiveMinBytesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t archiveMinBytesQueued) = 0;
virtual void modifyMountPolicyArchiveMinRequestAge(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minArchiveRequestAge) = 0;
virtual void modifyMountPolicyRetrievePriority(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t retrievePriority) = 0;
virtual void modifyMountPolicyRetrieveMinFilesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minRetrieveFilesQueued) = 0;
virtual void modifyMountPolicyRetrieveMinBytesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t retrieveMinBytesQueued) = 0;
virtual void modifyMountPolicyRetrieveMinRequestAge(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minRetrieveRequestAge) = 0;
virtual void modifyMountPolicyMaxDrivesAllowed(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t maxDrivesAllowed) = 0;
virtual void modifyMountPolicyComment(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const std::string &comment) = 0;
virtual void createDedication(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const cta::common::dataStructures::DedicationType dedicationType,
const std::string &tag, const std::string &vid, const uint64_t fromTimestamp, const uint64_t untilTimestamp,const std::string &comment) = 0;
virtual void deleteDedication(const std::string &drivename) = 0;
virtual std::list<cta::common::dataStructures::Dedication> getDedications() const = 0;
virtual void modifyDedicationType(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const cta::common::dataStructures::DedicationType dedicationType) = 0;
virtual void modifyDedicationMountGroup(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const std::string &mountGroup) = 0;
virtual void modifyDedicationTag(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const std::string &tag) = 0;
virtual void modifyDedicationVid(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const std::string &vid) = 0;
virtual void modifyDedicationFrom(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const uint64_t fromTimestamp) = 0;
......@@ -217,22 +213,12 @@ public:
virtual cta::common::dataStructures::TapeCopyToPoolMap getTapeCopyToPoolMap(const std::string &storageClass) const = 0;
/**
* Returns the archive mount policy for the specified end user.
* Returns the mount policy for the specified end user.
*
* @param user The name of the end user.
* @return The archive mount policy.
* @return The mount policy.
*/
virtual cta::common::dataStructures::MountPolicy getArchiveMountPolicy(
const cta::common::dataStructures::UserIdentity &user) const = 0;
/**
* Returns the retrieve mount policy for the specified end user.
*
* @param user The name of the end user.
* @return The retrieve mount policy.
*/
virtual cta::common::dataStructures::MountPolicy getRetrieveMountPolicy(
const cta::common::dataStructures::UserIdentity &user) const = 0;
virtual cta::common::dataStructures::MountPolicy getMountPolicyForAUser(const cta::common::dataStructures::UserIdentity &user) const = 0;
virtual bool isAdmin(const cta::common::dataStructures::SecurityIdentity &cliIdentity) const = 0;
......
This diff is collapsed.
......@@ -72,12 +72,10 @@ public:
virtual void modifyArchiveRouteTapePoolName(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &storageClassName, const uint64_t copyNb, const std::string &tapePoolName);
virtual void modifyArchiveRouteComment(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &storageClassName, const uint64_t copyNb, const std::string &comment);
virtual void createLogicalLibrary(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t archiveMinBytesQueued, const uint64_t retrieveMinBytesQueued, const std::string &comment);
virtual void createLogicalLibrary(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const std::string &comment);
virtual void deleteLogicalLibrary(const std::string &name);
virtual std::list<cta::common::dataStructures::LogicalLibrary> getLogicalLibraries() const;
virtual void modifyLogicalLibraryComment(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const std::string &comment);
virtual void modifyLogicalLibraryMinArchiveBytesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, uint64_t const archiveMinBytesQueued);
virtual void modifyLogicalLibraryMinRetrieveBytesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, uint64_t const retrieveMinBytesQueued);
virtual void modifyLogicalLibraryComment(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const std::string &comment);
virtual void createTape(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &vid, const std::string &logicalLibraryName, const std::string &tapePoolName,
const std::string &encryptionKey, const uint64_t capacityInBytes, const bool disabledValue, const bool fullValue, const std::string &comment);
......@@ -98,13 +96,13 @@ public:
virtual void setTapeLbp(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &vid, const bool lbpValue); // internal function (noCLI)
virtual void modifyTapeComment(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &vid, const std::string &comment);
virtual void createRequester(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const cta::common::dataStructures::UserIdentity &user, const std::string &mountGroup, const std::string &comment);
virtual void createRequester(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const cta::common::dataStructures::UserIdentity &user, const std::string &mountPolicy, const std::string &comment);
virtual void deleteRequester(const cta::common::dataStructures::UserIdentity &user);
virtual std::list<cta::common::dataStructures::Requester> getRequesters() const;
virtual void modifyRequesterMountGroup(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const cta::common::dataStructures::UserIdentity &user, const std::string &mountGroup);
virtual void modifyRequesterMountPolicy(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const cta::common::dataStructures::UserIdentity &user, const std::string &mountPolicy);
virtual void modifyRequesterComment(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const cta::common::dataStructures::UserIdentity &user, const std::string &comment);
virtual void createMountGroup(
virtual void createMountPolicy(
const cta::common::dataStructures::SecurityIdentity &cliIdentity,
const std::string &name,
const uint64_t archivePriority,
......@@ -114,25 +112,24 @@ public:
const uint64_t maxDrivesAllowed,
const std::string &comment);
virtual void deleteMountGroup(const std::string &name);
virtual std::list<cta::common::dataStructures::MountGroup> getMountGroups() const;
virtual void modifyMountGroupArchivePriority(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t archivePriority);
virtual void modifyMountGroupArchiveMinFilesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minArchiveFilesQueued);
virtual void modifyMountGroupArchiveMinBytesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t archiveMinBytesQueued);
virtual void modifyMountGroupArchiveMinRequestAge(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minArchiveRequestAge);
virtual void modifyMountGroupRetrievePriority(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t retrievePriority);
virtual void modifyMountGroupRetrieveMinFilesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minRetrieveFilesQueued);
virtual void modifyMountGroupRetrieveMinBytesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t retrieveMinBytesQueued);
virtual void modifyMountGroupRetrieveMinRequestAge(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minRetrieveRequestAge);
virtual void modifyMountGroupMaxDrivesAllowed(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t maxDrivesAllowed);
virtual void modifyMountGroupComment(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const std::string &comment);
virtual void createDedication(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const cta::common::dataStructures::DedicationType dedicationType, const std::string &mountGroup,
virtual void deleteMountPolicy(const std::string &name);
virtual std::list<cta::common::dataStructures::MountPolicy> getMountPolicies() const;
virtual void modifyMountPolicyArchivePriority(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t archivePriority);
virtual void modifyMountPolicyArchiveMinFilesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minArchiveFilesQueued);
virtual void modifyMountPolicyArchiveMinBytesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t archiveMinBytesQueued);
virtual void modifyMountPolicyArchiveMinRequestAge(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minArchiveRequestAge);
virtual void modifyMountPolicyRetrievePriority(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t retrievePriority);
virtual void modifyMountPolicyRetrieveMinFilesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minRetrieveFilesQueued);
virtual void modifyMountPolicyRetrieveMinBytesQueued(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t retrieveMinBytesQueued);
virtual void modifyMountPolicyRetrieveMinRequestAge(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t minRetrieveRequestAge);
virtual void modifyMountPolicyMaxDrivesAllowed(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const uint64_t maxDrivesAllowed);
virtual void modifyMountPolicyComment(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &name, const std::string &comment);
virtual void createDedication(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const cta::common::dataStructures::DedicationType dedicationType,
const std::string &tag, const std::string &vid, const uint64_t fromTimestamp, const uint64_t untilTimestamp,const std::string &comment);
virtual void deleteDedication(const std::string &drivename);
virtual std::list<cta::common::dataStructures::Dedication> getDedications() const;
virtual void modifyDedicationType(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const cta::common::dataStructures::DedicationType dedicationType);
virtual void modifyDedicationMountGroup(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const std::string &mountGroup);
virtual void modifyDedicationTag(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const std::string &tag);
virtual void modifyDedicationVid(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const std::string &vid);
virtual void modifyDedicationFrom(const cta::common::dataStructures::SecurityIdentity &cliIdentity, const std::string &drivename, const uint64_t fromTimestamp);
......@@ -188,22 +185,12 @@ public:
virtual cta::common::dataStructures::TapeCopyToPoolMap getTapeCopyToPoolMap(const std::string &storageClass) const;
/**
* Returns the archive mount policy for the specified end user.
* Returns the mount policy for the specified end user.
*
* @param user The name of the end user.
* @return The archive mount policy.
*/
virtual cta::common::dataStructures::MountPolicy getArchiveMountPolicy(
const cta::common::dataStructures::UserIdentity &user) const;
/**
* Returns the retrieve mount policy for the specified end user.
*
* @param user The name of the end user.
* @return The retrieve mount policy.
*/
virtual cta::common::dataStructures::MountPolicy getRetrieveMountPolicy(
const cta::common::dataStructures::UserIdentity &user) const;
virtual cta::common::dataStructures::MountPolicy getMountPolicyForAUser(const cta::common::dataStructures::UserIdentity &user) const;
virtual bool isAdmin(const cta::common::dataStructures::SecurityIdentity &cliIdentity) const;
......
......@@ -536,9 +536,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createLogicalLibrary) {
const std::string logicalLibraryName = "logical_library";
const std::string comment = "create logical library";
const uint64_t archiveMinBytesQueued = 1;
const uint64_t retrieveMinBytesQueued = 2;
catalogue.createLogicalLibrary(m_cliSI, logicalLibraryName, archiveMinBytesQueued, retrieveMinBytesQueued, comment);
catalogue.createLogicalLibrary(m_cliSI, logicalLibraryName, comment);
const std::list<common::dataStructures::LogicalLibrary> libs =
catalogue.getLogicalLibraries();
......@@ -548,8 +546,6 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createLogicalLibrary) {
const common::dataStructures::LogicalLibrary lib = libs.front();
ASSERT_EQ(logicalLibraryName, lib.name);
ASSERT_EQ(comment, lib.comment);
ASSERT_EQ(archiveMinBytesQueued, lib.archiveMinBytesQueued);
ASSERT_EQ(retrieveMinBytesQueued, lib.retrieveMinBytesQueued);
const common::dataStructures::EntryLog creationLog = lib.creationLog;
ASSERT_EQ(m_cliSI.user.name, creationLog.user.name);
......@@ -568,11 +564,9 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createLogicalLibrary_same_twice) {
const std::string logicalLibraryName = "logical_library";
const std::string comment = "create logical library";
const uint64_t archiveMinBytesQueued = 1;
const uint64_t retrieveMinBytesQueued = 2;
catalogue.createLogicalLibrary(m_cliSI, logicalLibraryName, archiveMinBytesQueued, retrieveMinBytesQueued, comment);
catalogue.createLogicalLibrary(m_cliSI, logicalLibraryName, comment);
ASSERT_THROW(catalogue.createLogicalLibrary(m_cliSI,
logicalLibraryName, archiveMinBytesQueued, retrieveMinBytesQueued, comment),
logicalLibraryName, comment),
exception::Exception);
}
......@@ -592,7 +586,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createTape) {
const bool fullValue = false;
const std::string comment = "create tape";
catalogue.createLogicalLibrary(m_cliSI, logicalLibraryName, 1, 2,
catalogue.createLogicalLibrary(m_cliSI, logicalLibraryName,
"create logical library");
catalogue.createTapePool(m_cliSI, tapePoolName, 2, true, "create tape pool");
catalogue.createTape(m_cliSI, vid, logicalLibraryName, tapePoolName,
......@@ -638,7 +632,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createTape_same_twice) {
const bool fullValue = false;
const std::string comment = "create tape";
catalogue.createLogicalLibrary(m_cliSI, logicalLibraryName, 1, 2,
catalogue.createLogicalLibrary(m_cliSI, logicalLibraryName,
"create logical library");
catalogue.createTapePool(m_cliSI, tapePoolName, 2, true, "create tape pool");
catalogue.createTape(m_cliSI, vid, logicalLibraryName, tapePoolName,
......@@ -648,12 +642,12 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createTape_same_twice) {
comment), exception::Exception);
}
TEST_F(cta_catalogue_SqliteCatalogueTest, createMountGroup) {
TEST_F(cta_catalogue_SqliteCatalogueTest, createMountPolicy) {
using namespace cta;
catalogue::SqliteCatalogue catalogue;
ASSERT_TRUE(catalogue.getMountGroups().empty());
ASSERT_TRUE(catalogue.getMountPolicies().empty());
const std::string name = "mount_group";
const uint64_t archivePriority = 1;
......@@ -663,7 +657,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createMountGroup) {
const uint64_t maxDrivesAllowed = 5;
const std::string &comment = "create mount group";
catalogue.createMountGroup(
catalogue.createMountPolicy(
m_cliSI,
name,
archivePriority,
......@@ -673,12 +667,12 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createMountGroup) {
maxDrivesAllowed,
comment);
const std::list<common::dataStructures::MountGroup> groups =
catalogue.getMountGroups();
const std::list<common::dataStructures::MountPolicy> groups =
catalogue.getMountPolicies();
ASSERT_EQ(1, groups.size());
const common::dataStructures::MountGroup group = groups.front();
const common::dataStructures::MountPolicy group = groups.front();
ASSERT_EQ(name, group.name);
......@@ -702,12 +696,12 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createMountGroup) {
ASSERT_EQ(creationLog, lastModificationLog);
}
TEST_F(cta_catalogue_SqliteCatalogueTest, createMountGroup_same_twice) {
TEST_F(cta_catalogue_SqliteCatalogueTest, createMountPolicy_same_twice) {
using namespace cta;
catalogue::SqliteCatalogue catalogue;
ASSERT_TRUE(catalogue.getMountGroups().empty());
ASSERT_TRUE(catalogue.getMountPolicies().empty());
const std::string name = "mount_group";
const uint64_t archivePriority = 1;
......@@ -717,7 +711,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createMountGroup_same_twice) {
const uint64_t maxDrivesAllowed = 9;
const std::string &comment = "create mount group";
catalogue.createMountGroup(
catalogue.createMountPolicy(
m_cliSI,
name,
archivePriority,
......@@ -727,7 +721,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createMountGroup_same_twice) {
maxDrivesAllowed,
comment);
ASSERT_THROW(catalogue.createMountGroup(
ASSERT_THROW(catalogue.createMountPolicy(
m_cliSI,
name,
archivePriority,
......@@ -745,16 +739,16 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createUser) {
ASSERT_TRUE(catalogue.getRequesters().empty());
const std::string mountGroupName = "mount_group";
const std::string mountPolicyName = "mount_group";
const uint64_t archivePriority = 1;
const uint64_t minArchiveRequestAge = 4;
const uint64_t retrievePriority = 5;
const uint64_t minRetrieveRequestAge = 8;
const uint64_t maxDrivesAllowed = 9;
catalogue.createMountGroup(
catalogue.createMountPolicy(
m_cliSI,
mountGroupName,
mountPolicyName,
archivePriority,
minArchiveRequestAge,
retrievePriority,
......@@ -768,7 +762,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createUser) {
cta::common::dataStructures::UserIdentity userIdentity;
userIdentity.name=userName;
userIdentity.group=group;
catalogue.createRequester(m_cliSI, userIdentity, mountGroupName, comment);
catalogue.createRequester(m_cliSI, userIdentity, mountPolicyName, comment);
std::list<common::dataStructures::Requester> users;
users = catalogue.getRequesters();
......@@ -777,25 +771,20 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createUser) {
const common::dataStructures::Requester user = users.front();
ASSERT_EQ(userName, user.name);
ASSERT_EQ(mountGroupName, user.mountGroupName);
ASSERT_EQ(mountPolicyName, user.mountPolicy);
ASSERT_EQ(comment, user.comment);
ASSERT_EQ(m_cliSI.user, user.creationLog.user);
ASSERT_EQ(m_cliSI.host, user.creationLog.host);
ASSERT_EQ(user.creationLog, user.lastModificationLog);
const common::dataStructures::MountPolicy archivePolicy =
catalogue.getArchiveMountPolicy(userIdentity);
const common::dataStructures::MountPolicy policy =
catalogue.getMountPolicyForAUser(userIdentity);
ASSERT_EQ(archivePriority, archivePolicy.priority);
ASSERT_EQ(minArchiveRequestAge, archivePolicy.minRequestAge);
ASSERT_EQ(maxDrivesAllowed, archivePolicy.maxDrives);
const common::dataStructures::MountPolicy retrievePolicy =
catalogue.getRetrieveMountPolicy(userIdentity);
ASSERT_EQ(retrievePriority, retrievePolicy.priority);
ASSERT_EQ(minRetrieveRequestAge, retrievePolicy.minRequestAge);
ASSERT_EQ(maxDrivesAllowed, retrievePolicy.maxDrives);
ASSERT_EQ(archivePriority, policy.archive_priority);
ASSERT_EQ(minArchiveRequestAge, policy.archive_minRequestAge);
ASSERT_EQ(maxDrivesAllowed, policy.maxDrivesAllowed);
ASSERT_EQ(retrievePriority, policy.retrieve_priority);
ASSERT_EQ(minRetrieveRequestAge, policy.retrieve_minRequestAge);
}
TEST_F(cta_catalogue_SqliteCatalogueTest, createUser_same_twice) {
......@@ -805,16 +794,16 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createUser_same_twice) {
ASSERT_TRUE(catalogue.getRequesters().empty());
const std::string mountGroupName = "mount_group";
const std::string mountPolicyName = "mount_group";
const uint64_t archivePriority = 1;
const uint64_t minArchiveRequestAge = 4;
const uint64_t retrievePriority = 5;
const uint64_t minRetrieveRequestAge = 8;
const uint64_t maxDrivesAllowed = 9;
catalogue.createMountGroup(
catalogue.createMountPolicy(
m_cliSI,
mountGroupName,
mountPolicyName,
archivePriority,
minArchiveRequestAge,
retrievePriority,
......@@ -824,13 +813,13 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createUser_same_twice) {
const std::string comment = "create user";
const std::string name = "name";
const std::string mountGroup = "mount_group";
const std::string mountPolicy = "mount_group";
const std::string group = "group";
cta::common::dataStructures::UserIdentity userIdentity;
userIdentity.name=name;
userIdentity.group=group;
catalogue.createRequester(m_cliSI, userIdentity, mountGroupName, comment);
ASSERT_THROW(catalogue.createRequester(m_cliSI, userIdentity, mountGroup, comment),
catalogue.createRequester(m_cliSI, userIdentity, mountPolicyName, comment);
ASSERT_THROW(catalogue.createRequester(m_cliSI, userIdentity, mountPolicy, comment),
exception::Exception);
}
......@@ -917,16 +906,16 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, prepareForNewFile) {
ASSERT_TRUE(catalogue.getRequesters().empty());
const std::string mountGroupName = "mount_group";
const std::string mountPolicyName = "mount_group";
const uint64_t archivePriority = 1;
const uint64_t minArchiveRequestAge = 2;
const uint64_t retrievePriority = 3;
const uint64_t minRetrieveRequestAge = 4;
const uint64_t maxDrivesAllowed = 5;
catalogue.createMountGroup(
catalogue.createMountPolicy(
m_cliSI,
mountGroupName,
mountPolicyName,
archivePriority,
minArchiveRequestAge,
retrievePriority,
......@@ -938,9 +927,9 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, prepareForNewFile) {
const std::string userName = "user_name";
const std::string group = "group";
cta::common::dataStructures::UserIdentity userIdentity;
userIdentity.name = userName;
userIdentity.group = group;
catalogue.createRequester(m_cliSI, userIdentity, mountGroupName, userComment);
userIdentity.name=userName;
userIdentity.group=group;
catalogue.createRequester(m_cliSI, userIdentity, mountPolicyName, userComment);
std::list<common::dataStructures::Requester> users;
users = catalogue.getRequesters();
......@@ -949,25 +938,20 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, prepareForNewFile) {
const common::dataStructures::Requester user = users.front();
ASSERT_EQ(userName, user.name);
ASSERT_EQ(mountGroupName, user.mountGroupName);
ASSERT_EQ(mountPolicyName, user.mountPolicy);
ASSERT_EQ(userComment, user.comment);
ASSERT_EQ(m_cliSI.user, user.creationLog.user);
ASSERT_EQ(m_cliSI.host, user.creationLog.host);
ASSERT_EQ(user.creationLog, user.lastModificationLog);
const common::dataStructures::MountPolicy archivePolicy =
catalogue.getArchiveMountPolicy(userIdentity);
ASSERT_EQ(archivePriority, archivePolicy.priority);
ASSERT_EQ(minArchiveRequestAge, archivePolicy.minRequestAge);
ASSERT_EQ(maxDrivesAllowed, archivePolicy.maxDrives);
ASSERT_EQ(user.creationLog, user.lastModificationLog);
const common::dataStructures::MountPolicy retrievePolicy =
catalogue.getRetrieveMountPolicy(userIdentity);
const common::dataStructures::MountPolicy policy =
catalogue.getMountPolicyForAUser(userIdentity);
ASSERT_EQ(retrievePriority, retrievePolicy.priority);
ASSERT_EQ(minRetrieveRequestAge, retrievePolicy.minRequestAge);
ASSERT_EQ(maxDrivesAllowed, retrievePolicy.maxDrives);
ASSERT_EQ(archivePriority, policy.archive_priority);
ASSERT_EQ(minArchiveRequestAge, policy.archive_minRequestAge);
ASSERT_EQ(maxDrivesAllowed, policy.maxDrivesAllowed);
ASSERT_EQ(retrievePriority, policy.retrieve_priority);
ASSERT_EQ(minRetrieveRequestAge, policy.retrieve_minRequestAge);
ASSERT_TRUE(catalogue.getArchiveRoutes().empty());
......@@ -1021,9 +1005,9 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, prepareForNewFile) {
ASSERT_EQ(1, queueCriteria.copyToPoolMap.size());
ASSERT_EQ(copyNb, queueCriteria.copyToPoolMap.begin()->first);
ASSERT_EQ(tapePoolName, queueCriteria.copyToPoolMap.begin()->second);
ASSERT_EQ(archivePriority, queueCriteria.mountPolicy.priority);
ASSERT_EQ(minArchiveRequestAge, queueCriteria.mountPolicy.minRequestAge);
ASSERT_EQ(maxDrivesAllowed, queueCriteria.mountPolicy.maxDrives);
ASSERT_EQ(archivePriority, queueCriteria.mountPolicy.archive_priority);
ASSERT_EQ(minArchiveRequestAge, queueCriteria.mountPolicy.archive_minRequestAge);
ASSERT_EQ(maxDrivesAllowed, queueCriteria.mountPolicy.maxDrivesAllowed);
}
} // namespace unitTests
......@@ -40,7 +40,6 @@ set (COMMON_LIB_SRC_FILES
dataStructures/EntryLog.cpp
dataStructures/ListStorageClassRequest.cpp
dataStructures/LogicalLibrary.cpp
dataStructures/MountGroup.cpp
dataStructures/MountType.cpp
dataStructures/MountPolicy.cpp
dataStructures/ReadTestResult.cpp
......
......@@ -33,7 +33,6 @@ cta::common::dataStructures::Dedication::Dedication():
bool cta::common::dataStructures::Dedication::operator==(const Dedication &rhs) const {
return driveName==rhs.driveName
&& dedicationType==rhs.dedicationType
&& mountGroup==rhs.mountGroup
&& tag==rhs.tag
&& vid==rhs.vid
&& fromTimestamp==rhs.fromTimestamp
......@@ -56,7 +55,6 @@ bool cta::common::dataStructures::Dedication::operator!=(const Dedication &rhs)
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::Dedication &obj) {
os << "(driveName=" << obj.driveName
<< " dedicationType=" << obj.dedicationType
<< " mountGroup=" << obj.mountGroup
<< " tag=" << obj.tag
<< " vid=" << obj.vid
<< " fromTimestamp=" << obj.fromTimestamp
......
......@@ -43,7 +43,6 @@ struct Dedication {
std::string driveName;
cta::common::dataStructures::DedicationType dedicationType;
std::string mountGroup;
std::string tag;
std::string vid;
uint64_t fromTimestamp;
......
......@@ -23,17 +23,13 @@
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::LogicalLibrary::LogicalLibrary():
archiveMinBytesQueued(0),
retrieveMinBytesQueued(0) {}
cta::common::dataStructures::LogicalLibrary::LogicalLibrary() {}
//------------------------------------------------------------------------------
// operator==
//------------------------------------------------------------------------------
bool cta::common::dataStructures::LogicalLibrary::operator==(const LogicalLibrary &rhs) const {
return name==rhs.name
&& archiveMinBytesQueued==rhs.archiveMinBytesQueued
&& retrieveMinBytesQueued==rhs.retrieveMinBytesQueued
&& creationLog==rhs.creationLog
&& lastModificationLog==rhs.lastModificationLog
&& comment==rhs.comment;
......@@ -51,8 +47,6 @@ bool cta::common::dataStructures::LogicalLibrary::operator!=(const LogicalLibrar
//------------------------------------------------------------------------------
std::ostream &operator<<(std::ostream &os, const cta::common::dataStructures::LogicalLibrary &obj) {
os << "(name=" << obj.name