CMS 3D CMS Logo

XMLAuthenticationService.h
Go to the documentation of this file.
1 #ifndef COND_XMLAUTHENTITACTIONSERVICE_H
2 #define COND_XMLAUTHENTITACTIONSERVICE_H
3 
4 #include "RelationalAccess/IAuthenticationService.h"
5 #include "CoralKernel/Service.h"
6 
7 #include <map>
8 #include <set>
9 #include <string>
10 #include <boost/thread.hpp>
11 
12 namespace coral {
13 
14  class AuthenticationCredentials;
15  //class IAuthenticationCredentials;
16 }
17 
18 namespace cond {
19 
21 
28  {
29  public:
32  const std::string& connectionName );
33 
35  ~DataSourceEntry();
36 
40  void appendCredentialItem( const std::string& item,
41  const std::string& value );
42 
46  void appendCredentialItemForRole( const std::string& item,
47  const std::string& value,
48  const std::string& role );
49 
53  const coral::IAuthenticationCredentials& credentials() const;
54 
59  const coral::IAuthenticationCredentials& credentials( const std::string& role ) const;
60 
61  private:
64 
67 
69  coral::AuthenticationCredentials* m_default;
70 
72  std::map< std::string, coral::AuthenticationCredentials* > m_data;
73 
74  private:
77  DataSourceEntry& operator=( const DataSourceEntry& );
78  };
79 
85  class XMLAuthenticationService : public coral::Service,
86  virtual public coral::IAuthenticationService
87  {
88 
89  public:
91  explicit XMLAuthenticationService( const std::string& name );
92 
94  virtual ~XMLAuthenticationService();
95 
96  public:
101  const coral::IAuthenticationCredentials& credentials( const std::string& connectionString ) const;
102 
108  const coral::IAuthenticationCredentials& credentials( const std::string& connectionString,
109  const std::string& role ) const;
110 
111  public:
113  void setAuthenticationPath( const std::string& inputPath );
114 
115  private:
117  bool initialize();
118 
120  void reset();
121 
123  bool processFile( const std::string& inputFileName );
124 
126  std::set< std::string > verifyFileName();
127 
130 
133 
135  std::map< std::string, DataSourceEntry* > m_data;
136 
139 
140  coral::Property::CallbackID m_callbackID;
141  };
142 
143  }
144 
145 }
146 
147 #endif
std::map< std::string, coral::AuthenticationCredentials * > m_data
The structure with the authentication data for the various roles.
static AlgebraicMatrix initialize()
static boost::mutex mutex
Definition: LHEProxy.cc:11
static const std::string serviceName
bool m_isInitialized
Flag indicating whether the service has been initialized.
def processFile(file, outputDir)
Definition: valtools.py:304
coral::AuthenticationCredentials * m_default
The input file with the data.
Definition: Binary.h:9
Definition: value.py:1
std::map< std::string, DataSourceEntry * > m_data
The structure with the authentication data.
Definition: plugin.cc:24
std::string m_inputFileName
The input file with the data.
void reset(double vett[256])
Definition: TPedValues.cc:11