diff --git a/middletier/cta/ArchivalRequest.cpp b/middletier/cta/ArchivalRequest.cpp index 2eea7f1c478633f22a176090ad2f68eb328c615c..2d807f41d79be0c0472b4849199e46be4dfd3ab1 100644 --- a/middletier/cta/ArchivalRequest.cpp +++ b/middletier/cta/ArchivalRequest.cpp @@ -3,8 +3,7 @@ //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::ArchivalRequest::ArchivalRequest(): - m_priority(0) { +cta::ArchivalRequest::ArchivalRequest() { } //------------------------------------------------------------------------------ @@ -16,12 +15,14 @@ cta::ArchivalRequest::~ArchivalRequest() throw() { //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::ArchivalRequest::ArchivalRequest(const std::string &storageClassName, - const uint64_t priority, const std::string &id, const SecurityIdentity &user, +cta::ArchivalRequest::ArchivalRequest( + const std::string &storageClassName, + const std::string &id, + const uint64_t priority, + const SecurityIdentity &user, const time_t creationTime): - UserRequest(id, user, creationTime), - m_storageClassName(storageClassName), - m_priority(priority) { + UserRequest(id, priority, user, creationTime), + m_storageClassName(storageClassName) { } //------------------------------------------------------------------------------ @@ -30,10 +31,3 @@ cta::ArchivalRequest::ArchivalRequest(const std::string &storageClassName, const std::string &cta::ArchivalRequest::getStorageClassName() const throw() { return m_storageClassName; } - -//------------------------------------------------------------------------------ -// getPriority -//------------------------------------------------------------------------------ -uint64_t cta::ArchivalRequest::getPriority() const throw() { - return m_priority; -} diff --git a/middletier/cta/ArchivalRequest.hpp b/middletier/cta/ArchivalRequest.hpp index 4a89d15a93968ae6041c77b81f76b190c9bb477f..e205c855770f991063e60f75f7a1b30bf9910cf8 100644 --- a/middletier/cta/ArchivalRequest.hpp +++ b/middletier/cta/ArchivalRequest.hpp @@ -27,14 +27,17 @@ public: * Constructor. * * @param storageClassName The name of the storage class. - * @param priority The priority of the request. * @param id The identifier of the request. + * @param priority The priority of the request. * @param user The identity of the user who made the request. * @param creationTime Optionally the absolute time at which the user request * was created. If no value is given then the current time is used. */ - ArchivalRequest(const std::string &storageClassName, const uint64_t priority, - const std::string &id, const SecurityIdentity &user, + ArchivalRequest( + const std::string &storageClassName, + const std::string &id, + const uint64_t priority, + const SecurityIdentity &user, const time_t creationTime = time(NULL)); /** @@ -44,13 +47,6 @@ public: */ const std::string &getStorageClassName() const throw(); - /** - * Returns the priority of the request. - * - * @return The priority of the request. - */ - uint64_t getPriority() const throw(); - private: /** @@ -58,11 +54,6 @@ private: */ std::string m_storageClassName; - /** - * The priority of the request. - */ - uint64_t m_priority; - }; // class ArchivalRequest } // namespace cta diff --git a/middletier/cta/ArchiveToDirRequest.cpp b/middletier/cta/ArchiveToDirRequest.cpp index 19928afbf06dc4b11600cdb2d2d92cf56bc73f01..e368bd7de09b90b30ae86624d9a56ad31c719b9e 100644 --- a/middletier/cta/ArchiveToDirRequest.cpp +++ b/middletier/cta/ArchiveToDirRequest.cpp @@ -15,7 +15,14 @@ cta::ArchiveToDirRquest::~ArchiveToDirRquest() throw() { //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::ArchiveToDirRquest::ArchiveToDirRquest(const std::string &archiveDir): +cta::ArchiveToDirRquest::ArchiveToDirRquest( + const std::string &archiveDir, + const std::string &storageClassName, + const std::string &id, + const uint64_t priority, + const SecurityIdentity &user, + const time_t creationTime): + ArchivalRequest(storageClassName, id, priority, user, creationTime), m_archiveDir(archiveDir) { } diff --git a/middletier/cta/ArchiveToDirRequest.hpp b/middletier/cta/ArchiveToDirRequest.hpp index 327c60df02c85afe48e20f078b95af6ee5eb0aa9..4e97c63c05f53142044d2cdeacca0234acc2a264 100644 --- a/middletier/cta/ArchiveToDirRequest.hpp +++ b/middletier/cta/ArchiveToDirRequest.hpp @@ -29,8 +29,20 @@ public: * Constructor. * * @param archiveDir The full path of the destination archive directory. + * @param storageClassName The name of the storage class. + * @param id The identifier of the request. + * @param priority The priority of the request. + * @param user The identity of the user who made the request. + * @param creationTime Optionally the absolute time at which the user request + * was created. If no value is given then the current time is used. */ - ArchiveToDirRquest(const std::string &archiveDir); + ArchiveToDirRquest( + const std::string &archiveDir, + const std::string &storageClassName, + const std::string &id, + const uint64_t priority, + const SecurityIdentity &user, + const time_t creationTime = time(NULL)); /** * Returns the full path of the destination archive directory. diff --git a/middletier/cta/ArchiveToFileRequest.cpp b/middletier/cta/ArchiveToFileRequest.cpp index 8ebfe28df175f4d815458205e4f56c1ab0b78b10..ea6b722dc9dd762137c5206cc6c1d6a86a7efff5 100644 --- a/middletier/cta/ArchiveToFileRequest.cpp +++ b/middletier/cta/ArchiveToFileRequest.cpp @@ -15,8 +15,16 @@ cta::ArchiveToFileRequest::~ArchiveToFileRequest() throw() { //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::ArchiveToFileRequest::ArchiveToFileRequest(const std::string &remoteFile, - const std::string &archiveFile, const uint32_t nbCopies): +cta::ArchiveToFileRequest::ArchiveToFileRequest( + const std::string &remoteFile, + const std::string &archiveFile, + const uint32_t nbCopies, + const std::string &storageClassName, + const std::string &id, + const uint64_t priority, + const SecurityIdentity &user, + const time_t creationTime): + ArchivalRequest(storageClassName, id, priority, user, creationTime), m_remoteFile(remoteFile), m_archiveFile(archiveFile), m_nbCopies(nbCopies) { diff --git a/middletier/cta/ArchiveToFileRequest.hpp b/middletier/cta/ArchiveToFileRequest.hpp index 6c1d333cd1d3f61e138f4047aba794baa09f3168..60bbb1674b3c4641a44bf855a612d346e8b67d94 100644 --- a/middletier/cta/ArchiveToFileRequest.hpp +++ b/middletier/cta/ArchiveToFileRequest.hpp @@ -30,9 +30,22 @@ public: * @param remoteFile The URL of the source remote file to be archived. * @param archiveFile The full path of the destination archive file. * @param nbCopies The number of archive copies to be created. + * @param storageClassName The name of the storage class. + * @param id The identifier of the request. + * @param priority The priority of the request. + * @param user The identity of the user who made the request. + * @param creationTime Optionally the absolute time at which the user request + * was created. If no value is given then the current time is used. */ - ArchiveToFileRequest(const std::string &remoteFile, - const std::string &archiveFile, const uint32_t nbCopies); + ArchiveToFileRequest( + const std::string &remoteFile, + const std::string &archiveFile, + const uint32_t nbCopies, + const std::string &storageClassName, + const std::string &id, + const uint64_t priority, + const SecurityIdentity &user, + const time_t creationTime = time(NULL)); /** * Returns the URL of the source remote file to be archived. diff --git a/middletier/cta/RetrievalRequest.cpp b/middletier/cta/RetrievalRequest.cpp index be670a0300a761f5323f81f716090f1037a41e15..a7747fc36025b25b33e4a494664b3d05ddd8f2c2 100644 --- a/middletier/cta/RetrievalRequest.cpp +++ b/middletier/cta/RetrievalRequest.cpp @@ -3,8 +3,7 @@ //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::RetrievalRequest::RetrievalRequest(): - m_priority(0) { +cta::RetrievalRequest::RetrievalRequest() { } //------------------------------------------------------------------------------ @@ -16,16 +15,10 @@ cta::RetrievalRequest::~RetrievalRequest() throw() { //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::RetrievalRequest::RetrievalRequest(const uint64_t priority, - const std::string &id, const SecurityIdentity &user, +cta::RetrievalRequest::RetrievalRequest( + const std::string &id, + const uint64_t priority, + const SecurityIdentity &user, const time_t creationTime): - UserRequest(id, user, creationTime), - m_priority(priority) { -} - -//------------------------------------------------------------------------------ -// getPriority -//------------------------------------------------------------------------------ -uint64_t cta::RetrievalRequest::getPriority() const throw() { - return m_priority; + UserRequest(id, priority, user, creationTime) { } diff --git a/middletier/cta/RetrievalRequest.hpp b/middletier/cta/RetrievalRequest.hpp index 1189c37ff65d44286bc1772916c15cac3eb50785..3606b45db126144e43de5901fe8c45dc56e82119 100644 --- a/middletier/cta/RetrievalRequest.hpp +++ b/middletier/cta/RetrievalRequest.hpp @@ -20,33 +20,22 @@ public: /** * Destructor. */ - virtual ~RetrievalRequest() throw(); + virtual ~RetrievalRequest() throw() = 0; /** * Constructor. * - * @param priority The priority of the request. * @param id The identifier of the request. + * @param priority The priority of the request. * @param user The identity of the user who made the request. * @param creationTime Optionally the absolute time at which the user request * was created. If no value is given then the current time is used. */ - RetrievalRequest(const uint64_t priority, const std::string &id, - const SecurityIdentity &user, const time_t creationTime = time(NULL)); - - /** - * Returns the priority of the request. - * - * @return The priority of the request. - */ - uint64_t getPriority() const throw(); - -private: - - /** - * The priority of the request. - */ - uint64_t m_priority; + RetrievalRequest( + const std::string &id, + const uint64_t priority, + const SecurityIdentity &user, + const time_t creationTime = time(NULL)); }; // class RetrievalRequest diff --git a/middletier/cta/RetrieveToDirRequest.cpp b/middletier/cta/RetrieveToDirRequest.cpp index 38eefc7e0721613997718067a915f88aef5c5dce..f0652a99ac30868b2d6940d24bcd947b3702cb23 100644 --- a/middletier/cta/RetrieveToDirRequest.cpp +++ b/middletier/cta/RetrieveToDirRequest.cpp @@ -15,7 +15,13 @@ cta::RetrieveToDirRquest::~RetrieveToDirRquest() throw() { //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::RetrieveToDirRquest::RetrieveToDirRquest(const std::string &remoteDir): +cta::RetrieveToDirRquest::RetrieveToDirRquest( + const std::string &remoteDir, + const std::string &id, + const uint64_t priority, + const SecurityIdentity &user, + const time_t creationTime): + RetrievalRequest(id, priority, user, creationTime), m_remoteDir(remoteDir) { } diff --git a/middletier/cta/RetrieveToDirRequest.hpp b/middletier/cta/RetrieveToDirRequest.hpp index d8254ff771578d5dad347636511d404e73f00934..4d2b6d24b30cc7030be1c6be881a600a4c8abfb3 100644 --- a/middletier/cta/RetrieveToDirRequest.hpp +++ b/middletier/cta/RetrieveToDirRequest.hpp @@ -29,8 +29,18 @@ public: * Constructor. * * @param remoteDir The URL of the destination remote directory. + * @param id The identifier of the request. + * @param priority The priority of the request. + * @param user The identity of the user who made the request. + * @param creationTime Optionally the absolute time at which the user request + * was created. If no value is given then the current time is used. */ - RetrieveToDirRquest(const std::string &remoteDir); + RetrieveToDirRquest( + const std::string &remoteDir, + const std::string &id, + const uint64_t priority, + const SecurityIdentity &user, + const time_t creationTime = time(NULL)); /** * Returns the URL of the destination remote directory. diff --git a/middletier/cta/RetrieveToFileRequest.cpp b/middletier/cta/RetrieveToFileRequest.cpp index 082c06e73d0dc84dd96de409fb528151923810e7..a01dea3bd96097497e2a96fa91cf84fe9b039fbe 100644 --- a/middletier/cta/RetrieveToFileRequest.cpp +++ b/middletier/cta/RetrieveToFileRequest.cpp @@ -15,8 +15,14 @@ cta::RetrieveToFileRequest::~RetrieveToFileRequest() throw() { //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::RetrieveToFileRequest::RetrieveToFileRequest(const std::string &archiveFile, - const std::string &remoteFile): +cta::RetrieveToFileRequest::RetrieveToFileRequest( + const std::string &archiveFile, + const std::string &remoteFile, + const std::string &id, + const uint64_t priority, + const SecurityIdentity &user, + const time_t creationTime): + RetrievalRequest(id, priority, user, creationTime), m_archiveFile(archiveFile), m_remoteFile(remoteFile) { } diff --git a/middletier/cta/RetrieveToFileRequest.hpp b/middletier/cta/RetrieveToFileRequest.hpp index 429d50d9108a11264f3cf48a581a3e5bfa9244ab..ea646ca08ea33e444f771c8540ecda34f9cefe82 100644 --- a/middletier/cta/RetrieveToFileRequest.hpp +++ b/middletier/cta/RetrieveToFileRequest.hpp @@ -28,9 +28,19 @@ public: * * @param archiveFile The full path of the source archive file. * @param remoteFile The URL of the destination remote file. + * @param id The identifier of the request. + * @param priority The priority of the request. + * @param user The identity of the user who made the request. + * @param creationTime Optionally the absolute time at which the user request + * was created. If no value is given then the current time is used. */ - RetrieveToFileRequest(const std::string &archiveFile, - const std::string &remoteFile); + RetrieveToFileRequest( + const std::string &archiveFile, + const std::string &remoteFile, + const std::string &id, + const uint64_t priority, + const SecurityIdentity &user, + const time_t creationTime = time(NULL)); /** * Returns the full path of the source archive file. diff --git a/middletier/cta/UserRequest.cpp b/middletier/cta/UserRequest.cpp index 0aa14515c3e575c1262705a55b4e6015bdb6d820..a8e0456788e8df4917b9fa97158123843ef895e6 100644 --- a/middletier/cta/UserRequest.cpp +++ b/middletier/cta/UserRequest.cpp @@ -5,15 +5,20 @@ //------------------------------------------------------------------------------ cta::UserRequest::UserRequest(): m_id(0), + m_priority(0), m_creationTime(time(NULL)) { } //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::UserRequest::UserRequest(const std::string &id, - const SecurityIdentity &user, const time_t creationTime): +cta::UserRequest::UserRequest( + const std::string &id, + const uint64_t priority, + const SecurityIdentity &user, + const time_t creationTime): m_id(id), + m_priority(priority), m_user(user), m_creationTime(creationTime) { } diff --git a/middletier/cta/UserRequest.hpp b/middletier/cta/UserRequest.hpp index aefa42c41d4a3aba6703ab7d6d025427bd89c6b5..aa5490eb5cb6117221a2d5f6680cfd097596f022 100644 --- a/middletier/cta/UserRequest.hpp +++ b/middletier/cta/UserRequest.hpp @@ -2,6 +2,7 @@ #include "cta/SecurityIdentity.hpp" +#include <stdint.h> #include <string> #include <time.h> @@ -27,11 +28,15 @@ public: * Constructor. * * @param id The identifier of the request. + * @param priority The priority of the request. * @param user The identity of the user who made the request. * @param creationTime Optionally the absolute time at which the user request * was created. If no value is given then the current time is used. */ - UserRequest(const std::string &id, const SecurityIdentity &user, + UserRequest( + const std::string &id, + const uint64_t priority, + const SecurityIdentity &user, const time_t creationTime = time(NULL)); /** @@ -41,6 +46,13 @@ public: */ const std::string &getId() const throw(); + /** + * Returns the priority of the request. + * + * @return The priority of the request. + */ + uint64_t getPriority() const throw(); + /** * Returns the identity of the user who made the request. * @@ -62,6 +74,11 @@ private: */ std::string m_id; + /** + * The priority of the request. + */ + uint64_t m_priority; + /** * The identity of the user who made the request. */