#include <XMLAuthenticationService.h>
Public Member Functions | |
const coral::IAuthenticationCredentials & | credentials (const std::string &connectionString) const |
const coral::IAuthenticationCredentials & | credentials (const std::string &connectionString, const std::string &role) const |
void | setAuthenticationPath (const std::string &inputPath) |
Sets the input file name. More... | |
XMLAuthenticationService (const std::string &name) | |
Standard Constructor. More... | |
virtual | ~XMLAuthenticationService () |
Standard Destructor. More... | |
Private Member Functions | |
bool | initialize () |
Service framework related initialization. More... | |
bool | processFile (const std::string &inputFileName) |
Parses an xml file. More... | |
void | reset () |
Reset parsed data. More... | |
std::set< std::string > | verifyFileName () |
Verifies the existence of the authentication files. More... | |
Private Attributes | |
coral::Property::CallbackID | m_callbackID |
std::map< std::string, DataSourceEntry * > | m_data |
The structure with the authentication data. More... | |
std::string | m_inputFileName |
The input file with the data. More... | |
bool | m_isInitialized |
Flag indicating whether the service has been initialized. More... | |
boost::mutex | m_mutexLock |
the mutex lock More... | |
Definition at line 85 of file XMLAuthenticationService.h.
|
explicit |
Standard Constructor.
Definition at line 88 of file XMLAuthenticationService.cc.
References cond::auth::COND_AUTH_PATH_PROPERTY, instance, m_callbackID, and setAuthenticationPath().
|
virtual |
Standard Destructor.
Definition at line 105 of file XMLAuthenticationService.cc.
References m_data.
const coral::IAuthenticationCredentials & cond::XMLAuthenticationService::XMLAuthenticationService::credentials | ( | const std::string & | connectionString | ) | const |
Returns a reference to the credentials object for a given connection string. If the connection string is not known to the service an UnknownConnectionException is thrown.
Definition at line 385 of file XMLAuthenticationService.cc.
References initialize(), CommonMethods::lock(), m_data, m_isInitialized, m_mutexLock, and dataset::name.
const coral::IAuthenticationCredentials & cond::XMLAuthenticationService::XMLAuthenticationService::credentials | ( | const std::string & | connectionString, |
const std::string & | role | ||
) | const |
Returns a reference to the credentials object for a given connection string. If the connection string is not known to the service an UnknownConnectionException is thrown. If the role is not known to the service an UnknownRoleException is thrown.
Definition at line 399 of file XMLAuthenticationService.cc.
References initialize(), CommonMethods::lock(), m_data, m_isInitialized, m_mutexLock, and dataset::name.
|
private |
Service framework related initialization.
Definition at line 334 of file XMLAuthenticationService.cc.
References Debug, mitigatedMETSequence_cff::inputFileNames, cmsBatch::log, m_inputFileName, m_isInitialized, python.rootplot.argparse::message, processFile(), fetchall_from_DQM_v2::release, reset(), mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, verifyFileName(), cms::concurrency::xercesInitialize(), and cms::concurrency::xercesTerminate().
Referenced by credentials().
|
private |
Parses an xml file.
if(name!=XML_AUTHENTICATION_FILE){ cond::DecodingKey key; try{ key.readUserKeyString(cont); log << coral::Debug << "Decoding content of file \""<< key.dataSource()<<"""<<coral::MessageStream::endmsg; cond::FileReader dataFile; dataFile.read(key.dataSource()); cont = dataFile.content(); cont = coral::Cipher::decode(cont,key.key()); } catch (const cond::Exception& exc){ log << coral::Error << std::string(exc.what())<<coral::MessageStream::endmsg; return false; }
} else { seal::MessageStream log( this, this->name(),seal::Msg::Verbose ); log<<coral::Debug<< "Authentication file is expected standard XML."<<coral::MessageStream::endmsg; }
Definition at line 124 of file XMLAuthenticationService.cc.
References cond::XMLAuthenticationService::DataSourceEntry::appendCredentialItem(), cond::XMLAuthenticationService::DataSourceEntry::appendCredentialItemForRole(), cond::FileReader::content(), Debug, analyzePatCleaning_cfg::inputFile, cmsBatch::log, m_data, python.rootplot.argparse::message, dataset::name, createfilelist::parser, callgraph::path, cond::FileReader::read(), fetchall_from_DQM_v2::release, mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, and cms::Exception::what().
Referenced by initialize().
|
private |
Reset parsed data.
Definition at line 375 of file XMLAuthenticationService.cc.
References m_data, and m_isInitialized.
Referenced by MatrixReader.MatrixReader::__init__(), initialize(), data_sources.json_list::next(), setAuthenticationPath(), and MatrixReader.MatrixReader::showRaw().
void cond::XMLAuthenticationService::XMLAuthenticationService::setAuthenticationPath | ( | const std::string & | inputPath | ) |
Sets the input file name.
Definition at line 112 of file XMLAuthenticationService.cc.
References m_inputFileName, callgraph::path, reset(), and XML_AUTHENTICATION_FILE.
Referenced by XMLAuthenticationService().
|
private |
Verifies the existence of the authentication files.
Definition at line 414 of file XMLAuthenticationService.cc.
References Debug, DEFINE_CORALSERVICE, LaserTracksInput_cfi::fileNames, cmsBatch::log, m_inputFileName, callgraph::path, and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by initialize().
|
private |
Definition at line 140 of file XMLAuthenticationService.h.
Referenced by XMLAuthenticationService().
|
private |
The structure with the authentication data.
Definition at line 135 of file XMLAuthenticationService.h.
Referenced by credentials(), processFile(), reset(), and ~XMLAuthenticationService().
|
private |
The input file with the data.
Definition at line 132 of file XMLAuthenticationService.h.
Referenced by initialize(), setAuthenticationPath(), and verifyFileName().
|
private |
Flag indicating whether the service has been initialized.
Definition at line 129 of file XMLAuthenticationService.h.
Referenced by credentials(), initialize(), and reset().
|
mutableprivate |
the mutex lock
Definition at line 138 of file XMLAuthenticationService.h.
Referenced by credentials().