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
......@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "nameserver/MockNameServer.hpp"
#include "nameserver/mockNS/MockNameServer.hpp"
#include <gtest/gtest.h>
#include <memory>
......
......@@ -17,7 +17,7 @@
*/
#include "common/exception/Exception.hpp"
#include "common/SmartFd.hpp"
#include "nameserver/mockNS/SmartFd.hpp"
#include <unistd.h>
......
......@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "common/SmartFd.hpp"
#include "nameserver/mockNS/SmartFd.hpp"
#include <gtest/gtest.h>
#include <sys/types.h>
......
......@@ -20,7 +20,7 @@
#include "ObjectOps.hpp"
#include "objectstore/cta.pb.h"
#include "common/RemotePathAndStatus.hpp"
#include "common/remoteFS/RemotePathAndStatus.hpp"
#include <list>
namespace cta { namespace objectstore {
......
......@@ -20,7 +20,7 @@
#include "common/UserIdentity.hpp"
#include "objectstore/cta.pb.h"
#include "scheduler/CreationLog.hpp"
#include "common/CreationLog.hpp"
#include <string>
#include <stdint.h>
......
......@@ -22,7 +22,7 @@
#include "ObjectOps.hpp"
#include <string>
#include "objectstore/cta.pb.h"
#include "scheduler/CreationLog.hpp"
#include "common/CreationLog.hpp"
#include "ArchiveToFileRequest.hpp"
#include "CreationLog.hpp"
#include "Agent.hpp"
......
......@@ -23,7 +23,7 @@
#include <unistd.h>
#include "common/exception/Exception.hpp"
#include "common/RemotePath.hpp"
#include "common/remoteFS/RemotePath.hpp"
#include "common/Utils.hpp"
#include "remotens/EosNS.hpp"
......
......@@ -18,7 +18,7 @@
#pragma once
#include "common/RemoteFileStatus.hpp"
#include "common/remoteFS/RemoteFileStatus.hpp"
#include "remotens/RemoteNS.hpp"
#include <map>
......
......@@ -23,7 +23,7 @@
#include <unistd.h>
#include "common/exception/Exception.hpp"
#include "common/RemotePath.hpp"
#include "common/remoteFS/RemotePath.hpp"
#include "common/Utils.hpp"
#include "remotens/MockRemoteNS.hpp"
......
......@@ -18,7 +18,7 @@
#pragma once
#include "common/RemoteFileStatus.hpp"
#include "common/remoteFS/RemoteFileStatus.hpp"
#include "remotens/RemoteNS.hpp"
#include <map>
......
......@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "common/RemotePath.hpp"
#include "common/remoteFS/RemotePath.hpp"
#include "remotens/MockRemoteNS.hpp"
#include <gtest/gtest.h>
......
......@@ -18,8 +18,8 @@
#pragma once
#include "common/RemotePath.hpp"
#include "common/RemoteFileStatus.hpp"
#include "common/remoteFS/RemotePath.hpp"
#include "common/remoteFS/RemoteFileStatus.hpp"
#include <memory>
......
......@@ -17,7 +17,7 @@
*/
#include "common/exception/Exception.hpp"
#include "common/RemotePath.hpp"
#include "common/remoteFS/RemotePath.hpp"
#include "remotens/RemoteNSDispatcher.hpp"
//------------------------------------------------------------------------------
......
......@@ -17,7 +17,7 @@
*/
#include "common/exception/Exception.hpp"
#include "common/RemotePath.hpp"
#include "common/remoteFS/RemotePath.hpp"
#include "remotens/RemoteNS.hpp"
#include "remotens/RemoteNSDispatcher.hpp"
......
......@@ -18,7 +18,7 @@
#pragma once
#include "common/RemotePathAndStatus.hpp"
#include "common/remoteFS/RemotePathAndStatus.hpp"
#include "scheduler/ArchiveRequest.hpp"
#include "SchedulerDatabase.hpp"
......
......@@ -18,7 +18,7 @@
#pragma once
#include "common/RemotePathAndStatus.hpp"
#include "common/remoteFS/RemotePathAndStatus.hpp"
#include "scheduler/ArchiveRequest.hpp"
#include <stdint.h>
......
......@@ -5,24 +5,18 @@ include_directories (${SQLITE3_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${PROJECT_SOURCE_DIR})
set (CTA_SCHEDULER_SRC_FILES
AdminHost.cpp
AdminUser.cpp
ArchiveJob.cpp
ArchiveMount.cpp
ArchiveRoute.cpp
ArchiveRouteId.cpp
ArchiveRequest.cpp
ArchiveToDirRequest.cpp
ArchiveToFileRequest.cpp
ArchiveToTapeCopyRequest.cpp
ConfigurationItem.cpp
CreationLog.cpp
DiskException.cpp
DriveQuota.cpp
TapeJob.cpp
LogicalLibrary.cpp
MockDB/MockSchedulerDatabase.cpp
MockDB/MockSchedulerDatabaseFactory.cpp
mockDB/MockSchedulerDatabase.cpp
mockDB/MockSchedulerDatabaseFactory.cpp
MountCriteria.cpp
RetrieveJob.cpp
RetrieveFromTapeCopyRequest.cpp
......@@ -33,8 +27,8 @@ set (CTA_SCHEDULER_SRC_FILES
SchedulerDatabase.cpp
SchedulerDatabaseFactory.cpp
SecurityIdentity.cpp
SqliteColumnNameToIndex.cpp
SQLiteStatementDeleter.cpp
mockDB/SqliteColumnNameToIndex.cpp
mockDB/SQLiteStatementDeleter.cpp
StorageClass.cpp
Tape.cpp
TapeCopyLocation.cpp
......@@ -48,11 +42,11 @@ set (CTA_SCHEDULER_SRC_FILES
add_library (ctascheduler SHARED
${CTA_SCHEDULER_SRC_FILES})
target_link_libraries (ctascheduler ${SQLITE3_LIBRARY_RELEASE})
target_link_libraries (ctascheduler ${SQLITE3_LIBRARY_RELEASE} ctacommon)
add_library (ctaschedulertest SHARED
MockDB/MockSchedulerDatabase.cpp
MockDB/MockSchedulerDatabaseFactory.cpp
mockDB/MockSchedulerDatabase.cpp
mockDB/MockSchedulerDatabaseFactory.cpp
SchedulerDatabaseFactory.cpp
SchedulerDatabaseTest.cpp
SchedulerTest.cpp
......
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "scheduler/ConfigurationItem.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::ConfigurationItem::ConfigurationItem() {
}
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
cta::ConfigurationItem::~ConfigurationItem() throw() {
}
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::ConfigurationItem::ConfigurationItem(const UserIdentity &creator,
const std::string &comment, const time_t creationTime):
m_creator(creator),
m_comment(comment),
m_creationTime(creationTime) {
}
//------------------------------------------------------------------------------
// getCreator
//------------------------------------------------------------------------------
const cta::UserIdentity &cta::ConfigurationItem::getCreator() const throw() {
return m_creator;
}
//------------------------------------------------------------------------------
// getComment
//------------------------------------------------------------------------------
const std::string &cta::ConfigurationItem::getComment() const throw() {
return m_comment;
}
//------------------------------------------------------------------------------
// getCreationTime
//------------------------------------------------------------------------------
time_t cta::ConfigurationItem::getCreationTime() const throw() {
return m_creationTime;
}
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "common/UserIdentity.hpp"
#include <string>
#include <time.h>
namespace cta {
/**
* Abstract class representing a configuration item.
*/
class ConfigurationItem {
public:
/**
* Constructor.
*/
ConfigurationItem();
/**
* Destructor.
*/
virtual ~ConfigurationItem() throw() = 0;
/**
* Constructor.
*
* @param creator The identity of the user that created this configuration
* item.
* @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.
*/
ConfigurationItem(const UserIdentity &creator, const std::string &comment,
const time_t creationTime = time(NULL));
/**
* Returns the identity of the user that created this 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 this 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 this 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 this configuration item.
*/
UserIdentity m_creator;
/**
* The comment made by the creator of this configuration request.
*/
std::string m_comment;
/**
* The absolute time at which this configuration item was created.
*/
time_t m_creationTime;
}; // class ConfigurationItem
} // namespace cta
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