Commit 9e31f3d3 authored by Steven Murray's avatar Steven Murray
Browse files

Removed dependency of ListArchiveFilesCmd on both Catalogue and SearchCriteria

parent 6d81dcf6
Pipeline #32527 failed with stages
in 2 minutes and 23 seconds
......@@ -32,12 +32,11 @@ ListArchiveFilesCmd::ListArchiveFilesCmd(
log::Logger &log,
XrdOucErrInfo &xrdSfsFileError,
const bool displayHeader,
const catalogue::TapeFileSearchCriteria &searchCriteria,
catalogue::Catalogue &catalogue):
catalogue::ArchiveFileItor archiveFileItor):
m_log(log),
m_xrdSfsFileError(xrdSfsFileError),
m_displayHeader(displayHeader),
m_archiveFileItor(catalogue.getArchiveFileItor(searchCriteria)) {
m_archiveFileItor(std::move(archiveFileItor)) {
}
//------------------------------------------------------------------------------
......
......@@ -33,7 +33,6 @@ namespace xrootPlugins {
* Server-side class implementing the listing of one or more archive files.
*/
class ListArchiveFilesCmd {
public:
/**
......@@ -43,16 +42,13 @@ public:
* @param xrdSfsFileError The error member-variable of the XrdSfsFile class.
* @param displayHeader Set to true if the user requested the header to be
* displayed.
* @param searchCriteria The collection of criteria used to select a set of
* tape files.
* @param catalogue The CTA catalogue.
* @param archiveFileItor Iterator over the archive files in the CTA catalogue that are to be listed.
*/
ListArchiveFilesCmd(
log::Logger &log,
XrdOucErrInfo &xrdSfsFileError,
const bool displayHeader,
const catalogue::TapeFileSearchCriteria &searchCriteria,
catalogue::Catalogue &catalogue);
catalogue::ArchiveFileItor archiveFileItor);
/**
* Indirectly implements the XrdSfsFile::read() method.
......
......@@ -1623,7 +1623,8 @@ std::string XrdCtaFile::xCom_archivefile() {
}
if(!summary) {
const bool displayHeader = hasOption("-h", "--header");
m_listArchiveFilesCmd.reset(new ListArchiveFilesCmd(m_log, error, displayHeader, searchCriteria, *m_catalogue));
auto archiveFileItor = m_catalogue->getArchiveFileItor(searchCriteria);
m_listArchiveFilesCmd.reset(new ListArchiveFilesCmd(m_log, error, displayHeader, std::move(archiveFileItor)));
/*
std::unique_ptr<cta::catalogue::ArchiveFileItor> itor = m_catalogue->getArchiveFileItor(searchCriteria);
if(itor->hasMore()) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment