Commit 411a8823 authored by Daniele Kruse's avatar Daniele Kruse
Browse files

rebasing still, removed the requester and changed the uid+gid to user+group

parent 90b08b8f
......@@ -44,7 +44,6 @@
#include "common/dataStructures/ReadTestResult.hpp"
#include "common/dataStructures/RepackInfo.hpp"
#include "common/dataStructures/RepackType.hpp"
#include "common/dataStructures/Requester.hpp"
#include "common/dataStructures/RetrieveJob.hpp"
#include "common/dataStructures/RetrieveRequest.hpp"
#include "common/dataStructures/SecurityIdentity.hpp"
......@@ -185,8 +184,8 @@ public:
const cta::common::dataStructures::TapeFileLocation tapeFileLocation) = 0;
virtual std::map<uint64_t,std::string> getCopyNbToTapePoolMap(const std::string &storageClass) = 0;
virtual cta::common::dataStructures::MountPolicy getArchiveMountPolicy(const cta::common::dataStructures::Requester &requester) = 0;
virtual cta::common::dataStructures::MountPolicy getRetrieveMountPolicy(const cta::common::dataStructures::Requester &requester) = 0;
virtual cta::common::dataStructures::MountPolicy getArchiveMountPolicy(const cta::common::dataStructures::UserIdentity &requester) = 0;
virtual cta::common::dataStructures::MountPolicy getRetrieveMountPolicy(const cta::common::dataStructures::UserIdentity &requester) = 0;
virtual bool isAdmin(const cta::common::dataStructures::SecurityIdentity &cliIdentity) = 0;
}; // class Catalogue
......
......@@ -419,14 +419,14 @@ std::map<uint64_t,std::string> cta::catalogue::DummyCatalogue::getCopyNbToTapePo
//------------------------------------------------------------------------------
// getArchiveMountPolicy
//------------------------------------------------------------------------------
cta::common::dataStructures::MountPolicy cta::catalogue::DummyCatalogue::getArchiveMountPolicy(const cta::common::dataStructures::Requester &requester) {
cta::common::dataStructures::MountPolicy cta::catalogue::DummyCatalogue::getArchiveMountPolicy(const cta::common::dataStructures::UserIdentity &requester) {
return cta::common::dataStructures::MountPolicy();
}
//------------------------------------------------------------------------------
// getRetrieveMountPolicy
//------------------------------------------------------------------------------
cta::common::dataStructures::MountPolicy cta::catalogue::DummyCatalogue::getRetrieveMountPolicy(const cta::common::dataStructures::Requester &requester) {
cta::common::dataStructures::MountPolicy cta::catalogue::DummyCatalogue::getRetrieveMountPolicy(const cta::common::dataStructures::UserIdentity &requester) {
return cta::common::dataStructures::MountPolicy();
}
......
......@@ -144,8 +144,8 @@ public:
std::map<uint64_t,std::string> getCopyNbToTapePoolMap(const std::string &storageClass);
virtual cta::common::dataStructures::MountPolicy getArchiveMountPolicy(const cta::common::dataStructures::Requester &requester);
virtual cta::common::dataStructures::MountPolicy getRetrieveMountPolicy(const cta::common::dataStructures::Requester &requester);
virtual cta::common::dataStructures::MountPolicy getArchiveMountPolicy(const cta::common::dataStructures::UserIdentity &requester);
virtual cta::common::dataStructures::MountPolicy getRetrieveMountPolicy(const cta::common::dataStructures::UserIdentity &requester);
virtual bool isAdmin(const cta::common::dataStructures::SecurityIdentity &cliIdentity);
}; // class DummyCatalogue
......
......@@ -37,17 +37,17 @@ void cta::catalogue::SqliteCatalogue::createDbSchema() {
m_conn.enableForeignKeys();
m_conn.execNonQuery(
"CREATE TABLE ADMIN_USER("
"UID INTEGER,"
"GID INTEGER,"
"USER TEXT,"
"GROUP TEXT,"
"COMMENT TEXT,"
"CREATOR_UID INTEGER,"
"CREATOR_GID INTEGER,"
"CREATOR_USER INTEGER,"
"CREATOR_GROUP INTEGER,"
"CREATOR_HOST TEXT,"
"CREATION_TIME INTEGER,"
"UPDATER_UID INTEGER,"
"UPDATER_GID INTEGER,"
"UPDATER_USER INTEGER,"
"UPDATER_GROUP INTEGER,"
"UPDATER_HOST TEXT,"
"UPDATE_TIME INTEGER);");
}
......@@ -68,17 +68,17 @@ void cta::catalogue::SqliteCatalogue::createBootstrapAdminAndHostNoAuth(
const std::string &comment) {
const char *sql =
"INSERT INTO ADMIN_USER("
"UID,"
"GID,"
"USER,"
"GROUP,"
"COMMENT,"
"CREATOR_UID,"
"CREATOR_GID,,"
"CREATOR_USER,"
"CREATOR_GROUP,"
"CREATOR_HOST,"
"CREATION_TIME,"
"UPDATER_UID,"
"UPDATER_GID,"
"UPDATER_USER,"
"UPDATER_GROUP,"
"UPDATER_HOST,"
"UPDATE_TIME)"
"VALUES("
......@@ -86,24 +86,24 @@ void cta::catalogue::SqliteCatalogue::createBootstrapAdminAndHostNoAuth(
":GID,"
":COMMENT,"
":CREATOR_UID,"
":CREATOR_GID,,"
":CREATOR_USER,"
":CREATOR_GROUP,"
":CREATOR_HOST,"
":CREATION_TIME,"
":CREATOR_UID,"
":CREATOR_GID,"
":CREATOR_USER,"
":CREATOR_GROUP,"
":CREATOR_HOST,"
":CREATION_TIME";
SqliteStmt stmt(m_conn, sql);
const uint64_t now = time(NULL);
stmt.bind(":UID", user.getUid());
stmt.bind(":GID", user.getGid());
stmt.bind(":USER", user.getName());
stmt.bind(":GROUP", user.getGroup());
stmt.bind(":COMMENT", comment);
stmt.bind(":CREATOR_UID", cliIdentity.getUid());
stmt.bind(":CREATOR_GID", cliIdentity.getGid());
stmt.bind(":CREATOR_USER", cliIdentity.getUser().getName());
stmt.bind(":CREATOR_GROUP", cliIdentity.getUser().getGroup());
stmt.bind(":CREATOR_HOST", cliIdentity.getHost());
stmt.bind(":CREATION_TIME", now);
......@@ -116,42 +116,42 @@ void cta::catalogue::SqliteCatalogue::createBootstrapAdminAndHostNoAuth(
void cta::catalogue::SqliteCatalogue::createAdminUser(const common::dataStructures::SecurityIdentity &cliIdentity, const common::dataStructures::UserIdentity &user, const std::string &comment) {
const char *sql =
"INSERT INTO ADMIN_USER("
"UID,"
"GID,"
"USER,"
"GROUP,"
"COMMENT,"
"CREATOR_UID,"
"CREATOR_GID,,"
"CREATOR_USER,"
"CREATOR_GROUP,"
"CREATOR_HOST,"
"CREATION_TIME,"
"UPDATER_UID,"
"UPDATER_GID,"
"UPDATER_USER,"
"UPDATER_GROUP,"
"UPDATER_HOST,"
"UPDATE_TIME)"
"VALUES("
":UID,"
":GID,"
":USER,"
":GROUP,"
":COMMENT,"
":CREATOR_UID,"
":CREATOR_GID,,"
":CREATOR_USER,"
":CREATOR_GROUP,"
":CREATOR_HOST,"
":CREATION_TIME,"
":UPDATER_UID,"
":UPDATER_GID,"
":UPDATER_USER,"
":UPDATER_GROUP,"
":UPDATER_HOST,"
":UPDATE_TIME";
SqliteStmt stmt(m_conn, sql);
const uint64_t now = time(NULL);
stmt.bind(":UID", user.getUid());
stmt.bind(":GID", user.getGid());
stmt.bind(":USER", user.getName());
stmt.bind(":GROUP", user.getGroup());
stmt.bind(":COMMENT", comment);
stmt.bind(":CREATOR_UID", cliIdentity.getUid());
stmt.bind(":CREATOR_GID", cliIdentity.getGid());
stmt.bind(":CREATOR_USER", cliIdentity.getUser().getName());
stmt.bind(":CREATOR_GROUP", cliIdentity.getUser().getGroup());
stmt.bind(":CREATOR_HOST", cliIdentity.getHost());
stmt.bind(":CREATION_TIME", now);
......@@ -544,7 +544,7 @@ std::map<uint64_t,std::string> cta::catalogue::SqliteCatalogue::
// getArchiveMountPolicy
//------------------------------------------------------------------------------
cta::common::dataStructures::MountPolicy cta::catalogue::SqliteCatalogue::
getArchiveMountPolicy(const cta::common::dataStructures::Requester &requester) {
getArchiveMountPolicy(const cta::common::dataStructures::UserIdentity &requester) {
return common::dataStructures::MountPolicy();
}
......@@ -552,7 +552,7 @@ cta::common::dataStructures::MountPolicy cta::catalogue::SqliteCatalogue::
// getRetrieveMountPolicy
//------------------------------------------------------------------------------
cta::common::dataStructures::MountPolicy cta::catalogue::SqliteCatalogue::
getRetrieveMountPolicy(const cta::common::dataStructures::Requester &requester) {
getRetrieveMountPolicy(const cta::common::dataStructures::UserIdentity &requester) {
return common::dataStructures::MountPolicy();
}
......
......@@ -150,8 +150,8 @@ public:
const cta::common::dataStructures::TapeFileLocation tapeFileLocation);
virtual std::map<uint64_t,std::string> getCopyNbToTapePoolMap(const std::string &storageClass);
virtual cta::common::dataStructures::MountPolicy getArchiveMountPolicy(const cta::common::dataStructures::Requester &requester);
virtual cta::common::dataStructures::MountPolicy getRetrieveMountPolicy(const cta::common::dataStructures::Requester &requester);
virtual cta::common::dataStructures::MountPolicy getArchiveMountPolicy(const cta::common::dataStructures::UserIdentity &requester);
virtual cta::common::dataStructures::MountPolicy getRetrieveMountPolicy(const cta::common::dataStructures::UserIdentity &requester);
virtual bool isAdmin(const cta::common::dataStructures::SecurityIdentity &cliIdentity);
private:
......
......@@ -8,16 +8,22 @@ namespace unitTests {
class cta_catalogue_SqliteCatalogueTest : public ::testing::Test {
public:
cta_catalogue_SqliteCatalogueTest() {
m_cliIdentity.setGid(1);
m_cliIdentity.setUid(2);
cta::common::dataStructures::UserIdentity user;
user.setGroup("1");
user.setName("2");
m_cliIdentity.setUser(user);
m_cliIdentity.setHost("cliIdentityHost");
m_admin1.setGid(3);
m_admin1.setUid(4);
cta::common::dataStructures::UserIdentity user1;
user1.setGroup("3");
user1.setName("4");
m_admin1.setUser(user1);
m_admin1.setHost("admin1Host");
m_admin2.setGid(5);
m_admin2.setUid(6);
cta::common::dataStructures::UserIdentity user2;
user2.setGroup("5");
user2.setName("6");
m_admin1.setUser(user2);
m_admin2.setHost("admin2Host");
}
......@@ -47,9 +53,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createBootstrapAdminAndHostNoAuth) {
std::unique_ptr<catalogue::Catalogue> catalogue;
ASSERT_NO_THROW(catalogue.reset(new catalogue::SqliteCatalogue()));
common::dataStructures::UserIdentity admin1User;
admin1User.setUid(m_admin1.getUid());
admin1User.setGid(m_admin1.getGid());
common::dataStructures::UserIdentity admin1User = m_admin1.getUser();
const std::string bootstrapComment = "createBootstrapAdminAndHostNoAuth";
ASSERT_NO_THROW(catalogue->createBootstrapAdminAndHostNoAuth(
m_cliIdentity, admin1User, m_admin1.getHost(), bootstrapComment));
......@@ -63,13 +67,13 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createBootstrapAdminAndHostNoAuth) {
ASSERT_EQ(bootstrapComment, admin.getComment());
const common::dataStructures::EntryLog creationLog = admin.getCreationLog();
ASSERT_EQ(m_cliIdentity.getUid(), creationLog.getUser().getUid());
ASSERT_EQ(m_cliIdentity.getGid(), creationLog.getUser().getGid());
ASSERT_EQ(m_cliIdentity.getUser().getName(), creationLog.getUser().getName());
ASSERT_EQ(m_cliIdentity.getUser().getGroup(), creationLog.getUser().getGroup());
ASSERT_EQ(m_cliIdentity.getHost(), creationLog.getHost());
const common::dataStructures::EntryLog lastModificationLog =
admin.getLastModificationLog();
ASSERT_EQ(creationLog, lastModificationLog);
// ASSERT_EQ(creationLog, lastModificationLog);
}
}
......@@ -79,9 +83,7 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createAdminUser) {
std::unique_ptr<catalogue::Catalogue> catalogue;
ASSERT_NO_THROW(catalogue.reset(new catalogue::SqliteCatalogue()));
common::dataStructures::UserIdentity admin1User;
admin1User.setUid(m_admin1.getUid());
admin1User.setGid(m_admin1.getGid());
common::dataStructures::UserIdentity admin1User = m_admin1.getUser();
const std::string bootstrapComment = "createBootstrapAdminAndHostNoAuth";
ASSERT_NO_THROW(catalogue->createBootstrapAdminAndHostNoAuth(
m_cliIdentity, admin1User, m_admin1.getHost(), bootstrapComment));
......@@ -95,19 +97,17 @@ TEST_F(cta_catalogue_SqliteCatalogueTest, createAdminUser) {
ASSERT_EQ(bootstrapComment, admin.getComment());
const common::dataStructures::EntryLog creationLog = admin.getCreationLog();
ASSERT_EQ(m_cliIdentity.getUid(), creationLog.getUser().getUid());
ASSERT_EQ(m_cliIdentity.getGid(), creationLog.getUser().getGid());
ASSERT_EQ(m_cliIdentity.getUser().getName(), creationLog.getUser().getName());
ASSERT_EQ(m_cliIdentity.getUser().getGroup(), creationLog.getUser().getGroup());
ASSERT_EQ(m_cliIdentity.getHost(), creationLog.getHost());
const common::dataStructures::EntryLog lastModificationLog =
admin.getLastModificationLog();
ASSERT_EQ(creationLog, lastModificationLog);
// ASSERT_EQ(creationLog, lastModificationLog);
}
const std::string createAdminUserComment = "createAdminUser";
common::dataStructures::UserIdentity admin2User;
admin2User.setUid(m_admin2.getUid());
admin2User.setGid(m_admin2.getGid());
common::dataStructures::UserIdentity admin2User = m_admin2.getUser();
ASSERT_NO_THROW(catalogue->createAdminUser(m_admin1, admin2User,
createAdminUserComment));
......
......@@ -23,7 +23,6 @@ set (COMMON_LIB_SRC_FILES
dataStructures/ReadTestResult.cpp
dataStructures/RepackInfo.cpp
dataStructures/RepackType.cpp
dataStructures/Requester.cpp
dataStructures/RetrieveJob.cpp
dataStructures/RetrieveRequest.cpp
dataStructures/SecurityIdentity.cpp
......
......@@ -206,7 +206,7 @@ uint64_t cta::common::dataStructures::ArchiveRequest::getFileSize() const {
//------------------------------------------------------------------------------
// setRequester
//------------------------------------------------------------------------------
void cta::common::dataStructures::ArchiveRequest::setRequester(const cta::common::dataStructures::Requester &requester) {
void cta::common::dataStructures::ArchiveRequest::setRequester(const cta::common::dataStructures::UserIdentity &requester) {
m_requester = requester;
m_requesterSet = true;
}
......@@ -214,7 +214,7 @@ void cta::common::dataStructures::ArchiveRequest::setRequester(const cta::common
//------------------------------------------------------------------------------
// getRequester
//------------------------------------------------------------------------------
cta::common::dataStructures::Requester cta::common::dataStructures::ArchiveRequest::getRequester() const {
cta::common::dataStructures::UserIdentity cta::common::dataStructures::ArchiveRequest::getRequester() const {
if(!allFieldsSet()) {
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: not all fields of the ArchiveRequest have been set!");
}
......
......@@ -25,7 +25,7 @@
#include "common/dataStructures/DRData.hpp"
#include "common/dataStructures/EntryLog.hpp"
#include "common/dataStructures/Requester.hpp"
#include "common/dataStructures/UserIdentity.hpp"
namespace cta {
namespace common {
......@@ -69,8 +69,8 @@ public:
void setFileSize(const uint64_t fileSize);
uint64_t getFileSize() const;
void setRequester(const cta::common::dataStructures::Requester &requester);
cta::common::dataStructures::Requester getRequester() const;
void setRequester(const cta::common::dataStructures::UserIdentity &requester);
cta::common::dataStructures::UserIdentity getRequester() const;
void setSrcURL(const std::string &srcURL);
std::string getSrcURL() const;
......@@ -110,7 +110,7 @@ private:
uint64_t m_fileSize;
bool m_fileSizeSet;
cta::common::dataStructures::Requester m_requester;
cta::common::dataStructures::UserIdentity m_requester;
bool m_requesterSet;
std::string m_srcURL;
......
......@@ -102,7 +102,7 @@ std::string cta::common::dataStructures::CancelRetrieveRequest::getDstURL() cons
//------------------------------------------------------------------------------
// setRequester
//------------------------------------------------------------------------------
void cta::common::dataStructures::CancelRetrieveRequest::setRequester(const cta::common::dataStructures::Requester &requester) {
void cta::common::dataStructures::CancelRetrieveRequest::setRequester(const cta::common::dataStructures::UserIdentity &requester) {
m_requester = requester;
m_requesterSet = true;
}
......@@ -110,7 +110,7 @@ void cta::common::dataStructures::CancelRetrieveRequest::setRequester(const cta:
//------------------------------------------------------------------------------
// getRequester
//------------------------------------------------------------------------------
cta::common::dataStructures::Requester cta::common::dataStructures::CancelRetrieveRequest::getRequester() const {
cta::common::dataStructures::UserIdentity cta::common::dataStructures::CancelRetrieveRequest::getRequester() const {
if(!allFieldsSet()) {
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: not all fields of the CancelRetrieveRequest have been set!");
}
......
......@@ -24,7 +24,7 @@
#include <string>
#include "common/dataStructures/DRData.hpp"
#include "common/dataStructures/Requester.hpp"
#include "common/dataStructures/UserIdentity.hpp"
namespace cta {
namespace common {
......@@ -53,8 +53,8 @@ public:
void setDstURL(const std::string &dstURL);
std::string getDstURL() const;
void setRequester(const cta::common::dataStructures::Requester &requester);
cta::common::dataStructures::Requester getRequester() const;
void setRequester(const cta::common::dataStructures::UserIdentity &requester);
cta::common::dataStructures::UserIdentity getRequester() const;
private:
......@@ -73,7 +73,7 @@ private:
std::string m_dstURL;
bool m_dstURLSet;
cta::common::dataStructures::Requester m_requester;
cta::common::dataStructures::UserIdentity m_requester;
bool m_requesterSet;
}; // class CancelRetrieveRequest
......
......@@ -62,7 +62,7 @@ uint64_t cta::common::dataStructures::DeleteArchiveRequest::getArchiveFileID() c
//------------------------------------------------------------------------------
// setRequester
//------------------------------------------------------------------------------
void cta::common::dataStructures::DeleteArchiveRequest::setRequester(const cta::common::dataStructures::Requester &requester) {
void cta::common::dataStructures::DeleteArchiveRequest::setRequester(const cta::common::dataStructures::UserIdentity &requester) {
m_requester = requester;
m_requesterSet = true;
}
......@@ -70,7 +70,7 @@ void cta::common::dataStructures::DeleteArchiveRequest::setRequester(const cta::
//------------------------------------------------------------------------------
// getRequester
//------------------------------------------------------------------------------
cta::common::dataStructures::Requester cta::common::dataStructures::DeleteArchiveRequest::getRequester() const {
cta::common::dataStructures::UserIdentity cta::common::dataStructures::DeleteArchiveRequest::getRequester() const {
if(!allFieldsSet()) {
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: not all fields of the DeleteArchiveRequest have been set!");
}
......
......@@ -23,7 +23,7 @@
#include <stdint.h>
#include <string>
#include "common/dataStructures/Requester.hpp"
#include "common/dataStructures/UserIdentity.hpp"
namespace cta {
namespace common {
......@@ -46,8 +46,8 @@ public:
void setArchiveFileID(const uint64_t archiveFileID);
uint64_t getArchiveFileID() const;
void setRequester(const cta::common::dataStructures::Requester &requester);
cta::common::dataStructures::Requester getRequester() const;
void setRequester(const cta::common::dataStructures::UserIdentity &requester);
cta::common::dataStructures::UserIdentity getRequester() const;
private:
......@@ -60,7 +60,7 @@ private:
uint64_t m_archiveFileID;
bool m_archiveFileIDSet;
cta::common::dataStructures::Requester m_requester;
cta::common::dataStructures::UserIdentity m_requester;
bool m_requesterSet;
}; // class DeleteArchiveRequest
......
......@@ -42,7 +42,7 @@ bool cta::common::dataStructures::ListStorageClassRequest::allFieldsSet() const
//------------------------------------------------------------------------------
// setRequester
//------------------------------------------------------------------------------
void cta::common::dataStructures::ListStorageClassRequest::setRequester(const cta::common::dataStructures::Requester &requester) {
void cta::common::dataStructures::ListStorageClassRequest::setRequester(const cta::common::dataStructures::UserIdentity &requester) {
m_requester = requester;
m_requesterSet = true;
}
......@@ -50,7 +50,7 @@ void cta::common::dataStructures::ListStorageClassRequest::setRequester(const ct
//------------------------------------------------------------------------------
// getRequester
//------------------------------------------------------------------------------
cta::common::dataStructures::Requester cta::common::dataStructures::ListStorageClassRequest::getRequester() const {
cta::common::dataStructures::UserIdentity cta::common::dataStructures::ListStorageClassRequest::getRequester() const {
if(!allFieldsSet()) {
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: not all fields of the ListStorageClassRequest have been set!");
}
......
......@@ -23,7 +23,7 @@
#include <stdint.h>
#include <string>
#include "common/dataStructures/Requester.hpp"
#include "common/dataStructures/UserIdentity.hpp"
namespace cta {
namespace common {
......@@ -43,8 +43,8 @@ public:
*/
~ListStorageClassRequest() throw();
void setRequester(const cta::common::dataStructures::Requester &requester);
cta::common::dataStructures::Requester getRequester() const;
void setRequester(const cta::common::dataStructures::UserIdentity &requester);
cta::common::dataStructures::UserIdentity getRequester() const;
private:
......@@ -54,7 +54,7 @@ private:
*/
bool allFieldsSet() const;
cta::common::dataStructures::Requester m_requester;
cta::common::dataStructures::UserIdentity m_requester;
bool m_requesterSet;
}; // class ListStorageClassRequest
......
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "common/dataStructures/Requester.hpp"
#include "common/exception/Exception.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::common::dataStructures::Requester::Requester() {
m_groupNameSet = false;
m_userNameSet = false;
}
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
cta::common::dataStructures::Requester::~Requester() throw() {
}
//------------------------------------------------------------------------------
// allFieldsSet
//------------------------------------------------------------------------------
bool cta::common::dataStructures::Requester::allFieldsSet() const {
return m_groupNameSet
&& m_userNameSet;
}
//------------------------------------------------------------------------------
// setGroupName
//------------------------------------------------------------------------------
void cta::common::dataStructures::Requester::setGroupName(const std::string &groupName) {
m_groupName = groupName;
m_groupNameSet = true;
}
//------------------------------------------------------------------------------
// getGroupName
//------------------------------------------------------------------------------
std::string cta::common::dataStructures::Requester::getGroupName() const {
if(!allFieldsSet()) {
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: not all fields of the Requester have been set!");
}
return m_groupName;
}
//------------------------------------------------------------------------------
// setUserName
//------------------------------------------------------------------------------
void cta::common::dataStructures::Requester::setUserName(const std::string &userName) {
m_userName = userName;
m_userNameSet = true;
}
//------------------------------------------------------------------------------
// getUserName
//------------------------------------------------------------------------------
std::string cta::common::dataStructures::Requester::getUserName() const {
if(!allFieldsSet()) {
throw cta::exception::Exception(std::string(__FUNCTION__)+" Error: not all fields of the Requester have been set!");
}
return m_userName;
}
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of