diff --git a/Doxyfile b/Doxyfile index 396d068472a1f2cd00c310468d22361e94ced20c..0c6042293c13459d7219f3e4d319ff8a3315cbd6 100644 --- a/Doxyfile +++ b/Doxyfile @@ -568,7 +568,7 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = libs/middletier +INPUT = middletier # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is diff --git a/middletier/cta/ArchivalFileTransfer.cpp b/middletier/cta/ArchivalFileTransfer.cpp index 5cb48f620b5a1e4fb8d30c28d77d6b9ded9b2441..d2dd893957c715a418770afaefc1ff17e5c95eae 100644 --- a/middletier/cta/ArchivalFileTransfer.cpp +++ b/middletier/cta/ArchivalFileTransfer.cpp @@ -15,22 +15,19 @@ cta::ArchivalFileTransfer::~ArchivalFileTransfer() throw() { //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::ArchivalFileTransfer::ArchivalFileTransfer(const std::string &remoteFile, - const std::string &vid): - m_remoteFile(remoteFile), - m_vid(vid) { +cta::ArchivalFileTransfer::ArchivalFileTransfer( + const std::string &tapePoolName, + const std::string &id, + const std::string &userRequestId, + const uint32_t copyNb, + const std::string &remoteFile): + FileTransfer(id, userRequestId, copyNb, remoteFile), + m_tapePoolName(tapePoolName) { } //------------------------------------------------------------------------------ -// getRemoteFile +// getTapePoolName //------------------------------------------------------------------------------ -const std::string &cta::ArchivalFileTransfer::getRemoteFile() const throw() { - return m_remoteFile; -} - -//------------------------------------------------------------------------------ -// getVid -//------------------------------------------------------------------------------ -const std::string &cta::ArchivalFileTransfer::getVid() const throw() { - return m_vid; +const std::string &cta::ArchivalFileTransfer::getTapePoolName() const throw() { + return m_tapePoolName; } diff --git a/middletier/cta/ArchivalFileTransfer.hpp b/middletier/cta/ArchivalFileTransfer.hpp index 82b9f053faaea2eb577bbacf0fa338a4abe5d09d..b304aebc7bef0ce076497be4d6a190e277d7fbfc 100644 --- a/middletier/cta/ArchivalFileTransfer.hpp +++ b/middletier/cta/ArchivalFileTransfer.hpp @@ -1,5 +1,8 @@ #pragma once +#include "cta/FileTransfer.hpp" + +#include <stdint.h> #include <string> namespace cta { @@ -7,7 +10,7 @@ namespace cta { /** * Class representing the transfer of a single copy of a remote file to tape. */ -class ArchivalFileTransfer { +class ArchivalFileTransfer: public FileTransfer { public: /** @@ -23,36 +26,32 @@ public: /** * Constructor. * + * @param tapePoolName The name of the destination tape pool. + * @param id The identifier of the file transfer. + * @param userRequestId The identifier of the associated user request. + * @param copyNb The copy number. * @param remoteFile The URL of the remote source file. - * @param vid The volume identifier of the destination tape. - */ - ArchivalFileTransfer(const std::string &remoteFile, const std::string &vid); - - /** - * Returns the URL of the remote source file. - * - * @return the URL of the remote source file. */ - const std::string &getRemoteFile() const throw(); + ArchivalFileTransfer( + const std::string &tapePoolName, + const std::string &id, + const std::string &userRequestId, + const uint32_t copyNb, + const std::string &remoteFile); /** - * Returns the volume identifier of the destination tape. + * Returns the name of the destination tape pool. * - * @return the volume identifier of the destination tape. + * @return the name of the destination tape pool. */ - const std::string &getVid() const throw(); + const std::string &getTapePoolName() const throw(); private: /** - * The URL of the remote source file. - */ - std::string m_remoteFile; - - /** - * The volume identifier of the destination tape. + * The name of the destination tape pool. */ - std::string m_vid; + std::string m_tapePoolName; }; // class ArchivalFileTransfer diff --git a/middletier/cta/FileTransfer.cpp b/middletier/cta/FileTransfer.cpp index 1dc4b2dcfe04d5918f7ecf1564563c9f228d7cbb..58d19dbe85e3cbfef4f9e1fdd7f459d0f40c792a 100644 --- a/middletier/cta/FileTransfer.cpp +++ b/middletier/cta/FileTransfer.cpp @@ -16,11 +16,15 @@ cta::FileTransfer::~FileTransfer() throw() { //------------------------------------------------------------------------------ // constructor //------------------------------------------------------------------------------ -cta::FileTransfer::FileTransfer(const std::string &id, - const std::string &userRequestId, const uint32_t copyNb): +cta::FileTransfer::FileTransfer( + const std::string &id, + const std::string &userRequestId, + const uint32_t copyNb, + const std::string &remoteFile): m_id(id), m_userRequestId(userRequestId), - m_copyNb(copyNb) { + m_copyNb(copyNb), + m_remoteFile(remoteFile) { } //------------------------------------------------------------------------------ @@ -43,3 +47,10 @@ const std::string &cta::FileTransfer::getUserRequestId() const throw() { uint32_t cta::FileTransfer::getCopyNb() const throw() { return m_copyNb; } + +//------------------------------------------------------------------------------ +// getRemoteFile +//------------------------------------------------------------------------------ +const std::string &cta::FileTransfer::getRemoteFile() const throw() { + return m_remoteFile; +} diff --git a/middletier/cta/FileTransfer.hpp b/middletier/cta/FileTransfer.hpp index 592b3c4a0225b4922332bc16e76e940c33fb7e8e..0cc67bb9d8ab7fd27987c2e79a8fd4003a09e154 100644 --- a/middletier/cta/FileTransfer.hpp +++ b/middletier/cta/FileTransfer.hpp @@ -26,10 +26,16 @@ public: * * @param id The identifier of the file transfer. * @param userRequestId The identifier of the associated user request. - * @prama copyNb The copy number + * @param copyNb The copy number. + * @param remoteFile The URL of the remote file that depending on the + * direction of the data transfer may be either the source or the + * destination of the file transfer. */ - FileTransfer(const std::string &id, const std::string &userRequestId, - const uint32_t copyNb); + FileTransfer( + const std::string &id, + const std::string &userRequestId, + const uint32_t copyNb, + const std::string &remoteFile); /** * Returns the identifier of the file transfer. @@ -52,6 +58,17 @@ public: */ uint32_t getCopyNb() const throw(); + /** + * Returns the URL of the remote file that depending on the direction of the + * data transfer may be either the source or the destination of the file + * transfer. + * + * @return The URL of the remote file that depending on the direction of the + * data transfer may be either the source or the destination of the file + * transfer. + */ + const std::string &getRemoteFile() const throw(); + private: /** @@ -69,6 +86,12 @@ private: */ uint32_t m_copyNb; + /** + * The URL of the remote file that depending on the direction of the data + * transfer may be either the source or the destination of the file transfer. + */ + std::string m_remoteFile; + }; // class FileTransfer } // namespace cta diff --git a/middletier/cta/RetrievalFileTransfer.cpp b/middletier/cta/RetrievalFileTransfer.cpp index d54d5c8cfea4ce3b48fb99209d59ebb3e5da5329..a8b5d4bf066914d059b3d30876fac6cc1b928f25 100644 --- a/middletier/cta/RetrievalFileTransfer.cpp +++ b/middletier/cta/RetrievalFileTransfer.cpp @@ -16,9 +16,13 @@ cta::RetrievalFileTransfer::~RetrievalFileTransfer() throw() { // constructor //------------------------------------------------------------------------------ cta::RetrievalFileTransfer::RetrievalFileTransfer( - const TapeFileLocation &tapeFile, const std::string &remoteFile): - m_tapeFile(tapeFile), - m_remoteFile(remoteFile) { + const TapeFileLocation &tapeFile, + const std::string &id, + const std::string &userRequestId, + const uint32_t copyNb, + const std::string &remoteFile): + FileTransfer(id, userRequestId, copyNb, remoteFile), + m_tapeFile(tapeFile) { } //------------------------------------------------------------------------------ @@ -28,10 +32,3 @@ const cta::TapeFileLocation &cta::RetrievalFileTransfer::getTapeFile() const throw() { return m_tapeFile; } - -//------------------------------------------------------------------------------ -// getRemoteFile -//------------------------------------------------------------------------------ -const std::string &cta::RetrievalFileTransfer::getRemoteFile() const throw() { - return m_remoteFile; -} diff --git a/middletier/cta/RetrievalFileTransfer.hpp b/middletier/cta/RetrievalFileTransfer.hpp index 201787c4e024b0a5585d287c5272edf9fbb122bb..a73f6c38940dea8f66d70082e6409762b428736e 100644 --- a/middletier/cta/RetrievalFileTransfer.hpp +++ b/middletier/cta/RetrievalFileTransfer.hpp @@ -1,5 +1,6 @@ #pragma once +#include "cta/FileTransfer.hpp" #include "cta/TapeFileLocation.hpp" #include <string> @@ -10,7 +11,7 @@ namespace cta { * Class representing the transfer of a single copy of a tape file to a remote * file. */ -class RetrievalFileTransfer { +class RetrievalFileTransfer: public FileTransfer { public: /** @@ -27,9 +28,16 @@ public: * Constructor. * * @param tapeFileLocation The location of the source tape file. + * @param id The identifier of the file transfer. + * @param userRequestId The identifier of the associated user request. + * @param copyNb The copy number. * @param remoteFile The URL of the destination source file. */ - RetrievalFileTransfer(const TapeFileLocation &tapeFile, + RetrievalFileTransfer( + const TapeFileLocation &tapeFile, + const std::string &id, + const std::string &userRequestId, + const uint32_t copyNb, const std::string &remoteFile); /** @@ -39,13 +47,6 @@ public: */ const TapeFileLocation &getTapeFile() const throw(); - /** - * Returns the URL of the remote source file. - * - * @return the URL of the remote source file. - */ - const std::string &getRemoteFile() const throw(); - private: /** @@ -53,11 +54,6 @@ private: */ const TapeFileLocation m_tapeFile; - /** - * The URL of the remote destination file. - */ - std::string m_remoteFile; - }; // class RetrievalFileTransfer } // namespace cta