5 // Created by John Hurley on 9/9/12.
9 #import <Foundation/Foundation.h>
10 //#import "CKDKVSProxy.h"
11 #import "SOSCloudKeychainConstants.h"
12 #import "SOSCloudKeychainClient.h"
14 extern CFStringRef kCKDKVSRemoteStoreID
;
15 extern CFStringRef kCKDAWSRemoteStoreID
;
19 @protocol CKDKVSDelegate
<NSObject
>
23 - (id
)objectForKey
:(NSString
*)aKey
;
24 - (void)setObject
:(id
)anObject forKey
:(NSString
*)aKey
;
25 - (void)removeObjectForKey
:(NSString
*)aKey
;
27 - (NSDictionary
*)dictionaryRepresentation
;
34 - (void)setDictionaryRepresentation
:(NSMutableDictionary
*)initialValue
;
35 - (void)clearPersistentStores
;
41 @interface CKDKeyValueStore
: NSObject
<CKDKVSDelegate
>
45 CloudItemsChangedBlock itemsChangedCallback
;
48 @
property (retain
) id
<CKDKVSDelegate
> delegate
;
49 @
property (retain
) NSString
*identifier
;
50 @
property (retain
) NSString
*path
;
53 + (CKDKeyValueStore
*)defaultStore
:(NSString
*)identifier itemsChangedBlock
:(CloudItemsChangedBlock
)itemsChangedBlock
;
54 - (id
)initWithIdentifier
:(NSString
*)xidentifier itemsChangedBlock
:(CloudItemsChangedBlock
)itemsChangedBlock
;
56 + (CFStringRef
)remoteStoreID
;
58 - (id
)initWithItemsChangedBlock
:(CloudItemsChangedBlock
)itemsChangedBlock
;
59 - (void)cloudChanged
:(NSNotification
*)notification
;
63 @interface CKDKeyValueStoreCollection
: NSObject
65 dispatch_queue_t syncrequestqueue
;
66 NSMutableDictionary
*store
;
68 @
property (retain
) NSMutableDictionary
*collection
;
71 + (id
<CKDKVSDelegate
>)defaultStore
:(NSString
*)identifier itemsChangedBlock
:(CloudItemsChangedBlock
)itemsChangedBlock
;
72 + (void)enqueueWrite
:(id
)anObject forKey
:(NSString
*)aKey from
:(NSString
*)identifier
;
73 + (id
)enqueueWithReply
:(NSString
*)aKey
;
74 + (BOOL
)enqueueSyncWithReply
;
75 + (void)postItemChangedNotification
:(NSString
*)keyThatChanged from
:(NSString
*)identifier
;
76 + (void)postItemsChangedNotification
:(NSArray
*)keysThatChanged from
:(NSString
*)identifier
;