diff --git a/xroot_plugins/XrdSsiCtaRequestMessage.cpp b/xroot_plugins/XrdSsiCtaRequestMessage.cpp index f73efbfebcc90fe3a53a3fce06357c03c83fff0d..f752af569aaa96ecb02c95680b9e34f33c38a446 100644 --- a/xroot_plugins/XrdSsiCtaRequestMessage.cpp +++ b/xroot_plugins/XrdSsiCtaRequestMessage.cpp @@ -289,6 +289,9 @@ void RequestMessage::process(const cta::xrd::Request &request, cta::xrd::Respons switch(request.notification().wf().event()) { using namespace cta::eos; + case Workflow::OPENW: + processOPENW (request.notification(), response); + break; case Workflow::CLOSEW: processCLOSEW (request.notification(), response); break; @@ -319,6 +322,32 @@ void RequestMessage::process(const cta::xrd::Request &request, cta::xrd::Respons // EOS Workflow commands +void RequestMessage::processOPENW(const cta::eos::Notification ¬ification, cta::xrd::Response &response) +{ + // Unpack message + + cta::common::dataStructures::UserIdentity originator; + originator.name = notification.cli().user().username(); + originator.group = notification.cli().user().groupname(); + + cta::utils::Timer t; + + const std::string storageClass = notification.file().xattr().at("CTA_StorageClass"); + // uint64_t archiveFileId = m_catalogue.checkAndGetNextArchiveFileId(m_cliIdentity.username, storageClass, originator); + + // Create a log entry + + cta::log::ScopedParamContainer params(m_lc); + //params.add("fileId", archiveFileId).add("catalogueTime", t.secs()); + m_lc.log(cta::log::INFO, "In processOPENW(): getting new archive file ID."); + + // response.mutable_xattr()->insert(google::protobuf::MapPair<std::string,std::string>("CTA_ArchiveFileId", std::to_string(archiveFileId))); + + // Set response type + + response.set_type(cta::xrd::Response::RSP_SUCCESS); +} + void RequestMessage::processCLOSEW(const cta::eos::Notification ¬ification, cta::xrd::Response &response) { // Unpack message diff --git a/xroot_plugins/XrdSsiCtaRequestMessage.hpp b/xroot_plugins/XrdSsiCtaRequestMessage.hpp index d005b0e573f0efc41f96a0d107af534ed4e260af..b5936035cfc4b3a86a83183d5d947edac66710b2 100644 --- a/xroot_plugins/XrdSsiCtaRequestMessage.hpp +++ b/xroot_plugins/XrdSsiCtaRequestMessage.hpp @@ -63,6 +63,7 @@ private: */ typedef void notification_event_t(const cta::eos::Notification ¬ification, cta::xrd::Response &response); + notification_event_t processOPENW; //!< New archive file ID event notification_event_t processCLOSEW; //!< Archive file event notification_event_t processPREPARE; //!< Retrieve file event notification_event_t processDELETE; //!< Delete file event