aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <0xdec05eba@gmail.com>2018-05-11 17:10:39 +0200
committerdec05eba <0xdec05eba@gmail.com>2018-05-11 17:10:42 +0200
commitebff7aeafded4dd9d245dbcfc80d9c8d83fe1242 (patch)
tree656afa366bba6c5fdd4c8f18da94d6d416b1e19f /include
parent95f683eae7a004860eae2bca43f56f98b769cf80 (diff)
Remove commit, maybe readd it later
Diffstat (limited to 'include')
-rw-r--r--include/odhtdb/Database.hpp9
-rw-r--r--include/odhtdb/StagedObject.hpp22
2 files changed, 0 insertions, 31 deletions
diff --git a/include/odhtdb/Database.hpp b/include/odhtdb/Database.hpp
index cf24c7e..12c618b 100644
--- a/include/odhtdb/Database.hpp
+++ b/include/odhtdb/Database.hpp
@@ -6,7 +6,6 @@
#include "DatabaseStorage.hpp"
#include "Hash.hpp"
#include "utils.hpp"
-#include "StagedObject.hpp"
#include "Signature.hpp"
#include "Permission.hpp"
#include "DatabaseNode.hpp"
@@ -145,7 +144,6 @@ namespace odhtdb
reponseKeyInfoHash = other.reponseKeyInfoHash;
}
};
-
class Database
{
DISABLE_COPY(Database)
@@ -166,7 +164,6 @@ namespace odhtdb
void addData(const DatabaseNode &nodeInfo, const LocalUser *userToPerformActionWith, DataView dataToAdd);
// Throws PermissionDeniedException if user @userToPerformActionWith is not allowed to add user @userToAdd to group @groupToAddUserTo
void addUser(const DatabaseNode &nodeInfo, const LocalUser *userToPerformActionWith, const std::string &userToAddName, const Signature::PublicKey &userToAddPublicKey, Group *groupToAddUserTo);
- void commit();
void setOnCreateNodeCallback(std::function<void(const DatabaseCreateNodeRequest&)> callbackFunc);
void setOnAddNodeCallback(std::function<void(const DatabaseAddNodeRequest&)> callbackFunc);
@@ -175,18 +172,12 @@ namespace odhtdb
DatabaseStorage& getStorage();
ntp::NtpTimestamp getSyncedTimestampUtc() const;
private:
- // Throws CommitCreateException on failure
- void commitStagedCreateObject(const std::unique_ptr<StagedObject> &stagedObject);
- // Throws CommitAddException on failure
- void commitStagedAddObject(const std::unique_ptr<StagedObject> &stagedObject);
void deserializeCreateRequest(const std::shared_ptr<dht::Value> &value, const Hash &hash, const std::shared_ptr<OwnedMemory> encryptionKey);
void deserializeAddRequest(const std::shared_ptr<dht::Value> &value, const Hash &requestDataHash, const std::shared_ptr<Hash> &nodeHash, const std::shared_ptr<OwnedMemory> encryptionKey);
bool listenCreateData(std::shared_ptr<dht::Value> value, const Hash &hash, const std::shared_ptr<OwnedMemory> encryptionKey);
bool listenAddData(std::shared_ptr<dht::Value> value, const Hash &requestDataHash, const std::shared_ptr<Hash> nodeHash, const std::shared_ptr<OwnedMemory> encryptionKey);
private:
dht::DhtRunner node;
- std::vector<std::unique_ptr<StagedObject>> stagedCreateObjects;
- std::vector<std::unique_ptr<StagedObject>> stagedAddObjects;
DatabaseStorage databaseStorage;
std::function<void(const DatabaseCreateNodeRequest&)> onCreateNodeCallbackFunc;
std::function<void(const DatabaseAddNodeRequest&)> onAddNodeCallbackFunc;
diff --git a/include/odhtdb/StagedObject.hpp b/include/odhtdb/StagedObject.hpp
deleted file mode 100644
index 0c9b534..0000000
--- a/include/odhtdb/StagedObject.hpp
+++ /dev/null
@@ -1,22 +0,0 @@
-#pragma once
-
-#include "utils.hpp"
-#include "Hash.hpp"
-#include "DataView.hpp"
-
-namespace odhtdb
-{
- struct StagedObject
- {
- DISABLE_COPY(StagedObject)
- DataView data;
- std::shared_ptr<Hash> requestKey;
-
- StagedObject(DataView &_data, const std::shared_ptr<Hash> &_requestKey) :
- data(_data),
- requestKey(_requestKey)
- {
-
- }
- };
-}