21 #ifndef KINETIC_CPP_CLIENT_NONBLOCKING_KINETIC_CONNECTION_H_
22 #define KINETIC_CPP_CLIENT_NONBLOCKING_KINETIC_CONNECTION_H_
24 #include "nonblocking_kinetic_connection_interface.h"
32 bool Run(fd_set *read_fds, fd_set *write_fds,
int *nfds);
33 bool RemoveHandler(HandlerKey handler_key);
34 void SetClientClusterVersion(int64_t cluster_version);
36 HandlerKey NoOp(
const shared_ptr<SimpleCallbackInterface> callback);
37 HandlerKey Get(
const string key,
const shared_ptr<GetCallbackInterface> callback);
38 HandlerKey Get(
const shared_ptr<const string> key,
const shared_ptr<GetCallbackInterface> callback);
39 HandlerKey GetNext(
const shared_ptr<const string> key,
const shared_ptr<GetCallbackInterface> callback);
40 HandlerKey GetNext(
const string key,
const shared_ptr<GetCallbackInterface> callback);
41 HandlerKey GetPrevious(
const shared_ptr<const string> key,
const shared_ptr<GetCallbackInterface> callback);
42 HandlerKey GetPrevious(
const string key,
const shared_ptr<GetCallbackInterface> callback);
43 HandlerKey GetVersion(
const shared_ptr<const string> key,
const shared_ptr<GetVersionCallbackInterface> callback);
44 HandlerKey GetVersion(
const string key,
const shared_ptr<GetVersionCallbackInterface> callback);
45 HandlerKey GetKeyRange(
const shared_ptr<const string> start_key,
bool start_key_inclusive,
46 const shared_ptr<const string> end_key,
bool end_key_inclusive,
47 bool reverse_results, int32_t max_results,
const shared_ptr<GetKeyRangeCallbackInterface> callback);
48 HandlerKey GetKeyRange(
const string start_key,
bool start_key_inclusive,
49 const string end_key,
bool end_key_inclusive,
50 bool reverse_results, int32_t max_results,
const shared_ptr<GetKeyRangeCallbackInterface> callback);
51 HandlerKey Put(
const shared_ptr<const string> key,
const shared_ptr<const string> current_version, WriteMode mode,
52 const shared_ptr<const KineticRecord> record,
const shared_ptr<PutCallbackInterface> callback);
53 HandlerKey Put(
const string key,
const string current_version, WriteMode mode,
54 const shared_ptr<const KineticRecord> record,
const shared_ptr<PutCallbackInterface> callback);
55 HandlerKey Put(
const shared_ptr<const string> key,
const shared_ptr<const string> current_version, WriteMode mode,
56 const shared_ptr<const KineticRecord> record,
const shared_ptr<PutCallbackInterface> callback,
57 PersistMode persistMode);
58 HandlerKey Put(
const string key,
const string current_version, WriteMode mode,
59 const shared_ptr<const KineticRecord> record,
const shared_ptr<PutCallbackInterface> callback,
60 PersistMode persistMode);
61 HandlerKey Delete(
const shared_ptr<const string> key,
const shared_ptr<const string> version, WriteMode mode,
62 const shared_ptr<SimpleCallbackInterface> callback, PersistMode persistMode);
63 HandlerKey Delete(
const string key,
const string version, WriteMode mode,
64 const shared_ptr<SimpleCallbackInterface> callback, PersistMode persistMode);
65 HandlerKey Delete(
const shared_ptr<const string> key,
const shared_ptr<const string> version, WriteMode mode,
66 const shared_ptr<SimpleCallbackInterface> callback);
67 HandlerKey Delete(
const string key,
const string version, WriteMode mode,
68 const shared_ptr<SimpleCallbackInterface> callback);
69 HandlerKey P2PPush(
const P2PPushRequest& push_request,
const shared_ptr<P2PPushCallbackInterface> callback);
70 HandlerKey P2PPush(
const shared_ptr<const P2PPushRequest> push_request,
71 const shared_ptr<P2PPushCallbackInterface> callback);
72 HandlerKey GetLog(
const shared_ptr<GetLogCallbackInterface> callback);
73 HandlerKey GetLog(
const vector<Command_GetLog_Type>& types,
const shared_ptr<GetLogCallbackInterface> callback);
75 HandlerKey UpdateFirmware(
const shared_ptr<const string> new_firmware,
const shared_ptr<SimpleCallbackInterface> callback);
76 HandlerKey SetClusterVersion(int64_t new_cluster_version,
const shared_ptr<SimpleCallbackInterface> callback);
78 HandlerKey InstantErase(
const shared_ptr<string> pin,
const shared_ptr<SimpleCallbackInterface> callback);
79 HandlerKey InstantErase(
const string pin,
const shared_ptr<SimpleCallbackInterface> callback);
80 HandlerKey SecureErase(
const shared_ptr<string> pin,
const shared_ptr<SimpleCallbackInterface> callback);
81 HandlerKey SecureErase(
const string pin,
const shared_ptr<SimpleCallbackInterface> callback);
82 HandlerKey LockDevice(
const shared_ptr<string> pin,
const shared_ptr<SimpleCallbackInterface> callback);
83 HandlerKey LockDevice(
const string pin,
const shared_ptr<SimpleCallbackInterface> callback);
84 HandlerKey UnlockDevice(
const shared_ptr<string> pin,
const shared_ptr<SimpleCallbackInterface> callback);
85 HandlerKey UnlockDevice(
const string pin,
const shared_ptr<SimpleCallbackInterface> callback);
87 HandlerKey SetACLs(
const shared_ptr<
const list<ACL>> acls,
const shared_ptr<SimpleCallbackInterface> callback);
88 HandlerKey SetErasePIN(
const shared_ptr<const string> new_pin,
const shared_ptr<const string> current_pin,
89 const shared_ptr<SimpleCallbackInterface> callback);
90 HandlerKey SetErasePIN(
const string new_pin,
const string current_pin,
91 const shared_ptr<SimpleCallbackInterface> callback);
92 HandlerKey SetLockPIN(
const shared_ptr<const string> new_pin,
const shared_ptr<const string> current_pin,
93 const shared_ptr<SimpleCallbackInterface> callback);
94 HandlerKey SetLockPIN(
const string new_pin,
const string current_pin,
95 const shared_ptr<SimpleCallbackInterface> callback);
99 HandlerKey GenericGet(
const shared_ptr<const string> key,
100 const shared_ptr<GetCallbackInterface> callback, Command_MessageType message_type);
101 void PopulateP2PMessage(Command_P2POperation *mutable_p2pop,
102 const shared_ptr<const P2PPushRequest> push_request);
103 unique_ptr<Command> NewCommand(Command_MessageType message_type);
104 Command_Synchronization GetSynchronizationForPersistMode(PersistMode persistMode);
107 const shared_ptr<const string> empty_str_;
109 int64_t cluster_version_;
116 #endif // KINETIC_CPP_CLIENT_NONBLOCKING_KINETIC_CONNECTION_H_
Represents a collection of P2P operations.