7 #include <mysql/mysql.h>
11 class MySQLJobProvider : public JobProvider {
13 static std::shared_ptr<int> lib_ref;
15 std::shared_ptr<MYSQL> conn;
18 std::shared_ptr<MYSQL> _connect( const std::string& server, const std::string& user, const std::string& password, const std::string& database );
21 MySQLJobProvider( const std::string& server, const std::string& user, const std::string& password, const std::string& database );
24 bool connect( const std::string& server, const std::string& user, const std::string& password, const std::string& database );
27 std::string escape_string( const std::string& target );
29 std::pair< int, std::shared_ptr<MYSQL_RES> > query( const std::string& query );
32 std::shared_ptr<Job> fetchJob();
33 void finishJob( std::shared_ptr<Job> job );
34 void failJob( std::shared_ptr<Job> job );
35 std::shared_ptr<TBSCertificate> fetchTBSCert( std::shared_ptr<Job> job );
36 void writeBack( std::shared_ptr<Job> job, std::shared_ptr<SignedCertificate> res );
37 std::pair<std::string, std::string> getRevocationInfo( std::shared_ptr<Job> job );
38 void writeBackRevocation( std::shared_ptr<Job> job, std::string date );