FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
libfossAgentDatabaseHandler.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2013-2014, Siemens AG
3 
4  This program is free software; you can redistribute it and/or
5  modify it under the terms of the GNU General Public License version 2
6  as published by the Free Software Foundation.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty
10  of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  See the GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software Foundation,
15  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 */
17 
18 #ifndef LIBFOSS_AGENT_DATABASE_HANDLER_HPP_
19 #define LIBFOSS_AGENT_DATABASE_HANDLER_HPP_
20 
21 #include <vector>
22 
24 
30 namespace fo
31 {
37  {
38 
39  protected:
41  public:
48  virtual ~AgentDatabaseHandler();
53 
54  bool begin() const;
55  bool commit() const;
56  bool rollback() const;
57 
58  char* getPFileNameForFileId(unsigned long pfileId) const;
59  std::string queryUploadTreeTableName(int uploadId);
60  std::vector<unsigned long> queryFileIdsVectorForUpload(int uploadId, bool ignoreFilesWithMimeType) const;
61  };
62 }
63 
64 #endif
std::vector< unsigned long > queryFileIdsVectorForUpload(int uploadId, bool ignoreFilesWithMimeType) const
Get pfile ids for a given upload id.
DB wrapper for agents.
bool commit() const
COMMIT a transaction block in DB.
bool rollback() const
ROLLBACK a transaction block in DB.
DB wrapper for agents.
char * getPFileNameForFileId(unsigned long pfileId) const
Get the file name of a give pfile id.
Database handler for agents.
std::string queryUploadTreeTableName(int uploadId)
Get the upload tree table name for a given upload id.
AgentDatabaseHandler operator=(const AgentDatabaseHandler &)=delete
bool begin() const
BEGIN a transaction block in DB.
fo namespace holds the FOSSology library functions.
DbManager dbManager
DbManager to use.
AgentDatabaseHandler(DbManager dbManager)