BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Public Types | Public Member Functions | Protected Member Functions
BeeeOn::CredentialsStorage Class Reference
Inheritance diagram for BeeeOn::CredentialsStorage:
BeeeOn::Loggable BeeeOn::FileCredentialsStorage

Public Types

typedef Poco::SharedPtr
< CredentialsStorage
Ptr
 
typedef std::function
< Poco::SharedPtr< Credentials >
Poco::AutoPtr
< Poco::Util::AbstractConfiguration >)> 
CredentialsFactory
 

Public Member Functions

 CredentialsStorage (const std::map< std::string, CredentialsFactory > &factory)
 
Poco::SharedPtr< Credentialsfind (const DeviceID &ID)
 
virtual void insertOrUpdate (const DeviceID &device, const Poco::SharedPtr< Credentials > credentials)
 
virtual void remove (const DeviceID &device)
 
virtual void clear ()
 
void save (Poco::AutoPtr< Poco::Util::AbstractConfiguration > conf, const std::string &root="credentials") const
 
void load (Poco::AutoPtr< Poco::Util::AbstractConfiguration > rootConf, const std::string &root="credentials")
 

Protected Member Functions

Poco::RWLock & lock () const
 
void insertOrUpdateUnlocked (const DeviceID &device, const Poco::SharedPtr< Credentials > credentials)
 
void removeUnlocked (const DeviceID &device)
 
void clearUnlocked ()
 
- Protected Member Functions inherited from BeeeOn::Loggable
void setupLogger (Poco::Logger *logger=0) const
 
Poco::Logger & logger () const
 
 Loggable (const ClassInfo &info)
 
 Loggable (const std::type_info &info)
 

Additional Inherited Members

- Static Protected Member Functions inherited from BeeeOn::Loggable
static Poco::Logger & forMethod (const char *name)
 
static Poco::Logger & forClass (const ClassInfo &info)
 
static Poco::Logger & forClass (const std::type_info &info)
 
template<typename T >
static Poco::Logger & forInstance (const T *i)
 
static void configureSimple (Poco::Logger &logger, const std::string &level)
 
static void logException (Poco::Logger &logger, const Poco::Message::Priority priority, const Poco::Exception &e, const char *file, size_t line)
 

Member Typedef Documentation

typedef std::function< Poco::SharedPtr<Credentials>Poco::AutoPtr<Poco::Util::AbstractConfiguration>)> BeeeOn::CredentialsStorage::CredentialsFactory

Factory method to construct a Credentials instance from the AbstractConfiguration. The given configuration is a view into the last level of the credentials key.

Example:

Configuration:

credentials.0xff0123456789abcd.type = sometype
credentials.0xff0123456789abcd.value = X

is send to function CredentialsStorage::load and transformed into:

type = sometype
value = X

The corresponding CredentialsFactory function is selected from CredentialsStorage::m_factory based on the "type". It creates the appropriate Credentials instance from the transformed configuration.


The documentation for this class was generated from the following files: