FRAPushMechanism.h revision caa9e77dc369fea8df9ae2c598d3c83b7214c1cf
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The contents of this file are subject to the terms of the Common Development and
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Distribution License (the License). You may not use this file except in compliance with the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * specific language governing permission and limitations under the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * When distributing Covered Software, include this CDDL Header Notice in each file and include
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Header, with the fields enclosed by brackets [] replaced by your own identifying
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * information: "Portions copyright [year] [name of copyright owner]".
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Copyright 2016 ForgeRock AS.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw@class FRAIdentity;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#import "FRAMechanism.h"
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*!
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * An authentication mechanism capable of authenticating by responding to a push notification.
cb174861876aea6950a7ab4ce944aff84b1914cdjoyce mcintosh */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw@interface FRAPushMechanism : FRAMechanism
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*!
bbf6f00c25b6a2bed23c35eac6d62998ecdb338cJordan Brown * Secret key for Push Notifications
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
dc20a3024900c47dd2ee44b9707e6df38f7d62a5as@property (nonatomic, readonly) NSString *secret;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
b1352070d318187b41b088da3533692976f3f225Alan Wright/*!
b1352070d318187b41b088da3533692976f3f225Alan Wright * Authentication Endpoint to contact for Push Notifications
b1352070d318187b41b088da3533692976f3f225Alan Wright */
b1352070d318187b41b088da3533692976f3f225Alan Wright@property (nonatomic, readonly) NSString *authEndpoint;
b1352070d318187b41b088da3533692976f3f225Alan Wright
b1352070d318187b41b088da3533692976f3f225Alan Wright/*!
b1352070d318187b41b088da3533692976f3f225Alan Wright * The Device ID that this device is registered under.
b1352070d318187b41b088da3533692976f3f225Alan Wright */
b1352070d318187b41b088da3533692976f3f225Alan Wright@property (nonatomic, readonly) NSString* mechanismUID;
b1352070d318187b41b088da3533692976f3f225Alan Wright
b1352070d318187b41b088da3533692976f3f225Alan Wright#pragma mark -
b1352070d318187b41b088da3533692976f3f225Alan Wright#pragma mark Lifecyle
b1352070d318187b41b088da3533692976f3f225Alan Wright
bbf6f00c25b6a2bed23c35eac6d62998ecdb338cJordan Brown/*!
bbf6f00c25b6a2bed23c35eac6d62998ecdb338cJordan Brown * Init Push Mechanism.
bbf6f00c25b6a2bed23c35eac6d62998ecdb338cJordan Brown *
bbf6f00c25b6a2bed23c35eac6d62998ecdb338cJordan Brown * @param database The database to which this mechanism can be persisted.
bbf6f00c25b6a2bed23c35eac6d62998ecdb338cJordan Brown * @param identityModel The identity model which contains the list of identities.
bbf6f00c25b6a2bed23c35eac6d62998ecdb338cJordan Brown *
b1352070d318187b41b088da3533692976f3f225Alan Wright * @return The initialized mechanism or nil if initialization failed.
bbf6f00c25b6a2bed23c35eac6d62998ecdb338cJordan Brown */
037cac007b685e7ea79f6ef7e8e62bfd342a4d56joyce mcintosh- (instancetype)initWithDatabase:(FRAIdentityDatabase *)database identityModel:(FRAIdentityModel *)identityModel;
b1352070d318187b41b088da3533692976f3f225Alan Wright
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*!
bbf6f00c25b6a2bed23c35eac6d62998ecdb338cJordan Brown * Create an instance of PushMechanism
bbf6f00c25b6a2bed23c35eac6d62998ecdb338cJordan Brown *
bbf6f00c25b6a2bed23c35eac6d62998ecdb338cJordan Brown * @param database Required to allow mechnaism to persist changes.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * @param identityModel The identity model which contains the list of identities.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * @param authEndPoint The authentication endpoint URI used for signalling to the server.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * @param secret Shared secret key required for authentication.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * @param version the version of the database object.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * @param mechanismIdentifier uid for the mechanism.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * @return The initialized mechanism or nil if initialization failed.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw- (instancetype)initWithDatabase:(FRAIdentityDatabase *)database identityModel:(FRAIdentityModel *)identityModel authEndpoint:(NSString *)authEndPoint secret:(NSString *)secret version:(NSInteger)version mechanismIdentifier:(NSString *)mechanismIdentifier;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw/*!
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Create an instance of PushMechanism
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * @param database Required to allow mechnaism to persist changes.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * @param identityModel The identity model which contains the list of identities.
bbf6f00c25b6a2bed23c35eac6d62998ecdb338cJordan Brown * @param authEndPoint The authentication endpoint URI used for signalling to the server.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * @param secret Shared secret key required for authentication.
7b59d02d2a384be9a08087b14defadd214b3c1ddjb *
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb * @return The initialized mechanism or nil if initialization failed.
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb */
b89a8333f5e1f75ec0c269b22524bd2eccb972banatalie li - Sun Microsystems - Irvine United States- (instancetype)initWithDatabase:(FRAIdentityDatabase *)database identityModel:(FRAIdentityModel *)identityModel authEndpoint:(NSString *)authEndPoint secret:(NSString *)secret;
b89a8333f5e1f75ec0c269b22524bd2eccb972banatalie li - Sun Microsystems - Irvine United States
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb/*!
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb * Allocate and init Push Mechanism.
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States *
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States * @param database The database to which this mechanism can be persisted.
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States * @param identityModel The identity model which contains the list of identities.
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb *
eb1d736b1c19f6abeee90c921a9320b67fedd016afshin salek ardakani - Sun Microsystems - Irvine United States * @return The initialized mechanism or nil if initialization failed.
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb */
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb+ (instancetype)pushMechanismWithDatabase:(FRAIdentityDatabase *)database identityModel:(FRAIdentityModel *)identityModel;
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb/*!
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb * Allocate and init Push Mechanism.
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb *
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb * @param database The database to which this mechanism can be persisted.
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb * @param identityModel The identity model which contains the list of identities.
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb *
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb * @return The initialized mechanism or nil if initialization failed.
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb */
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb+ (instancetype)pushMechanismWithDatabase:(FRAIdentityDatabase *)database identityModel:(FRAIdentityModel *)identityModel authEndpoint:(NSString *)authEndPoint secret:(NSString *)secret;
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb/*!
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb * Allocate and init Push Mechanism with version information included.
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb *
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * @param database The database to which this mechanism can be persisted.
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States * @param identityModel The identity model which contains the list of identities.
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States *
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States * @return The initialized mechanism or nil if initialization failed.
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States */
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States+ (instancetype)pushMechanismWithDatabase:(FRAIdentityDatabase *)database identityModel:(FRAIdentityModel *)identityModel authEndpoint:(NSString *)authEndPoint secret:(NSString *)secret version:(NSInteger)version mechanismIdentifier:(NSString *)mechanismIdentifier;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw@end
dc20a3024900c47dd2ee44b9707e6df38f7d62a5as