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

Added the UserGroup and VO classes

parent 313d65bb
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@ set (MIDDLE_TIER_LIB_SRC_FILES
cta/DirectoryEntry.cpp
cta/DirectoryIterator.cpp
cta/DiskException.cpp
cta/DriveQuota.cpp
cta/EosRemoteStorage.cpp
cta/Exception.cpp
cta/FileAttribute.cpp
......@@ -32,6 +33,7 @@ set (MIDDLE_TIER_LIB_SRC_FILES
cta/MiddleTierAdmin.cpp
cta/MiddleTierUser.cpp
cta/Mount.cpp
cta/MountCriteria.cpp
cta/RemoteStorage.cpp
cta/RetrievalFileTransfer.cpp
cta/RetrievalJob.cpp
......@@ -52,6 +54,7 @@ set (MIDDLE_TIER_LIB_SRC_FILES
cta/TapeFileLocation.cpp
cta/TapePool.cpp
cta/UserIdentity.cpp
cta/UserGroup.cpp
cta/UserRequest.cpp
cta/Utils.cpp
cta/Vfs.cpp
......
......@@ -32,10 +32,12 @@ public:
* source disk files.
* @param copyNb The tape copy number. Copy numbers start from 1.
* @param tapePoolName The name of the destination tape pool.
* @param creator The identity of the user that created the storage class.
* @param comment Comment describing the storage class.
* @param creationTime The absolute time at which the configuration item was
* created.
* @param creator The identity of the user that created this configuration
* item.
* @param comment Comment describing this configuration item.
* @param creationTime Optionally the absolute time at which this
* configuration item was created. If no value is given then the current
* time is used.
*/
ArchivalRoute(
const std::string &storageClassName,
......
......@@ -26,11 +26,11 @@ public:
/**
* Constructor.
*
* @param creator The identity of the user that created the configuration
* @param creator The identity of the user that created this configuration
* item.
* @param comment The comment made by the creator of the configuration
* request.
* @param creationTime Optionally the absolute time at which the
* @param comment The comment made by the creator of this configuration
* item.
* @param creationTime Optionally the absolute time at which this
* configuration item was created. If no value is given then the current
* time is used.
*/
......@@ -38,40 +38,40 @@ public:
const time_t creationTime = time(NULL));
/**
* Returns the identity of the user that created the configuration item.
* Returns the identity of the user that created this configuration item.
*
* @return The identity of the user that created the configuration item.
* @return The identity of the user that created this configuration item.
*/
const UserIdentity &getCreator() const throw();
/**
* Returns the comment made by the creator of the configuration request.
* Returns the comment made by the creator of this configuration request.
*
* @return The comment made by the creator of the configuration request.
* @return The comment made by the creator of this configuration request.
*/
const std::string &getComment() const throw();
/**
* Returns the absolute time at which the configuration item was created.
* Returns the absolute time at which this configuration item was created.
*
* @return The absolute time at which the configuration item was created.
* @return The absolute time at which this configuration item was created.
*/
time_t getCreationTime() const throw();
private:
/**
* The identity of the user that created the configuration item.
* The identity of the user that created this configuration item.
*/
UserIdentity m_creator;
/**
* The comment made by the creator of the configuration request.
* The comment made by the creator of this configuration request.
*/
std::string m_comment;
/**
* The absolute time at which the configuration item was created.
* The absolute time at which this configuration item was created.
*/
time_t m_creationTime;
......
#include "cta/DriveQuota.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::DriveQuota::DriveQuota():
m_minDrives(0),
m_maxDrives(0) {
}
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::DriveQuota::DriveQuota(const uint32_t minDrives, const uint32_t maxDrives):
m_minDrives(minDrives),
m_maxDrives(maxDrives) {
}
//------------------------------------------------------------------------------
// getMinDrives
//------------------------------------------------------------------------------
uint32_t cta::DriveQuota::getMinDrives() const throw() {
return m_minDrives;
}
//------------------------------------------------------------------------------
// getMaxDrives
//------------------------------------------------------------------------------
uint32_t cta::DriveQuota::getMaxDrives() const throw() {
return m_maxDrives;
}
#pragma once
#include <stdint.h>
namespace cta {
/**
* Class representing a tape-drive quota.
*/
class DriveQuota {
public:
/**
* Constructor.
*/
DriveQuota();
/**
* Constructor.
*
* @param minDrives The minimum number of drives that should be provided.
* @param maxDrives The maximum number of drives that should be provided.
*/
DriveQuota(const uint32_t minDrives, const uint32_t maxDrives);
/**
* Returns the minimum number of drives that should be provided.
*
* @return The minimum number of drives that should be provided.
*/
uint32_t getMinDrives() const throw();
/**
* Returns the maximum number of drives that should be provided.
*
* @return The maximum number of drives that should be provided.
*/
uint32_t getMaxDrives() const throw();
private:
/**
* The minimum number of drives that should be provided.
*/
uint32_t m_minDrives;
/**
* The maximum number of drives that should be provided.
*/
uint32_t m_maxDrives;
}; // class DriveQuota
} // namespace cta
......@@ -27,9 +27,10 @@ public:
* Constructor.
*
* @param name The name of the logical library.
* @param creator The identity of the user that created the logical library.
* @param comment The comment describing the logical library.
* @param creationTime Optionally the absolute time at which the
* @param creator The identity of the user that created this configuration
* item.
* @param comment The comment describing this configuration item.
* @param creationTime Optionally the absolute time at which this
* configuration item was created. If no value is given then the current
* time is used.
*/
......
#include "cta/MountCriteria.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::MountCriteria::MountCriteria():
m_nbBytes(0),
m_nbFiles(0),
m_ageInSecs(0) {
}
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::MountCriteria::MountCriteria(const uint64_t nbBytes, const uint64_t nbFiles,
const uint64_t ageInSecs):
m_nbBytes(nbBytes),
m_nbFiles(nbFiles),
m_ageInSecs(ageInSecs) {
}
//------------------------------------------------------------------------------
// getNbBytes
//------------------------------------------------------------------------------
uint64_t cta::MountCriteria::getNbBytes() const throw() {
return m_nbBytes;
}
//------------------------------------------------------------------------------
// getNbFiles
//------------------------------------------------------------------------------
uint64_t cta::MountCriteria::getNbFiles() const throw() {
return m_nbFiles;
}
//------------------------------------------------------------------------------
// getAgeInSecs
//------------------------------------------------------------------------------
uint64_t cta::MountCriteria::getAgeInSecs() const throw() {
return m_ageInSecs;
}
#pragma once
#include <stdint.h>
namespace cta {
/**
* Class representing the criteria be met in order to justify mounting a tape.
*/
class MountCriteria {
public:
/**
* Constructor.
*/
MountCriteria();
/**
* Constructor.
*
* @param nbBytes The minimum number of queued bytes required to justify a
* mount.
* @param nbFiles The minimum number of queued files required to justify a
* mount.
* @param ageInSecs The minimum age in seconds of queued data required to
* justify a mount.
*/
MountCriteria(const uint64_t nbBytes, const uint64_t nbFiles,
const uint64_t ageInSecs);
/**
* Returns the minimum number of queued bytes required to justify a mount.
*
* @return The minimum number of queued bytes required to justify a mount.
*/
uint64_t getNbBytes() const throw();
/**
* Returns the minimum number of queued files required to justify a mount.
*
* @return The minimum number of queued files required to justify a mount.
*/
uint64_t getNbFiles() const throw();
/**
* Returns the minimum age in seconds of queued data required to justify a
* mount.
*
* @return The minimum age in seconds of queued data required to justify a
* mount.
*/
uint64_t getAgeInSecs() const throw();
private:
/**
* The minimum number of queued bytes required to justify a mount.
*/
uint64_t m_nbBytes;
/**
* The minimum number of queued files required to justify a mount.
*/
uint64_t m_nbFiles;
/**
* The minimum age in seconds of queued data required to justify a mount.
*/
uint64_t m_ageInSecs;
}; // class MountCriteria
} // namespace cta
......@@ -29,9 +29,10 @@ public:
* @param name The name of the storage class.
* @param nbCopies The number of copies a file associated with this storage
* class should have on tape.
* @param creator The identity of the user that created the storage class.
* @param comment The comment describing the storage class.
* @param creationTime Optionally the absolute time at which the
* @param creator The identity of the user that created this configuration
* item.
* @param comment The comment describing this configuration item.
* @param creationTime Optionally the absolute time at which this
* configuration item was created. If no value is given then the current
* time is used.
*/
......
......@@ -32,9 +32,10 @@ public:
* belongs.
* @param tapePoolName The name of the tape pool to which the tape belongs.
* @param capacityInBytes The capacity of the tape.
* @param creator The identity of the user that created the tape.
* @param comment The comment describing the tape.
* @param creationTime Optionally the absolute time at which the
* @param creator The identity of the user that created this configuration
* item.
* @param comment The comment describing this configuration item.
* @param creationTime Optionally the absolute time at which this
* configuration item was created. If no value is given then the current
* time is used.
*/
......
......@@ -28,9 +28,10 @@ public:
* @param name The name of the tape pool.
* @param nbPartialTapes The maximum number of tapes that can be partially
* full at any moment in time.
* @param creator The identity of the user that created the tape pool.
* @param comment The comment describing the tape pool.
* @param creationTime Optionally the absolute time at which the
* @param creator The identity of the user that created this configuration
* item.
* @param comment The comment describing this configuration item.
* @param creationTime Optionally the absolute time at which this
* configuration item was created. If no value is given then the current
* time is used.
*/
......
#include "cta/UserGroup.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::UserGroup::UserGroup() {
}
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
cta::UserGroup::~UserGroup() throw() {
}
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::UserGroup::UserGroup(
const std::string &name,
const DriveQuota &archivalDriveQuota,
const DriveQuota &retrievalDriveQuota,
const MountCriteria &archivalMountCriteria,
const MountCriteria &retrievalMountCriteria,
const UserIdentity &creator,
const std::string &comment,
const time_t creationTime):
ConfigurationItem(creator, comment, creationTime),
m_name(name),
m_archivalDriveQuota(archivalDriveQuota),
m_retrievalDriveQuota(retrievalDriveQuota),
m_archivalMountCriteria(archivalMountCriteria),
m_retrievalMountCriteria(retrievalMountCriteria) {
}
//------------------------------------------------------------------------------
// getName
//------------------------------------------------------------------------------
const std::string &cta::UserGroup::getName() const throw() {
return m_name;
}
//------------------------------------------------------------------------------
// getArchivalQuota
//------------------------------------------------------------------------------
const cta::DriveQuota &cta::UserGroup::getArchivalDriveQuota() const throw() {
return m_archivalDriveQuota;
}
//------------------------------------------------------------------------------
// getRetrievalQuota
//------------------------------------------------------------------------------
const cta::DriveQuota &cta::UserGroup::getRetrievalDriveQuota() const throw() {
return m_retrievalDriveQuota;
}
//------------------------------------------------------------------------------
// getArchivalMountCriteria
//------------------------------------------------------------------------------
const cta::MountCriteria &cta::UserGroup::getArchivalMountCriteria() const
throw() {
return m_archivalMountCriteria;
}
//------------------------------------------------------------------------------
// getRetrievalMountCriteria
//------------------------------------------------------------------------------
const cta::MountCriteria &cta::UserGroup::getRetrievalMountCriteria() const
throw() {
return m_retrievalMountCriteria;
}
#pragma once
#include "cta/ConfigurationItem.hpp"
#include "cta/DriveQuota.hpp"
#include "cta/MountCriteria.hpp"
#include <stdint.h>
#include <string>
#include <time.h>
namespace cta {
/**
* Class representing a user group.
*/
class UserGroup: public ConfigurationItem {
public:
/**
* Constructor.
*/
UserGroup();
/**
* Destructor.
*/
~UserGroup() throw();
/**
* Constructor.
*
* @param name The name of the user group.
* @param archivalDriveQuota The tape drive quota for the user group when
* mounting tapes for file archival.
* @param retrievalDriveQuota The tape drive quota for the user group when
* mounting tapes for file retrieval.
* @param archivalMountCriteria The criteria of the user group to be met in
* order to justify mounting a tape for file archival.
* @param retrievalMountCriteria The criteria of the user group to be met in
* order to justify mounting a tape for file retrieval.
* @param creator The identity of the user that created this configuration
* item.
* @param comment The comment describing this configuration item.
* @param creationTime Optionally the absolute time at which this
* configuration item was created. If no value is given then the current
* time is used.
*/
UserGroup(
const std::string &name,
const DriveQuota &archivalDriveQuota,
const DriveQuota &retrievalDriveQuota,
const MountCriteria &archivalMountCriteria,
const MountCriteria &retrievalMountCriteria,
const UserIdentity &creator,
const std::string &comment,
const time_t creationTime = time(NULL));
/**
* Returns the name of the user group.
*
* @return The name of the user group.
*/
const std::string &getName() const throw();
/**
* Returns the tape drive quota for the user group when mounting tapes for
* file archival.
*
* @return The tape drive quota for the user group when mounting tapes for
* file archival.
*/
const DriveQuota &getArchivalDriveQuota() const throw();
/**
* Returns the tape drive quota for the user group when mounting tapes for
* file retrieval.
*
* @return The tape drive quota for the user group when mounting tapes for
* file retrieval.
*/
const DriveQuota &getRetrievalDriveQuota() const throw();
/**
* Returns the criteria of the user group to be met in order to justify
* mounting a tape for file archival.
*/
const MountCriteria &getArchivalMountCriteria() const throw();
/**
* Returns the criteria of the user group to be met in order to justify
* mounting a tape for file retrieval.
*/
const MountCriteria &getRetrievalMountCriteria() const throw();
private:
/**
* The name of the user group.
*/
std::string m_name;
/**
* The tape drive quota for the user group when mounting tapes for file
* archival.
*/
DriveQuota m_archivalDriveQuota;
/**
* The tape drive quota for the user group when mounting tapes for file
* retrieval.
*/
DriveQuota m_retrievalDriveQuota;
/**
* The criteria of the user group to be met in order to justify mounting a
* tape for file archival.
*/
MountCriteria m_archivalMountCriteria;
/**
* The criteria of the user group to be met in order to justify mounting a
* tape for file retrieval.
*/
MountCriteria m_retrievalMountCriteria;
}; // class UserGroup
} // namespace cta
#include "cta/VO.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::VO::VO() {
}
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
cta::VO::~VO() throw() {
}
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::VO::VO(
const std::string &name,
const UserIdentity &creator,
const std::string &comment,
const time_t creationTime):
ConfigurationItem(creator, comment, creationTime),
m_name(name) {
}
//------------------------------------------------------------------------------
// getName
//------------------------------------------------------------------------------
const std::string &cta::VO::getName() const throw() {
return m_name;
}
#pragma once
#include "cta/ConfigurationItem.hpp"
#include <string>
namespace cta {
/**
* Class representing a virtual organisation.
*/
class VO: public ConfigurationItem {
public:
/**
* Constructor.
*/
VO();
/**
* Destructor.
*/
~VO() throw();
/**
* Constructor.
*
* @param name The name of the virtual organisation.
* @param creator The identity of the user that created this configuration
* item.
* @param comment The comment describing this configuration item.
* @param creationTime Optionally the absolute time at which this
* configuration item was created. If no value is given then the current
* time is used.
*/
VO(
const std::string &name,
const UserIdentity &creator,
const std::string &comment,
const time_t creationTime = time(NULL));
/**
* Returns the name of the tape pool.
*
* @return The name of the tape pool.
*/
const std::string &getName() const throw();
private:
/**
* The name of the tape pool.
*/
std::string m_name;
}; // class VO
} // namespace cta
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment