FRAMechanismFactory.h revision 7c51d54f23c5581d2cf894f9eafb9798e3febd22
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott/*
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * The contents of this file are subject to the terms of the Common Development and
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * Distribution License (the License). You may not use this file except in compliance with the
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * License.
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott *
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * specific language governing permission and limitations under the License.
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott *
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * When distributing Covered Software, include this CDDL Header Notice in each file and include
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * Header, with the fields enclosed by brackets [] replaced by your own identifying
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * information: "Portions copyright [year] [name of copyright owner]".
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott *
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * Copyright 2016 ForgeRock AS.
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott */
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott#import "FRAMechanism.h"
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott#import "FRAIdentityModel.h"
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott#ifndef FRAMechanismFactory_h
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott#define FRAMechanismFactory_h
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott#endif /* FRAMechanismFactory_h */
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott@protocol FRAMechanismFactory
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott/*!
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * Build a FRA Mechanism object using the database and the model provided
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott *
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * @param uri The uri string containing the mechanism information.
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * @param database The database to persist the new mechanism to.
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * @param identityModel The identity model to place the new mechanism into.
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * @param handler The block to invoke when asynchronous operation is completed.
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * @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.
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * @return The mechanism built from the uri.
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott */
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott- (FRAMechanism *) buildMechanism:(NSURL *)uri database:(FRAIdentityDatabase *)database identityModel:(FRAIdentityModel *)identityModel handler:(void (^)(BOOL, NSError *))handler error:(NSError *__autoreleasing *)error;
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott/*!
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * Gets whether this FRAMechanismFactory supports the mechnaism type in the given uri
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott *
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * @param uri the uri string contianing the mechanism informaiton
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott */
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott- (bool) supports:(NSURL *)uri;
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott/*!
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * Gets the supproted protocol for the FRAMechanism FRAMechanismFactory
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott */
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott- (NSString *) getSupportedProtocol;
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott@end