strus  0.17
storageTransactionInterface.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Patrick P. Frey
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
10 #ifndef _STRUS_STORAGE_TRANSACTION_INTERFACE_HPP_INCLUDED
11 #define _STRUS_STORAGE_TRANSACTION_INTERFACE_HPP_INCLUDED
12 #include <string>
14 #include "strus/numericVariant.hpp"
15 
16 namespace strus
17 {
18 
20 class StorageDocumentInterface;
22 class StorageDocumentUpdateInterface;
23 
27 {
28 public:
32 
37  createDocument( const std::string& docid_)=0;
38 
44  const Index& docno_)=0;
45 
48  virtual void deleteDocument(
49  const std::string& docid)=0;
50 
53  virtual void deleteUserAccessRights(
54  const std::string& username)=0;
55 
60  virtual void updateMetaData(
61  const Index& docno,
62  const std::string& varname,
63  const NumericVariant& value)=0;
64 
70  virtual void updateDocumentFrequency( const std::string& type, const std::string& value, int df_change)=0;
71 
74  virtual bool commit()=0;
75 
77  virtual void rollback()=0;
78 
81  virtual unsigned int nofDocumentsAffected() const=0;
82 };
83 
84 }//namespace
85 #endif
86 
87 
int32_t Index
Number type generally used for locally counted indices.
Definition: index.hpp:29
virtual StorageDocumentUpdateInterface * createDocumentUpdate(const Index &docno_)=0
Create an interface for a document to be updated within this transaction.
virtual unsigned int nofDocumentsAffected() const =0
Get the number of documents affected by the last transaction in case of a successful commit...
virtual void deleteUserAccessRights(const std::string &username)=0
Declare the access rights of a user to any document to be removed from the storage within this transa...
Object to declare all items for one insert/replace of a document in the storage.
Definition: storageDocumentInterface.hpp:21
Object to declare all items for one insert/update of a document in the storage.
Definition: storageTransactionInterface.hpp:26
virtual void deleteDocument(const std::string &docid)=0
Declare a document to be removed from the storage within this transaction.
Interface for contructing a document for inserting it into the storage.
virtual ~StorageTransactionInterface()
Destructor.
Definition: storageTransactionInterface.hpp:31
virtual bool commit()=0
Insert all documents and executes all commands defined in the transaction or none if one operation fa...
virtual void updateDocumentFrequency(const std::string &type, const std::string &value, int df_change)=0
Update of document frequency for features not in search index that get an implicitely stored df assig...
virtual void rollback()=0
Rollback of the transaction, no changes made.
virtual void updateMetaData(const Index &docno, const std::string &varname, const NumericVariant &value)=0
Update of meta data for a specific document (without creating it)
virtual StorageDocumentInterface * createDocument(const std::string &docid_)=0
Create one document to be inserted/replaced within this transaction.
Object to declare the items for an update of a document in the storage.
Definition: storageDocumentUpdateInterface.hpp:21