diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-02-09 15:47:09 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-02-09 15:47:09 +0100 |
commit | 573051b8df4a2961b4ba8a1b7e31f1437517f9c8 (patch) | |
tree | bac9c2680b6ceec49df48082335046338c940144 /common/clientapi.h | |
parent | 4d662fec99071ec8160c33b2fa17794e898bd3be (diff) | |
download | sink-573051b8df4a2961b4ba8a1b7e31f1437517f9c8.tar.gz sink-573051b8df4a2961b4ba8a1b7e31f1437517f9c8.zip |
Moved some API
Diffstat (limited to 'common/clientapi.h')
-rw-r--r-- | common/clientapi.h | 77 |
1 files changed, 40 insertions, 37 deletions
diff --git a/common/clientapi.h b/common/clientapi.h index 19d42e0..36c923b 100644 --- a/common/clientapi.h +++ b/common/clientapi.h | |||
@@ -36,6 +36,19 @@ namespace Sink { | |||
36 | class ResourceAccess; | 36 | class ResourceAccess; |
37 | class Notification; | 37 | class Notification; |
38 | 38 | ||
39 | class SINKCOMMON_EXPORT Notifier { | ||
40 | public: | ||
41 | Notifier(const QSharedPointer<ResourceAccess> &resourceAccess); | ||
42 | Notifier(const QByteArray &resourceInstanceIdentifier); | ||
43 | // Notifier(const QByteArrayList &resource); | ||
44 | void registerHandler(std::function<void(const Notification &)>); | ||
45 | |||
46 | private: | ||
47 | class Private; | ||
48 | QSharedPointer<Private> d; | ||
49 | }; | ||
50 | |||
51 | |||
39 | /** | 52 | /** |
40 | * Store interface used in the client API. | 53 | * Store interface used in the client API. |
41 | */ | 54 | */ |
@@ -82,30 +95,6 @@ public: | |||
82 | static KAsync::Job<void> synchronize(const Sink::Query &query); | 95 | static KAsync::Job<void> synchronize(const Sink::Query &query); |
83 | 96 | ||
84 | /** | 97 | /** |
85 | * Shutdown resource. | ||
86 | */ | ||
87 | static KAsync::Job<void> shutdown(const QByteArray &resourceIdentifier); | ||
88 | |||
89 | /** | ||
90 | * Start resource. | ||
91 | * | ||
92 | * The resource is ready for operation once this command completes. | ||
93 | * This command is only necessary if a resource was shutdown previously, | ||
94 | * otherwise the resource process will automatically start as necessary. | ||
95 | */ | ||
96 | static KAsync::Job<void> start(const QByteArray &resourceIdentifier); | ||
97 | |||
98 | /** | ||
99 | * Flushes any pending messages to disk | ||
100 | */ | ||
101 | static KAsync::Job<void> flushMessageQueue(const QByteArrayList &resourceIdentifier); | ||
102 | |||
103 | /** | ||
104 | * Flushes any pending messages that haven't been replayed to the source. | ||
105 | */ | ||
106 | static KAsync::Job<void> flushReplayQueue(const QByteArrayList &resourceIdentifier); | ||
107 | |||
108 | /** | ||
109 | * Removes a resource from disk. | 98 | * Removes a resource from disk. |
110 | */ | 99 | */ |
111 | static void removeFromDisk(const QByteArray &resourceIdentifier); | 100 | static void removeFromDisk(const QByteArray &resourceIdentifier); |
@@ -128,21 +117,35 @@ public: | |||
128 | }; | 117 | }; |
129 | 118 | ||
130 | namespace Resources { | 119 | namespace Resources { |
131 | template <class DomainType> | ||
132 | KAsync::Job<void> SINKCOMMON_EXPORT inspect(const Inspection &inspectionCommand); | ||
133 | } | ||
134 | 120 | ||
135 | class SINKCOMMON_EXPORT Notifier { | 121 | template <class DomainType> |
136 | public: | 122 | KAsync::Job<void> SINKCOMMON_EXPORT inspect(const Inspection &inspectionCommand); |
137 | Notifier(const QSharedPointer<ResourceAccess> &resourceAccess); | ||
138 | Notifier(const QByteArray &resourceInstanceIdentifier); | ||
139 | // Notifier(const QByteArrayList &resource); | ||
140 | void registerHandler(std::function<void(const Notification &)>); | ||
141 | 123 | ||
142 | private: | 124 | /** |
143 | class Private; | 125 | * Shutdown resource. |
144 | QSharedPointer<Private> d; | 126 | */ |
145 | }; | 127 | KAsync::Job<void> SINKCOMMON_EXPORT shutdown(const QByteArray &resourceIdentifier); |
128 | |||
129 | /** | ||
130 | * Start resource. | ||
131 | * | ||
132 | * The resource is ready for operation once this command completes. | ||
133 | * This command is only necessary if a resource was shutdown previously, | ||
134 | * otherwise the resource process will automatically start as necessary. | ||
135 | */ | ||
136 | KAsync::Job<void> SINKCOMMON_EXPORT start(const QByteArray &resourceIdentifier); | ||
137 | |||
138 | /** | ||
139 | * Flushes any pending messages to disk | ||
140 | */ | ||
141 | KAsync::Job<void> SINKCOMMON_EXPORT flushMessageQueue(const QByteArrayList &resourceIdentifier); | ||
142 | |||
143 | /** | ||
144 | * Flushes any pending messages that haven't been replayed to the source. | ||
145 | */ | ||
146 | KAsync::Job<void> SINKCOMMON_EXPORT flushReplayQueue(const QByteArrayList &resourceIdentifier); | ||
147 | |||
148 | } | ||
146 | 149 | ||
147 | } | 150 | } |
148 | 151 | ||