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

Added abstract class cta::ArchivalJobQueues

parent 53957bb6
Branches
Tags
No related merge requests found
......@@ -7,11 +7,14 @@ set (MIDDLE_TIER_LIB_SRC_FILES
cta/AdminHost.cpp
cta/AdminUser.cpp
cta/ArchivalJob.cpp
cta/ArchivalJobQueues.cpp
cta/ArchivalJobState.cpp
cta/ArchivalMount.cpp
cta/ArchiveRoute.cpp
cta/ArchiveRouteId.cpp
cta/DirectoryEntry.cpp
cta/DirectoryIterator.cpp
cta/DiskException.cpp
cta/Exception.cpp
cta/FileAttribute.cpp
cta/FileSystemDirectoryEntry.cpp
......@@ -21,14 +24,17 @@ set (MIDDLE_TIER_LIB_SRC_FILES
cta/LogicalLibrary.cpp
cta/MiddleTierAdmin.cpp
cta/MiddleTierUser.cpp
cta/Mount.cpp
cta/RetrievalJob.cpp
cta/RetrievalJobState.cpp
cta/RetrievalMount.cpp
cta/SecurityIdentity.cpp
cta/SqliteDatabase.cpp
cta/SqliteMiddleTierAdmin.cpp
cta/SqliteMiddleTierUser.cpp
cta/StorageClass.cpp
cta/Tape.cpp
cta/TapeException.cpp
cta/TapePool.cpp
cta/UserIdentity.cpp
cta/Utils.cpp
......
#include "cta/ArchivalJobQueues.hpp"
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
cta::ArchivalJobQueues::~ArchivalJobQueues() throw() {
}
#pragma once
#include "cta/ArchivalJob.hpp"
#include "cta/ArchivalMount.hpp"
#include "cta/Exception.hpp"
#include <list>
#include <stdint.h>
#include <string>
namespace cta {
/**
* Abstract class representing the archival job queues.
*/
class ArchivalJobQueues {
public:
/**
* Destructor.
*/
virtual ~ArchivalJobQueues() throw() = 0;
/**
* Queues the specified archival job with the specified priority.
*
* @param priority The priority of the job to be queued.
* @param job The job to be queued.
*/
virtual void queueJob(const uint32_t priority, const ArchivalJob &job) = 0;
/**
* Deletes the archival job associated with the specified destination entry
* within the archive namespace.
*
* @param dstPath The full path of the destination entry within the archive
* namespace.
*/
virtual void deleteJob(const std::string &dstPath) = 0;
/**
* Returns the current list of archival jobs for the specified tape pool.
*
* @param tapePoolName The name of the tape pool.
*/
virtual std::list<ArchivalJob> getJobs(const std::string &tapePoolName) = 0;
/**
* Notifies this object that the specified destination entry has been created
* with the archive namespace.
*
* @param dstPath The full path of the destination entry within the archive
* namespace.
*/
virtual void fileCreatedInNamespace(const std::string &dstPath) = 0;
/**
* Notifies this object that the specified file transfer has succeeded.
*
* @param copyNb The copy number of the destination tape file.
* @param dstPath The full path of the destination entry within the archive
* namespace.
*/
virtual void fileTransferSucceeded(const uint32_t copyNb,
const std::string &dstPath) = 0;
/**
* Notifies this object that the specified file transfer has failed.
*
* @param copyNb The copy number of the destination tape file.
* @param dstPath The full path of the destination entry within the archive
* namespace.
* @param reason The reason the file transfer failed.
*/
virtual void fileTransferFailed(const uint32_t copyNb,
const std::string &dstPath, const Exception &reason) = 0;
/**
* Notifies this object that the specified destination entry within the
* archive namespace has been marked as archived.
*
* @param dstPath The full path of the destination entry within the archive
* namespace.
*/
virtual void fileArchivedInNamespace(const std::string &dstPath) = 0;
/**
* Returns the next archival mount for the specified tape pool or NULL if there
* currenly isn't one.
*
* @param tapePoolName The name of the tape pool.
* @return The next archival mount or NULL if there isn't one. Please note
* that it is the responsibility of the caller to deallocate any returned
* ArchivalMount object.
*/
virtual ArchivalMount *getNextMount(const std::string &tapePoolName)
= 0;
/**
* Returns the next batch of archival jobs for the specified on going tape
* mount.
*
* @param mountId The identifier of the mount.
*/
virtual std::list<ArchivalJob> getNextJobsForMount(const std::string &mountId)
= 0;
/**
* Requests this object to execute any time dependent and asynchronous logic.
*/
virtual void tick() = 0;
}; // class ArchivalJobQueues
} // namespace cta
#include "cta/ArchivalMount.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::ArchivalMount::ArchivalMount(const std::string &id, const std::string &vid,
const uint64_t nbFilesOnTapeBeforeMount):
Mount(id, vid),
m_nbFilesOnTapeBeforeMount(nbFilesOnTapeBeforeMount) {
}
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
cta::ArchivalMount::~ArchivalMount() throw() {
}
//------------------------------------------------------------------------------
// getNbFilesOnTapeBeforeMount
//------------------------------------------------------------------------------
uint64_t cta::ArchivalMount::getNbFilesOnTapeBeforeMount() const throw() {
return m_nbFilesOnTapeBeforeMount;
}
#pragma once
#include "cta/Mount.hpp"
#include <stdint.h>
namespace cta {
/**
* Class representing an archival mount.
*/
class ArchivalMount: public Mount {
public:
/**
* Constructor.
*
* @param id The identifier of the mount.
* @param vid The volume idenitifier of the tape to be mounted.
* @param nbFilesOnTapeBeforeMount The number of files on the tape before the
* mount.
*/
ArchivalMount(const std::string &id, const std::string &vid,
const uint64_t nbFilesOnTapeBeforeMount);
/**
* Destructor.
*/
~ArchivalMount() throw();
/**
* Returns the number of files on the tape before the mount.
*/
uint64_t getNbFilesOnTapeBeforeMount() const throw();
private:
/**
* The number of files on the tape before the mount.
*/
uint64_t m_nbFilesOnTapeBeforeMount;
}; // class ArchivalMount
} // namespace cta
#include "cta/DiskException.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::DiskException::DiskException(const std::string &message):
Exception(message) {
}
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
cta::DiskException::~DiskException() throw() {
}
#pragma once
#include "cta/Exception.hpp"
namespace cta {
/**
* Class representing a disk releated fault.
*/
class DiskException: public Exception {
public:
/**
* Constructor.
*/
DiskException(const std::string &message);
/**
* Destructor.
*/
~DiskException() throw();
}; // class Exception
} // namespace cta
#include "cta/Mount.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::Mount::Mount(const std::string &id, const std::string &vid):
m_id(id),
m_vid(vid) {
}
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
cta::Mount::~Mount() throw() {
}
//------------------------------------------------------------------------------
// getId
//------------------------------------------------------------------------------
const std::string &cta::Mount::getId() const throw() {
return m_id;
}
//------------------------------------------------------------------------------
// getVid
//------------------------------------------------------------------------------
const std::string &cta::Mount::getVid() const throw() {
return m_vid;
}
#pragma once
#include <string>
namespace cta {
/**
* Abstract class representing a tape mount.
*/
class Mount {
public:
/**
* Constructor.
*
* @param id The identifier of the mount.
* @param vid The volume idenitifier of the tape to be mounted.
*/
Mount(const std::string &id, const std::string &vid);
/**
* Destructor.
*/
virtual ~Mount() throw() = 0;
/**
* Returns the identiifer of the mount.
*/
const std::string &getId() const throw();
/**
* Returns the volume identiifer of the mount.
*/
const std::string &getVid() const throw();
private:
/**
* The identiifer of the mount.
*/
std::string m_id;
/**
* The volume identiifer of the tape to be mounted.
*/
std::string m_vid;
}; // class Mount
} // namespace cta
#include "cta/RetrievalMount.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::RetrievalMount::RetrievalMount(const std::string &id,
const std::string &vid):
Mount(id, vid) {
}
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
cta::RetrievalMount::~RetrievalMount() throw() {
}
#pragma once
#include "cta/Mount.hpp"
#include <stdint.h>
namespace cta {
/**
* Class representing a retrieval mount.
*/
class RetrievalMount: public Mount {
public:
/**
* Constructor.
*
* @param id The identifier of the mount.
* @param vid The volume idenitifier of the tape to be mounted.
*/
RetrievalMount(const std::string &id, const std::string &vid);
/**
* Destructor.
*/
~RetrievalMount() throw();
}; // class RetrievalMount
} // namespace cta
#include "cta/TapeException.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::TapeException::TapeException(const std::string &message):
Exception(message) {
}
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
cta::TapeException::~TapeException() throw() {
}
#pragma once
#include "cta/Exception.hpp"
namespace cta {
/**
* Class representing a tape releated fault.
*/
class TapeException: public Exception {
public:
/**
* Constructor.
*/
TapeException(const std::string &message);
/**
* Destructor.
*/
~TapeException() throw();
}; // class Exception
} // namespace cta
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment