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 );
25 bool connect( const std::string& server, const std::string& user, const std::string& password, const std::string& database );
28 std::string escape_string( const std::string& target );
30 std::pair< int, std::shared_ptr<MYSQL_RES> > query( const std::string& query );
33 std::shared_ptr<Job> fetchJob();
34 void finishJob( std::shared_ptr<Job> job );
35 void failJob( std::shared_ptr<Job> job );
36 std::shared_ptr<TBSCertificate> fetchTBSCert( std::shared_ptr<Job> job );
37 void writeBack( std::shared_ptr<Job> job, std::shared_ptr<SignedCertificate> res );
38 std::pair<std::string, std::string> getRevocationInfo( std::shared_ptr<Job> job );
39 void writeBackRevocation( std::shared_ptr<Job> job, std::string date );