Commit edfcd00d authored by Dainius Simelevicius's avatar Dainius Simelevicius
Browse files

references #137: added support for direct eventing configuration in xmas/store2g

parent 11ceac57
......@@ -2,12 +2,12 @@
/*************************************************************************
* XDAQ Components for Distributed Data Acquisition *
* Copyright (C) 2000-2004, CERN. *
* Copyright (C) 2000-2020, CERN. *
* All rights reserved. *
* Authors: J. Gutleber and L. Orsini *
* Authors: J. Gutleber, L. Orsini and D. Simelevicius *
* *
* For the licensing terms see LICENSE. *
* For the list of contributors see CREDITS. *
* For the licensing terms see LICENSE. *
* For the list of contributors see CREDITS. *
*************************************************************************/
#ifndef _xmas_store2g_Application_h_
......@@ -122,6 +122,7 @@ namespace xmas
//
// Application parameters
//
xdata::Vector<xdata::String> eventings_;
xdata::String subscribeGroup_; // one or more comma separated groups hosting a ws-eventing service for monitoring
xdata::String storeGroup_; // one or more comma separated groups hosting a tstore service for storage
xdata::String storeView_; // view for tstore service for storage
......
......@@ -2,9 +2,9 @@
/*************************************************************************
* XDAQ Components for Distributed Data Acquisition *
* Copyright (C) 2000-2017, CERN. *
* Copyright (C) 2000-2020, CERN. *
* All rights reserved. *
* Authors: J. Gutleber, L. Orsini and d. Simelevicius *
* Authors: J. Gutleber, L. Orsini and D. Simelevicius *
* *
* For the licensing terms see LICENSE. *
* For the list of contributors see CREDITS. *
......
......@@ -2,13 +2,14 @@
/*************************************************************************
* XDAQ Components for Distributed Data Acquisition *
* Copyright (C) 2000-2004, CERN. *
* Copyright (C) 2000-2020, CERN. *
* All rights reserved. *
* Authors: J. Gutleber and L. Orsini *
* Authors: J. Gutleber, L. Orsini and D. Simelevicius *
* *
* For the licensing terms see LICENSE. *
* For the list of contributors see CREDITS. *
* For the licensing terms see LICENSE. *
* For the list of contributors see CREDITS. *
*************************************************************************/
#include "cgicc/CgiDefs.h"
#include "cgicc/Cgicc.h"
#include "cgicc/HTTPHTMLHeader.h"
......@@ -76,6 +77,7 @@ xmas::store2g::Application::Application (xdaq::ApplicationStub* s)
period_ = "PT15S";
subscribeExpiration_ = "PT30S";
this->getApplicationInfoSpace()->fireItemAvailable("eventings", &eventings_); //direct eventing addresses
this->getApplicationInfoSpace()->fireItemAvailable("oclFileName", &oclFileName_);
this->getApplicationInfoSpace()->fireItemAvailable("db", &db_);
this->getApplicationInfoSpace()->fireItemAvailable("authentication", &authentication_);
......@@ -197,6 +199,30 @@ void xmas::store2g::Application::actionPerformed (toolbox::Event& event)
static bool stagerEnabled = false;
if (event.type() == "urn:xdaq-event:profile-loaded")
{
LOG4CPLUS_DEBUG(this->getApplicationLogger(), "Setting proxy to b2in-eventing services");
if (eventings_.elements() != 0)
{
for (xdata::Vector<xdata::String>::iterator i = eventings_.begin(); i != eventings_.end(); i++)
{
try
{
LOG4CPLUS_DEBUG(this->getApplicationLogger(), "Adding eventing on " << (*i).toString());
b2inEventingProxy_->addURL(*i);
}
catch(b2in::utils::exception::Exception & e)
{
std::stringstream msg;
msg << "Failed to add b2in-eventing address";
XCEPT_DECLARE_NESTED(xmas::store2g::exception::Exception, ex, msg.str(), e);
LOG4CPLUS_ERROR (this->getApplicationLogger(), xcept::stdformat_exception_history(ex));
}
}
}
}
if (event.type() == "xplore::DiscoveryEvent")
{
// forward to cache
......@@ -658,14 +684,16 @@ void xmas::store2g::Application::timeExpired (toolbox::task::TimerEvent& e)
if (name == "discovery-staging")
{
try
if (eventings_.elements() == 0)
{
b2inEventingProxy_->scan();
}
catch (b2in::utils::exception::Exception& e)
{
LOG4CPLUS_FATAL(this->getApplicationLogger(), xcept::stdformat_exception_history(e));
try
{
b2inEventingProxy_->scan();
}
catch (b2in::utils::exception::Exception& e)
{
LOG4CPLUS_FATAL(this->getApplicationLogger(), xcept::stdformat_exception_history(e));
}
}
try
......
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