FRAIdentityDatabase.h revision 7c51d54f23c5581d2cf894f9eafb9798e3febd22
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * The contents of this file are subject to the terms of the Common Development and
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * Distribution License (the License). You may not use this file except in compliance with the
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * specific language governing permission and limitations under the License.
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * When distributing Covered Software, include this CDDL Header Notice in each file and include
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * Header, with the fields enclosed by brackets [] replaced by your own identifying
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * information: "Portions copyright [year] [name of copyright owner]".
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * Copyright 2016 ForgeRock AS.
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell/*! Identifier for NSNotificationCenter event broadcast by FRAIdentityDatase when state change occurs. */
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellextern NSString * const FRAIdentityDatabaseChangedNotification;
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell/*! Key identifying added objects in FRAIdentityDatabaseChangedNotification userInfo dictionary. */
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellextern NSString * const FRAIdentityDatabaseChangedNotificationAddedItems;
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell/*! Key identifying removed objects in FRAIdentityDatabaseChangedNotification userInfo dictionary. */
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellextern NSString * const FRAIdentityDatabaseChangedNotificationRemovedItems;
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell/*! Key identifying updated objects in FRAIdentityDatabaseChangedNotification userInfo dictionary. */
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellextern NSString * const FRAIdentityDatabaseChangedNotificationUpdatedItems;
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * Data Access Object which encapsulates the underlying storage
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * mechanism and provides a simplified interface to the caller.
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * Responsible for manipulating Identity, Mechanism and Notification
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * objects in the database.
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell@property (strong, nonatomic, readonly) FRAIdentityDatabaseSQLiteOperations *sqlOperations;
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell- (instancetype)initWithSqlOperations:(FRAIdentityDatabaseSQLiteOperations *)sqlOperations;
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * Save the identity to the database.
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * @param identity The identity to save.
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni * @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott * @return NO if there was an error whilst processing. YES if the operation completed successfully.
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott- (BOOL)insertIdentity:(FRAIdentity *)identity error:(NSError *__autoreleasing *)error;
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * Remove the identity from the database.
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * @param identity The identity to remove.
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni * @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott * @return NO if there was an error whilst processing. YES if the operation completed successfully.
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott- (BOOL)deleteIdentity:(FRAIdentity *)identity error:(NSError *__autoreleasing *)error;
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * Save a new mechanism to the database.
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * @param mechanism The mechanism to save.
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni * @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott * @return NO if there was an error whilst processing. YES if the operation completed successfully.
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott- (BOOL)insertMechanism:(FRAMechanism *)mechanism error:(NSError *__autoreleasing *)error;
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * Remove the mechanism from the database.
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * @param mechanism The mechanism to remove.
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni * @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott * @return NO if there was an error whilst processing. YES if the operation completed successfully.
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott- (BOOL)deleteMechanism:(FRAMechanism *)mechanism error:(NSError *__autoreleasing *)error;
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * Save changes to an existing mechanism to the database.
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * @param mechanism The mechanism to save.
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni * @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott * @return NO if there was an error whilst processing. YES if the operation completed successfully.
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott- (BOOL)updateMechanism:(FRAMechanism *)mechanism error:(NSError *__autoreleasing *)error;
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * Save a new notification to the database.
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * @param notification The notification to save.
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni * @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott * @return NO if there was an error whilst processing. YES if the operation completed successfully.
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott- (BOOL)insertNotification:(FRANotification *)notification error:(NSError *__autoreleasing *)error;
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * Remove the notification from the database.
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * @param notification The notification to remove.
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni * @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott * @return NO if there was an error whilst processing. YES if the operation completed successfully.
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott- (BOOL)deleteNotification:(FRANotification *)notification error:(NSError *__autoreleasing *)error;
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * Save changes to an existing notification to the database.
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * @param notification The notification to save.
7c51d54f23c5581d2cf894f9eafb9798e3febd22Diego Colantoni * @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.
721bb987c406979bcfe705fa1ca8d54497d40fcbRobert Wapshott * @return NO if there was an error whilst processing. YES if the operation completed successfully.