Esempio n. 1
5
bool DBauditConfig::parse( const config::ConfigurationNode& pt, const std::string& /*node*/,
			   const module::ModuleDirectory* /*modules*/ )
{
	using namespace config;

	bool retVal = true;
	bool reqDefined = false;
	m_config_pos = pt.position();

	for ( config::ConfigurationNode::const_iterator L1it = pt.begin(); L1it != pt.end(); L1it++ )	{
		if ( boost::algorithm::iequals( L1it->first, "required" ))	{
			if ( !Parser::getValue( logPrefix().c_str(), *L1it, m_required, Parser::BoolDomain(), &reqDefined ))
				retVal = false;
		}
		else if ( boost::algorithm::iequals( L1it->first, "database" ))	{
			bool isDefined = ( !m_dbConfig.empty() );
			if ( !Parser::getValue( logPrefix().c_str(), *L1it, m_dbConfig, &isDefined ))
				retVal = false;
		}
		else if ( boost::algorithm::iequals( L1it->first, "identifier" ))	{
			bool isDefined = ( !m_id.empty() );
			if ( !Parser::getValue( logPrefix().c_str(), *L1it, m_id, &isDefined ))
				retVal = false;
		}
		else	{
			LOG_WARNING << logPrefix() << "unknown configuration option: '"
					<< L1it->first << "' " << L1it->second.position().logtext();
		}
	}
	return retVal;
}
Esempio n. 2
0
config::ConfigurationNode OracleTestConfig::extractMyNodes( const config::ConfigurationNode& pt )
{
	config::ConfigurationNode rt;
	config::ConfigurationNode::const_iterator pi = pt.begin(), pe = pt.end();

	for ( ; pi != pe; ++pi )	{
		if ( boost::algorithm::iequals( pi->first, "inputfile" ))
			m_input_filename = pi->second.data();
		else if ( boost::algorithm::iequals( pi->first, "dumpfile" ))
			m_dump_filename = pi->second.data();
		else
			rt.add_child( pi->first, pi->second );
	}
	return rt;
}
bool ProcProviderConfiguration::parse( const config::ConfigurationNode& pt, const std::string& /*node*/,
				const module::ModuleDirectory* modules )
{
	using namespace _Wolframe::config;
	bool retVal = true;

	for ( config::ConfigurationNode::const_iterator L1it = pt.begin(); L1it != pt.end(); L1it++ )	{
		if ( boost::algorithm::iequals( "database", L1it->first ))
		{
			std::string databaseId;
			if ( ! Parser::getValue( logPrefix().c_str(), *L1it, databaseId))
			{
				retVal = false;
			}
			else
			{
				m_databaseIds.push_back( databaseId);
			}
		}
		else if ( boost::algorithm::iequals( "program", L1it->first ) )	{
			std::string programFile;
			if ( !Parser::getValue( logPrefix().c_str(), *L1it, programFile ))
			{
				retVal = false;
			}
			else
			{
				m_programFiles.push_back( programFile );
			}
		}
		else if ( boost::algorithm::iequals( "cmdhandler", L1it->first )
			|| boost::algorithm::iequals( "runtimeenv", L1it->first ) )	{
			for ( config::ConfigurationNode::const_iterator L2it = L1it->second.begin();
									  L2it != L1it->second.end(); L2it++ )	{
				if (modules)
				{
					retVal &= parseModuleConfiguration( L1it->first, L2it->first, L2it->second, m_procConfig, modules);
				}
			}
		}
		else
		{	
			LOG_ERROR << logPrefix() << "unknown configuration option: '" << L1it->first << "'";
		}
	}
	return retVal;
}
Esempio n. 4
0
bool JobScheduleDBconfig::parse( const config::ConfigurationNode& pt, const std::string& /*node*/,
			   const module::ModulesDirectory* /*modules*/ )
{
	using namespace config;

	bool retVal = true;

	for ( config::ConfigurationNode::const_iterator L1it = pt.begin(); L1it != pt.end(); L1it++ )	{
		if ( boost::algorithm::iequals( L1it->first, "database" ))	{
			bool isDefined = ( !m_dbConfig.empty() );
			if ( !Parser::getValue( logPrefix().c_str(), *L1it, m_dbConfig, &isDefined ))
				retVal = false;
		}
		else	{
			LOG_WARNING << logPrefix() << "unknown configuration option: '"
					<< L1it->first << "'";
		}
	}
	return retVal;
}
Esempio n. 5
0
bool pEchoConfiguration::parse( const config::ConfigurationNode& pt, const std::string& /*node*/,
				const module::ModuleDirectory* /*modules*/ )
{
	bool retVal = true;
	bool isSet = false;

	for ( config::ConfigurationNode::const_iterator L1it = pt.begin(); L1it != pt.end(); L1it++ )	{
		if ( boost::algorithm::iequals( L1it->first, "idle" ))	{
			if ( !config::Parser::getValue( logPrefix().c_str(), *L1it, timeout ))
				retVal = false;
			isSet = true;
		}
		else
			LOG_WARNING << logPrefix() << "unknown configuration option: '"
				    << L1it->first << "'";
	}
	if ( !isSet )
		timeout = DEFAULT_TIMEOUT;

	return retVal;
}
	bool parse( const config::ConfigurationNode& pt, const std::string& node,
			const module::ModuleDirectory*)
	{
		try
		{
			if (!m_baseptr) throw std::logic_error("configuration structure base pointer not set with setBasePtr(void*)");
			serialize::parseConfigStructureVP( m_baseptr, m_descr, pt);
			return true;
		}
		catch (const std::runtime_error& e)
		{
			LOG_ERROR << logPrefix() << e.what() << " in " << node << " " << pt.position().logtext();
			return false;
		}
	}