Skip to content
Snippets Groups Projects
Commit 0a83140c authored by Steven Murray's avatar Steven Murray
Browse files

Cleaned up FileTransfer and its subclasses

parent e0e71e5c
Branches
Tags
No related merge requests found
......@@ -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
......
......@@ -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;
}
#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
......
......@@ -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;
}
......@@ -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
......@@ -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;
}
#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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment