Commit 0ea89772 authored by Steven Murray's avatar Steven Murray
Browse files

ProcessCap object is now passed through to cleaner and label sessions

parent 0cb68b30
......@@ -27,11 +27,13 @@
// constructor
//------------------------------------------------------------------------------
castor::tape::tapeserver::daemon::CleanerSession::CleanerSession(
server::ProcessCap &capUtils,
mediachanger::MediaChangerFacade &mc,
castor::log::Logger &log,
const utils::DriveConfig &driveConfig,
System::virtualWrapper &sysWrapper,
const std::string &vid):
m_capUtils(capUtils),
m_mc(mc),
m_log(log),
m_driveConfig(driveConfig),
......
......@@ -26,6 +26,7 @@
#include "castor/log/LogContext.hpp"
#include "castor/log/Logger.hpp"
#include "castor/mediachanger/MediaChangerFacade.hpp"
#include "castor/server/ProcessCap.hpp"
#include "castor/tape/tapeserver/daemon/Session.hpp"
#include "castor/tape/tapeserver/drive/DriveInterface.hpp"
#include "castor/tape/tapeserver/file/Structures.hpp"
......@@ -47,14 +48,16 @@ namespace daemon {
/**
* Constructor
*
* @param mc Object representing the media changer.
* @param log Object representing the API to the CASTOR logging system.
* @param driveConfig Configuration of the tape drive to be cleaned.
* @param sysWrapper Object representing the operating system.
* @param vid The volume identifier of the mounted tape if known,
* else the empty string.
* @param capUtils Object providing support for UNIX capabilities.
* @param mc Object representing the media changer.
* @param log Object representing the API to the CASTOR logging system.
* @param driveConfig Configuration of the tape drive to be cleaned.
* @param sysWrapper Object representing the operating system.
* @param vid The volume identifier of the mounted tape if known,
* else the empty string.
*/
CleanerSession(
server::ProcessCap &capUtils,
mediachanger::MediaChangerFacade &mc,
castor::log::Logger &log,
const utils::DriveConfig &driveConfig,
......@@ -85,6 +88,11 @@ namespace daemon {
private:
/**
* Object providing support for UNIX capabilities.
*/
server::ProcessCap &m_capUtils;
/**
* The object representing the media changer.
*/
......
......@@ -43,6 +43,7 @@
// constructor
//------------------------------------------------------------------------------
castor::tape::tapeserver::daemon::LabelSession::LabelSession(
server::ProcessCap &capUtils,
messages::TapeserverProxy &tapeserver,
mediachanger::MediaChangerFacade &mc,
const legacymsg::TapeLabelRqstMsgBody &clientRequest,
......@@ -50,6 +51,7 @@ castor::tape::tapeserver::daemon::LabelSession::LabelSession(
System::virtualWrapper &sysWrapper,
const utils::DriveConfig &driveConfig,
const bool force):
m_capUtils(capUtils),
m_tapeserver(tapeserver),
m_mc(mc),
m_request(clientRequest),
......
......@@ -28,6 +28,7 @@
#include "castor/log/Logger.hpp"
#include "castor/mediachanger/MediaChangerFacade.hpp"
#include "castor/messages/TapeserverProxy.hpp"
#include "castor/server/ProcessCap.hpp"
#include "castor/tape/tapeserver/client/ClientProxy.hpp"
#include "castor/tape/tapeserver/system/Wrapper.hpp"
#include "castor/tape/tapeserver/daemon/Session.hpp"
......@@ -52,6 +53,7 @@ public:
/**
* Constructor
*
* @param capUtils Object providing support for UNIX capabilities.
* @param tapeserver Proxy object representing the tapeserverd daemon.
* @param mc Object representing the media changer.
* @param clientRequest The request to label a tape received from the label
......@@ -64,6 +66,7 @@ public:
* tape.
*/
LabelSession(
server::ProcessCap &capUtils,
messages::TapeserverProxy &tapeserver,
mediachanger::MediaChangerFacade &mc,
const legacymsg::TapeLabelRqstMsgBody &clientRequest,
......@@ -146,6 +149,11 @@ private:
*/
void labelTheTape(drive::DriveInterface *const drive);
/**
* Object providing support for UNIX capabilities.
*/
server::ProcessCap &m_capUtils;
/**
* Proxy object representing the tapeserverd daemon.
*/
......
......@@ -461,6 +461,8 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
castor::tape::tapeserver::daemon::ProcessForker::runCleanerSession(
const messages::ForkCleaner &rqst) {
try {
server::ProcessCap capUtils;
const utils::DriveConfig driveConfig = getDriveConfig(rqst);
std::list<log::Param> params;
params.push_back(log::Param("unitName", driveConfig.unitName));
......@@ -485,6 +487,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
castor::tape::System::realWrapper sWrapper;
CleanerSession cleanerSession(
capUtils,
mediaChangerFacade,
m_log,
driveConfig,
......@@ -518,7 +521,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
const legacymsg::RtcpJobRqstMsgBody vdqmJob = getVdqmJob(rqst);
castor::server::ProcessCap capUtils;
server::ProcessCap capUtils;
const int sizeOfIOThreadPoolForZMQ = 1;
messages::SmartZmqContext
......@@ -832,6 +835,8 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
castor::tape::tapeserver::daemon::ProcessForker::runLabelSession(
const messages::ForkLabel &rqst) {
try {
server::ProcessCap capUtils;
const utils::DriveConfig &driveConfig = getDriveConfig(rqst);
const legacymsg::TapeLabelRqstMsgBody labelJob = getLabelJob(rqst);
......@@ -861,6 +866,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
legacymsg::NsProxy_TapeAlwaysEmpty ns;
castor::tape::System::realWrapper sWrapper;
LabelSession labelsession(
capUtils,
tapeserver,
mediaChangerFacade,
labelJob,
......
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