19#ifndef CORE_TRUST_STORE_H_
20#define CORE_TRUST_STORE_H_
65 : std::runtime_error(implementation_specific)
76 : std::runtime_error(implementation_specific)
186 virtual std::shared_ptr<Query>
query() = 0;
virtual void for_feature(Feature feature)=0
Limit the query to a service-specific feature.
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.
virtual void next()=0
After successful execution, advance to the next request.
virtual Request current()=0
Access the request the query currently points to.
Status
The state of the query.
virtual void for_interval(const Request::Timestamp &begin, const Request::Timestamp &end)=0
Limit the query to the specified time interval.
virtual void execute()=0
Execute the query against the store.
virtual Status status() const =0
Access the status of the query.
Query(const Query &)=delete
virtual void for_answer(Request::Answer answer)=0
Limit the query for a specific answer.
virtual void all()=0
Query all stored requests.
virtual void remove_application(const std::string &id)=0
Remove all requests issued by the given application.
Store(const Store &)=delete
bool operator==(const Store &) const =delete
Store & operator=(const Store &)=delete
virtual std::shared_ptr< Query > query()=0
Create a query for this 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 reset()=0
Resets the state of the store, implementations should discard all persistent and non-persistent state...
Contains functionality for implementing Ubuntu's trust model.
TaggedInteger< tag::Feature, std::uint64_t > Feature
Our internal service-feature type.
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()
All core::trust-specific error/exception types go here.
The Request struct encapsulates information about a trust request answered by the user.
Answer
Enumerates the possible answers given by a user.
std::chrono::system_clock::time_point Timestamp
Requests are timestamped with wallclock time.
ErrorOpeningStore(const char *implementation_specific)
ErrorResettingStore(const char *implementation_specific)
All Store-specific error/exception types go here.
All Query-specific error/exception types go here.
#define CORE_TRUST_DLL_PUBLIC