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 #include "CoralKernel/Property.h"
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 } // namespace coral
17 
18 namespace cond {
19 
21 
28  public:
30  DataSourceEntry(const std::string& serviceName, const std::string& connectionName);
31 
33  ~DataSourceEntry();
34 
38  void appendCredentialItem(const std::string& item, const std::string& value);
39 
43  void appendCredentialItemForRole(const std::string& item, const std::string& value, const std::string& role);
44 
48  const coral::IAuthenticationCredentials& credentials() const;
49 
54  const coral::IAuthenticationCredentials& credentials(const std::string& role) const;
55 
56  private:
59 
62 
64  coral::AuthenticationCredentials* m_default;
65 
67  std::map<std::string, coral::AuthenticationCredentials*> m_data;
68 
69  private:
70  DataSourceEntry() = delete;
71  DataSourceEntry(const DataSourceEntry&) = delete;
72  DataSourceEntry& operator=(const DataSourceEntry&) = delete;
73  };
74 
80  class XMLAuthenticationService : public coral::Service, virtual public coral::IAuthenticationService {
81  public:
83  explicit XMLAuthenticationService(const std::string& name);
84 
86  ~XMLAuthenticationService() override;
87 
88  public:
93  const coral::IAuthenticationCredentials& credentials(const std::string& connectionString) const override;
94 
100  const coral::IAuthenticationCredentials& credentials(const std::string& connectionString,
101  const std::string& role) const override;
102 
103  public:
105  void setAuthenticationPath(const std::string& inputPath);
106 
107  private:
109  bool initialize();
110 
112  void reset();
113 
116 
118  std::set<std::string> verifyFileName();
119 
122 
125 
127  std::map<std::string, DataSourceEntry*> m_data;
128 
131 
132  coral::Property::CallbackID m_callbackID;
133  };
134 
135  } // namespace XMLAuthenticationService
136 
137 } // namespace cond
138 
139 #endif
static AlgebraicMatrix initialize()
static boost::mutex mutex
Definition: Proxy.cc:9
std::map< std::string, DataSourceEntry * > m_data
The structure with the authentication data.
static const std::string serviceName
bool m_isInitialized
Flag indicating whether the service has been initialized.
def processFile(file, outputDir)
Definition: valtools.py:305
coral::AuthenticationCredentials * m_default
The input file with the data.
Definition: Binary.h:9
Definition: value.py:1
std::map< std::string, coral::AuthenticationCredentials * > m_data
The structure with the authentication data for the various roles.
Definition: plugin.cc:23
std::string m_inputFileName
The input file with the data.
void reset(double vett[256])
Definition: TPedValues.cc:11