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

Moved FileStatus from the scheduler directory to common

parent c626ed92
Branches
Tags
No related merge requests found
Showing
with 44 additions and 41 deletions
cmake_minimum_required (VERSION 2.6)
set (COMMON_LIB_SRC_FILES
FileStatus.cpp
SmartFd.cpp
Timer.cpp
UserIdentity.cpp
Utils.cpp
exception/Backtrace.cpp
exception/Errnum.cpp
......
......@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "scheduler/FileStatus.hpp"
#include "common/FileStatus.hpp"
//------------------------------------------------------------------------------
// constructor
......
......@@ -18,7 +18,7 @@
#pragma once
#include "scheduler/UserIdentity.hpp"
#include "common/UserIdentity.hpp"
#include <string>
......
......@@ -16,9 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "scheduler/UserIdentity.hpp"
#include "ostream"
#include "common/UserIdentity.hpp"
#include <limits>
#include <ostream>
//------------------------------------------------------------------------------
// constructor
......
File moved
......@@ -18,10 +18,10 @@
#pragma once
#include "scheduler/DirIterator.hpp"
#include "common/UserIdentity.hpp"
#include "nameserver/NameServer.hpp"
#include "scheduler/DirIterator.hpp"
#include "scheduler/SecurityIdentity.hpp"
#include "scheduler/UserIdentity.hpp"
#include <list>
#include <string>
......
......@@ -18,8 +18,8 @@
#pragma once
#include "common/FileStatus.hpp"
#include "scheduler/DirIterator.hpp"
#include "scheduler/FileStatus.hpp"
#include "scheduler/SecurityIdentity.hpp"
#include <string>
......
......@@ -16,12 +16,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "common/UserIdentity.hpp"
#include "objectstore/cta.pb.h"
#include "scheduler/CreationLog.hpp"
#include <string>
#include <stdint.h>
#include <limits>
#include "scheduler/CreationLog.hpp"
#include "scheduler/UserIdentity.hpp"
#include "objectstore/cta.pb.h"
namespace cta { namespace objectstore {
/**
......
......@@ -16,10 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "common/UserIdentity.hpp"
#include "objectstore/cta.pb.h"
#include <string>
#include <stdint.h>
#include "objectstore/cta.pb.h"
#include "scheduler/UserIdentity.hpp"
namespace cta { namespace objectstore {
......
......@@ -18,8 +18,8 @@
#pragma once
#include "common/UserIdentity.hpp"
#include "scheduler/ConfigurationItem.hpp"
#include "scheduler/UserIdentity.hpp"
#include <string>
......
......@@ -18,8 +18,8 @@
#pragma once
#include "common/UserIdentity.hpp"
#include "scheduler/ConfigurationItem.hpp"
#include "scheduler/UserIdentity.hpp"
#include <string>
......
......@@ -18,7 +18,7 @@
#pragma once
#include "scheduler/UserIdentity.hpp"
#include "common/UserIdentity.hpp"
#include "scheduler/CreationLog.hpp"
#include <stdint.h>
......
......@@ -22,7 +22,6 @@ set (CTA_SCHEDULER_SRC_FILES
DiskException.cpp
DriveQuota.cpp
FileAttribute.cpp
FileStatus.cpp
FileSystemDirEntry.cpp
FileSystemNode.cpp
FileSystemStorageClass.cpp
......@@ -50,7 +49,6 @@ set (CTA_SCHEDULER_SRC_FILES
TapeCopyLocation.cpp
TapeException.cpp
TapePool.cpp
UserIdentity.cpp
UserGroup.cpp
UserRequest.cpp
VO.cpp)
......
......@@ -18,7 +18,7 @@
#pragma once
#include "scheduler/UserIdentity.hpp"
#include "common/UserIdentity.hpp"
#include <string>
#include <time.h>
......
......@@ -18,7 +18,7 @@
#pragma once
#include "scheduler/UserIdentity.hpp"
#include "common/UserIdentity.hpp"
#include <string>
......
......@@ -62,7 +62,7 @@ void cta::FileSystemNode::deleteAndClearChildren() {
//------------------------------------------------------------------------------
cta::FileSystemNode &cta::FileSystemNode::getParent() {
if(NULL == m_parent) {
throw Exception("Internal error");
throw exception::Exception("Internal error");
}
return *m_parent;
......@@ -73,7 +73,7 @@ cta::FileSystemNode &cta::FileSystemNode::getParent() {
//------------------------------------------------------------------------------
const cta::FileSystemNode &cta::FileSystemNode::getParent() const {
if(NULL == m_parent) {
throw Exception("Internal error");
throw exception::Exception("Internal error");
}
return *m_parent;
......@@ -105,7 +105,8 @@ std::list<cta::DirEntry> cta::FileSystemNode::getDirEntries()
m_children.begin(); itor != m_children.end(); itor++) {
const FileSystemNode *const childNode = itor->second;
if(NULL == childNode) {
throw(Exception("getDirEntries encountered a NULL child pointer"));
throw(exception::Exception(std::string(__FUNCTION__) + " encountered a"
" NULL child pointer"));
}
const cta::FileSystemDirEntry &childEntry =
childNode->getFileSystemEntry();
......@@ -120,7 +121,7 @@ std::list<cta::DirEntry> cta::FileSystemNode::getDirEntries()
void cta::FileSystemNode::addChild(FileSystemNode *const child) {
if(childExists(child->getFileSystemEntry().getEntry().getName())) {
delete child;
throw Exception("FileSystemNode already exists");
throw exception::Exception("FileSystemNode already exists");
}
child->m_parent = this;
......@@ -149,10 +150,10 @@ bool cta::FileSystemNode::childExists(const std::string &name) const {
cta::FileSystemNode &cta::FileSystemNode::getChild(const std::string &name) {
std::map<std::string, FileSystemNode*>::iterator itor = m_children.find(name);
if(m_children.end() == itor) {
throw Exception("No such file or directory");
throw exception::Exception("No such file or directory");
}
if(NULL == itor->second) {
throw Exception("Unexpected NULL pointer");
throw exception::Exception("Unexpected NULL pointer");
}
return *(itor->second);
}
......@@ -165,10 +166,10 @@ const cta::FileSystemNode &cta::FileSystemNode::getChild(
std::map<std::string, FileSystemNode*>::const_iterator itor =
m_children.find(name);
if(m_children.end() == itor) {
throw Exception("No such file or directory");
throw exception::Exception("No such file or directory");
}
if(NULL == itor->second) {
throw Exception("Unexpected NULL pointer");
throw exception::Exception("Unexpected NULL pointer");
}
return *(itor->second);
}
......@@ -179,7 +180,7 @@ const cta::FileSystemNode &cta::FileSystemNode::getChild(
void cta::FileSystemNode::deleteChild(const std::string &name) {
std::map<std::string, FileSystemNode*>::iterator itor = m_children.find(name);
if(m_children.end() == itor) {
throw Exception("No such file or directory");
throw exception::Exception("No such file or directory");
}
delete itor->second;
......
......@@ -60,7 +60,7 @@ void cta::FileSystemStorageClass::incUsageCount() {
message << "Cannot increment usage count of storage class " <<
m_storageClass.getName() << " because its maximum value of UINT64_MAX"
" has already been reached";
throw Exception(message.str());
throw exception::Exception(message.str());
}
m_usageCount++;
}
......@@ -73,7 +73,7 @@ void cta::FileSystemStorageClass::decUsageCount() {
std::ostringstream message;
message << "Cannot decrement usage count of storage class " <<
m_storageClass.getName() << " because it is already at zero";
throw Exception(message.str());
throw exception::Exception(message.str());
}
m_usageCount--;
}
......@@ -19,9 +19,8 @@
#pragma once
#include "common/exception/Exception.hpp"
#include "common/UserIdentity.hpp"
#include "scheduler/StorageClass.hpp"
#include "scheduler/UserIdentity.hpp"
using cta::exception::Exception;
#include <sstream>
#include <string>
......
......@@ -33,7 +33,7 @@ void cta::FileSystemStorageClasses::createStorageClass(
StorageClass storageClass(name, nbCopies, creationLog);
m_storageClasses[name] = storageClass;
} catch(std::exception &ex) {
throw Exception(std::string("Failed to create storage class: ") +
throw exception::Exception(std::string("Failed to create storage class: ") +
ex.what());
}
}
......@@ -48,7 +48,7 @@ void cta::FileSystemStorageClasses::checkStorageClassDoesNotAlreadyExist(
if(itor != m_storageClasses.end()) {
std::ostringstream msg;
msg << "Storage class " << name << " already exists";
throw Exception(msg.str());
throw exception::Exception(msg.str());
}
}
......@@ -62,7 +62,7 @@ void cta::FileSystemStorageClasses::deleteStorageClass(
checkStorageClassIsNotInUse(name);
m_storageClasses.erase(name);
} catch(std::exception &ex) {
throw Exception(std::string("Failed to delete storage class: ") +
throw exception::Exception(std::string("Failed to delete storage class: ") +
ex.what());
}
}
......@@ -77,7 +77,7 @@ void cta::FileSystemStorageClasses::checkStorageClassExists(
if(itor == m_storageClasses.end()) {
std::ostringstream msg;
msg << "Storage class " << name << " does not exist";
throw Exception(msg.str());
throw exception::Exception(msg.str());
}
}
......@@ -97,7 +97,7 @@ void cta::FileSystemStorageClasses::checkStorageClassIsNotInUse(
if(itor->second.getUsageCount() > 0) {
std::ostringstream message;
message << "Storage class " << name << " is in use";
throw Exception(message.str());
throw exception::Exception(message.str());
}
}
......@@ -124,7 +124,7 @@ const cta::StorageClass &cta::FileSystemStorageClasses::getStorageClass(
if(itor == m_storageClasses.end()) {
std::ostringstream message;
message << "Storage class " << name << " does not exist";
throw Exception(message.str());
throw exception::Exception(message.str());
}
return itor->second.getStorageClass();
}
......@@ -146,7 +146,7 @@ void cta::FileSystemStorageClasses::incStorageClassUsageCount(
if(itor == m_storageClasses.end()) {
std::ostringstream message;
message << "Storage class " << name << " does not exist";
throw Exception(message.str());
throw exception::Exception(message.str());
}
itor->second.incUsageCount();
......@@ -169,7 +169,7 @@ void cta::FileSystemStorageClasses::decStorageClassUsageCount(
if(itor == m_storageClasses.end()) {
std::ostringstream message;
message << "Storage class " << name << " does not exist";
throw Exception(message.str());
throw exception::Exception(message.str());
}
itor->second.decUsageCount();
......
......@@ -18,8 +18,8 @@
#pragma once
#include "common/UserIdentity.hpp"
#include "scheduler/FileSystemStorageClass.hpp"
#include "scheduler/UserIdentity.hpp"
#include <list>
#include <map>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment