trust-store
2.0.0
Provides a common implementation of a trust store to be used by trusted helpers.
|
Go to the documentation of this file.
19 #ifndef CORE_TRUST_STORE_H_
20 #define CORE_TRUST_STORE_H_
65 : std::runtime_error(implementation_specific)
76 : std::runtime_error(implementation_specific)
181 virtual std::shared_ptr<Query>
query() = 0;
216 #endif // CORE_TRUST_STORE_H_
All core::trust-specific error/exception types go here.
The Request struct encapsulates information about a trust request answered by the user.
Models read/write/query access to persisted trust requests.
virtual void erase()=0
After successful execution, erase the current element and advance to the next request.
virtual void for_application_id(const std::string &id)=0
Limit the query to a specific application Id.
Status
The state of the query.
The ServiceNameMustNotBeEmpty is thrown if an empty service name is provided when creating a store.
virtual void execute()=0
Execute the query against the store.
virtual void add(const Request &request)=0
Add the provided request to the store. When this function returns true, the request has been persiste...
virtual void for_answer(Request::Answer answer)=0
Limit the query for a specific answer.
virtual void for_interval(const Request::Timestamp &begin, const Request::Timestamp &end)=0
Limit the query to the specified time interval.
ErrorResettingStore(const char *implementation_specific)
virtual void all()=0
Query all stored requests.
virtual Status status() const =0
Access the status of the query.
All Store-specific error/exception types go here.
Thrown if a store implementation could not reset state and drop all previously stored requests.
Thrown if functionality of a query is accessed although the query is in error state.
bool operator==(const Store &) const =delete
Answer
Enumerates the possible answers given by a user.
ErrorOpeningStore(const char *implementation_specific)
The Query class encapsulates queries against a trust store instance.
virtual std::shared_ptr< Query > query()=0
Create a query for this store.
Store & operator=(const Store &)=delete
Thrown if a store implementation could not access the persistence backend.
All Query-specific error/exception types go here.
Query(const Query &)=delete
#define CORE_TRUST_DLL_PUBLIC
std::chrono::system_clock::time_point Timestamp
Requests are timestamped with wallclock time.
virtual void next()=0
After successful execution, advance to the next request.
CORE_TRUST_DLL_PUBLIC std::shared_ptr< Store > create_default_store(const std::string &service_name)
Creates an instance for the default store implementation.
ServiceNameMustNotBeEmpty()
virtual void reset()=0
Resets the state of the store, implementations should discard all persistent and non-persistent state...
virtual void for_feature(Feature feature)=0
Limit the query to a service-specific feature.
virtual Request current()=0
Access the request the query currently points to.
Thrown when trying to access the current result although the query status is not has_more_results.
Store(const Store &)=delete