strus  0.17
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
7  */
12 #include <string>
14 #include "strus/numericVariant.hpp"
16 namespace strus
17 {
20 class StorageDocumentInterface;
22 class StorageDocumentUpdateInterface;
27 {
28 public:
37  createDocument( const std::string& docid_)=0;
44  const Index& docno_)=0;
48  virtual void deleteDocument(
49  const std::string& docid)=0;
53  virtual void deleteUserAccessRights(
54  const std::string& username)=0;
60  virtual void updateMetaData(
61  const Index& docno,
62  const std::string& varname,
63  const NumericVariant& value)=0;
70  virtual void updateDocumentFrequency( const std::string& type, const std::string& value, int df_change)=0;
74  virtual bool commit()=0;
77  virtual void rollback()=0;
81  virtual unsigned int nofDocumentsAffected() const=0;
82 };
84 }//namespace
85 #endif
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()
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