diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-04-12 23:33:00 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-04-12 23:33:00 +0200 |
commit | 75f85f7b30dbd40010a3b1c4d4e8c418cc55cc29 (patch) | |
tree | cdbbedba9b0224e31a9860337a46e0f4ae5ad650 /common | |
parent | 41782ea2be02cc92cf9e7eabc455ff2f14357236 (diff) | |
download | sink-75f85f7b30dbd40010a3b1c4d4e8c418cc55cc29.tar.gz sink-75f85f7b30dbd40010a3b1c4d4e8c418cc55cc29.zip |
Added identity support
Diffstat (limited to 'common')
-rw-r--r-- | common/domain/applicationdomaintype.cpp | 28 | ||||
-rw-r--r-- | common/domain/applicationdomaintype.h | 8 | ||||
-rw-r--r-- | common/facadefactory.cpp | 1 | ||||
-rw-r--r-- | common/resourcefacade.cpp | 7 | ||||
-rw-r--r-- | common/resourcefacade.h | 6 |
5 files changed, 50 insertions, 0 deletions
diff --git a/common/domain/applicationdomaintype.cpp b/common/domain/applicationdomaintype.cpp index 7549a31..73143e8 100644 --- a/common/domain/applicationdomaintype.cpp +++ b/common/domain/applicationdomaintype.cpp | |||
@@ -186,6 +186,28 @@ SinkAccount::~SinkAccount() | |||
186 | 186 | ||
187 | } | 187 | } |
188 | 188 | ||
189 | Identity::Identity(const QByteArray &identifier) | ||
190 | : ApplicationDomainType("", identifier, 0, QSharedPointer<BufferAdaptor>(new MemoryBufferAdaptor())) | ||
191 | { | ||
192 | |||
193 | } | ||
194 | |||
195 | Identity::Identity(const QByteArray &, const QByteArray &identifier, qint64 revision, const QSharedPointer<BufferAdaptor> &adaptor) | ||
196 | : ApplicationDomainType("", identifier, 0, adaptor) | ||
197 | { | ||
198 | } | ||
199 | |||
200 | Identity::Identity() | ||
201 | : ApplicationDomainType() | ||
202 | { | ||
203 | |||
204 | } | ||
205 | |||
206 | Identity::~Identity() | ||
207 | { | ||
208 | |||
209 | } | ||
210 | |||
189 | template<> | 211 | template<> |
190 | QByteArray getTypeName<Event>() | 212 | QByteArray getTypeName<Event>() |
191 | { | 213 | { |
@@ -211,6 +233,12 @@ QByteArray getTypeName<SinkAccount>() | |||
211 | } | 233 | } |
212 | 234 | ||
213 | template<> | 235 | template<> |
236 | QByteArray getTypeName<Identity>() | ||
237 | { | ||
238 | return "identity"; | ||
239 | } | ||
240 | |||
241 | template<> | ||
214 | QByteArray getTypeName<Mail>() | 242 | QByteArray getTypeName<Mail>() |
215 | { | 243 | { |
216 | return "mail"; | 244 | return "mail"; |
diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index 5ecd9eb..8af48e8 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h | |||
@@ -165,6 +165,14 @@ struct SINK_EXPORT SinkAccount : public ApplicationDomainType { | |||
165 | virtual ~SinkAccount(); | 165 | virtual ~SinkAccount(); |
166 | }; | 166 | }; |
167 | 167 | ||
168 | struct SINK_EXPORT Identity : public ApplicationDomainType { | ||
169 | typedef QSharedPointer<SinkAccount> Ptr; | ||
170 | Identity(const QByteArray &resourceInstanceIdentifier, const QByteArray &identifier, qint64 revision, const QSharedPointer<BufferAdaptor> &adaptor); | ||
171 | Identity(const QByteArray &identifier); | ||
172 | Identity(); | ||
173 | virtual ~Identity(); | ||
174 | }; | ||
175 | |||
168 | /** | 176 | /** |
169 | * All types need to be registered here an MUST return a different name. | 177 | * All types need to be registered here an MUST return a different name. |
170 | * | 178 | * |
diff --git a/common/facadefactory.cpp b/common/facadefactory.cpp index bae8f7b..b4a5273 100644 --- a/common/facadefactory.cpp +++ b/common/facadefactory.cpp | |||
@@ -56,6 +56,7 @@ void FacadeFactory::registerStaticFacades() | |||
56 | { | 56 | { |
57 | registerFacade<Sink::ApplicationDomain::SinkResource, ResourceFacade>(QByteArray()); | 57 | registerFacade<Sink::ApplicationDomain::SinkResource, ResourceFacade>(QByteArray()); |
58 | registerFacade<Sink::ApplicationDomain::SinkAccount, AccountFacade>(QByteArray()); | 58 | registerFacade<Sink::ApplicationDomain::SinkAccount, AccountFacade>(QByteArray()); |
59 | registerFacade<Sink::ApplicationDomain::Identity, IdentityFacade>(QByteArray()); | ||
59 | } | 60 | } |
60 | 61 | ||
61 | std::shared_ptr<void> FacadeFactory::getFacade(const QByteArray &resource, const QByteArray &instanceIdentifier, const QByteArray &typeName) | 62 | std::shared_ptr<void> FacadeFactory::getFacade(const QByteArray &resource, const QByteArray &instanceIdentifier, const QByteArray &typeName) |
diff --git a/common/resourcefacade.cpp b/common/resourcefacade.cpp index 474e955..6ff4801 100644 --- a/common/resourcefacade.cpp +++ b/common/resourcefacade.cpp | |||
@@ -202,3 +202,10 @@ AccountFacade::~AccountFacade() | |||
202 | { | 202 | { |
203 | } | 203 | } |
204 | 204 | ||
205 | IdentityFacade::IdentityFacade(const QByteArray &) : LocalStorageFacade<Sink::ApplicationDomain::Identity>("identitys") | ||
206 | { | ||
207 | } | ||
208 | |||
209 | IdentityFacade::~IdentityFacade() | ||
210 | { | ||
211 | } | ||
diff --git a/common/resourcefacade.h b/common/resourcefacade.h index 725938a..7834dea 100644 --- a/common/resourcefacade.h +++ b/common/resourcefacade.h | |||
@@ -87,4 +87,10 @@ public: | |||
87 | virtual ~AccountFacade(); | 87 | virtual ~AccountFacade(); |
88 | }; | 88 | }; |
89 | 89 | ||
90 | class IdentityFacade : public LocalStorageFacade<Sink::ApplicationDomain::Identity> | ||
91 | { | ||
92 | public: | ||
93 | IdentityFacade(const QByteArray &instanceIdentifier); | ||
94 | virtual ~IdentityFacade(); | ||
95 | }; | ||
90 | 96 | ||