Skip to content
Snippets Groups Projects
Commit ca4b2e6e authored by Daniele Kruse's avatar Daniele Kruse
Browse files

Added create and delete storage class methods in castorns

parent 43dc6bcd
Branches
Tags
No related merge requests found
......@@ -35,6 +35,24 @@
#include "Cns_api.h"
//------------------------------------------------------------------------------
// createStorageClass
//------------------------------------------------------------------------------
void cta::CastorNameServer::createStorageClass(const SecurityIdentity &requester, const std::string &name, const uint16_t nbCopies) {
struct Cns_fileclass fc;
bzero(&fc, sizeof(struct Cns_fileclass));
strncpy(fc.name, name.c_str(), CA_MAXCLASNAMELEN);
fc.nbcopies = nbCopies;
cta::exception::Errnum::throwOnMinusOne(Cns_enterclass(const_cast<char *>(m_server.c_str()), &fc), __FUNCTION__);
}
//------------------------------------------------------------------------------
// deleteStorageClass
//------------------------------------------------------------------------------
void cta::CastorNameServer::deleteStorageClass(const SecurityIdentity &requester, const std::string &name) {
cta::exception::Errnum::throwOnMinusOne(Cns_deleteclass(const_cast<char *>(m_server.c_str()), 0, const_cast<char *>(name.c_str())), __FUNCTION__);
}
//------------------------------------------------------------------------------
// regularFileExists
//------------------------------------------------------------------------------
......
......@@ -74,6 +74,10 @@ public:
std::string getVidOfFile(const SecurityIdentity &requester, const std::string &path, const uint16_t copyNb) const;
void assertStorageClassIsNotInUse(const SecurityIdentity &requester, const std::string &storageClass, const std::string &path) const;
void createStorageClass(const SecurityIdentity &requester, const std::string &name, const uint16_t nbCopies);
void deleteStorageClass(const SecurityIdentity &requester, const std::string &name);
private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment