Commit 91f0beed authored by Eric Cano's avatar Eric Cano
Browse files

Moved parts from scheduler directory out into common, in a move to reduce this too long directory.

Also organised common in subdirectories, and added sub directory for mockDB.
parent af157d49
......@@ -3,21 +3,25 @@ cmake_minimum_required (VERSION 2.6)
include_directories(/usr/include/shift)
set (COMMON_LIB_SRC_FILES
ArchiveDirEntry.cpp
ArchiveDirIterator.cpp
ArchiveFileStatus.cpp
ByteArray.cpp
Checksum.cpp
admin/AdminHost.cpp
admin/AdminUser.cpp
archiveRoutes/ArchiveRoute.cpp
archiveRoutes/ArchiveRouteId.cpp
archiveNS/ArchiveDirEntry.cpp
archiveNS/ArchiveDirIterator.cpp
archiveNS/ArchiveFileStatus.cpp
archiveNS/TapeCopyLocationAndStatus.cpp
CreationLog.cpp
checksum/ByteArray.cpp
checksum/Checksum.cpp
exception/Backtrace.cpp
exception/Errnum.cpp
exception/Exception.cpp
exception/Serrnum.cpp
RemoteFileStatus.cpp
RemotePath.cpp
RemotePathAndStatus.cpp
SmartFd.cpp
remoteFS/RemoteFileStatus.cpp
remoteFS/RemotePath.cpp
remoteFS/RemotePathAndStatus.cpp
strerror_r_wrapper.cpp
TapeCopyLocationAndStatus.cpp
Timer.cpp
threading/ChildProcess.cpp
threading/Mutex.cpp
......@@ -35,10 +39,9 @@ target_link_libraries (ctacommon
uuid)
set (COMMON_UNIT_TESTS_LIB_SRC_FILES
ByteArrayTest.cpp
ChecksumTest.cpp
RemotePathTest.cpp
SmartFdTest.cpp
checksum/ByteArrayTest.cpp
checksum/ChecksumTest.cpp
remoteFS/RemotePathTest.cpp
UtilsTest.cpp)
add_library (ctacommonunittests SHARED
......
......@@ -18,7 +18,7 @@
#include <limits>
#include "scheduler/CreationLog.hpp"
#include "common/CreationLog.hpp"
//------------------------------------------------------------------------------
// constructor
......
......@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "scheduler/AdminHost.hpp"
#include "common/admin/AdminHost.hpp"
//------------------------------------------------------------------------------
// constructor
......@@ -35,9 +35,5 @@ cta::AdminHost::~AdminHost() throw() {
//------------------------------------------------------------------------------
cta::AdminHost::AdminHost(
const std::string &name,
const UserIdentity &creator,
const std::string &comment,
const time_t creationTime):
ConfigurationItem(creator, comment, creationTime),
name(name) {
}
const CreationLog &creationLog):
name(name), creationLog(creationLog) {}
\ No newline at end of file
......@@ -19,7 +19,7 @@
#pragma once
#include "common/UserIdentity.hpp"
#include "scheduler/ConfigurationItem.hpp"
#include "common/CreationLog.hpp"
#include <string>
......@@ -28,7 +28,7 @@ namespace cta {
/**
* An administration host.
*/
struct AdminHost: public ConfigurationItem {
struct AdminHost {
/**
* Constructor.
......@@ -54,14 +54,17 @@ struct AdminHost: public ConfigurationItem {
*/
AdminHost(
const std::string &name,
const UserIdentity &creator,
const std::string &comment,
const time_t creationTime = time(NULL));
const CreationLog &creationLog);
/**
* The network name of the administration host.
*/
std::string name;
/**
* The why, who, when, where of the creation of the admin host
*/
CreationLog creationLog;
}; // struct AdminHost
......
......@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "scheduler/AdminUser.hpp"
#include "common/admin/AdminUser.hpp"
//------------------------------------------------------------------------------
// constructor
......@@ -35,11 +35,8 @@ cta::AdminUser::~AdminUser() throw() {
//------------------------------------------------------------------------------
cta::AdminUser::AdminUser(
const UserIdentity &user,
const UserIdentity &creator,
const std::string &comment,
const time_t creationTime):
ConfigurationItem(creator, comment, creationTime),
m_user(user) {
const CreationLog &creationLog):
m_user(user), m_creationLog(creationLog) {
}
//------------------------------------------------------------------------------
......@@ -48,3 +45,11 @@ cta::AdminUser::AdminUser(
const cta::UserIdentity &cta::AdminUser::getUser() const throw() {
return m_user;
}
//------------------------------------------------------------------------------
// getCreationLog
//------------------------------------------------------------------------------
const cta::CreationLog &cta::AdminUser::getCreationLog() const throw() {
return m_creationLog;
}
\ No newline at end of file
......@@ -19,7 +19,7 @@
#pragma once
#include "common/UserIdentity.hpp"
#include "scheduler/ConfigurationItem.hpp"
#include "common/CreationLog.hpp"
#include <string>
......@@ -28,7 +28,7 @@ namespace cta {
/**
* Class representing an administrator.
*/
class AdminUser: public ConfigurationItem {
class AdminUser {
public:
/**
......@@ -55,9 +55,7 @@ public:
*/
AdminUser(
const UserIdentity &user,
const UserIdentity &creator,
const std::string &comment,
const time_t creationTime = time(NULL));
const CreationLog &creationLog);
/**
* Returns the identity of the administrator.
......@@ -65,6 +63,12 @@ public:
* @return The identity of the administrator.
*/
const UserIdentity &getUser() const throw();
/**
* Return the creation log
* @return the creation log
*/
const CreationLog &getCreationLog() const throw();
private:
......@@ -72,6 +76,11 @@ private:
* The identity of the administrator.
*/
UserIdentity m_user;
/**
* The who, when, why, where of the creation of the admin user
*/
CreationLog m_creationLog;
}; // class AdminUser
......
......@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "common/ArchiveDirEntry.hpp"
#include "common/archiveNS/ArchiveDirEntry.hpp"
//------------------------------------------------------------------------------
// entryTypeToStr
......
......@@ -18,7 +18,7 @@
#pragma once
#include "common/ArchiveFileStatus.hpp"
#include "common/archiveNS/ArchiveFileStatus.hpp"
#include <string>
......
......@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "common/ArchiveDirIterator.hpp"
#include "common/archiveNS/ArchiveDirIterator.hpp"
#include "common/exception/Exception.hpp"
using cta::exception::Exception;
......
......@@ -18,7 +18,7 @@
#pragma once
#include "common/ArchiveDirEntry.hpp"
#include "common/archiveNS/ArchiveDirEntry.hpp"
#include <list>
......
......@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "common/ArchiveFileStatus.hpp"
#include "common/archiveNS/ArchiveFileStatus.hpp"
//------------------------------------------------------------------------------
// constructor
......
......@@ -18,7 +18,7 @@
#pragma once
#include "common/Checksum.hpp"
#include "common/checksum/Checksum.hpp"
#include "common/UserIdentity.hpp"
#include <stdint.h>
......
......@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "common/TapeCopyLocationAndStatus.hpp"
#include "common/archiveNS/TapeCopyLocationAndStatus.hpp"
//------------------------------------------------------------------------------
// constructor
......
......@@ -19,7 +19,7 @@
#pragma once
#include <string>
#include "common/ArchiveFileStatus.hpp"
#include "common/archiveNS/ArchiveFileStatus.hpp"
namespace cta {
......@@ -50,6 +50,6 @@ struct TapeCopyLocationAndStatus {
uint64_t size; /**< The tape copy's size */
uint64_t fileId; /**< The file ID as recorded in the tape copy's header */
Checksum checksum;/**< The tape copy's checksum */
}; // class RemotePathAndStatus
}; // class TapeCopyLocationAndStatus
} // namespace cta
......@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "scheduler/ArchiveRoute.hpp"
#include "common/archiveRoutes/ArchiveRoute.hpp"
//------------------------------------------------------------------------------
// constructor
......
......@@ -19,7 +19,7 @@
#pragma once
#include "common/UserIdentity.hpp"
#include "scheduler/CreationLog.hpp"
#include "common/CreationLog.hpp"
#include <stdint.h>
#include <string>
......
......@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "scheduler/ArchiveRouteId.hpp"
#include "common/archiveRoutes/ArchiveRouteId.hpp"
//------------------------------------------------------------------------------
// constructor
......
......@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "common/ByteArray.hpp"
#include "common/checksum/ByteArray.hpp"
#include <ostream>
......
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