Skip to content

Instantly share code, notes, and snippets.

@matzew
Created October 4, 2012 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matzew/3833331 to your computer and use it in GitHub Desktop.
Save matzew/3833331 to your computer and use it in GitHub Desktop.
AGAuthenticationManager
/**
* AGAuthenticationManager manages different AGAuthenticationModule implementations. It is basically a
* factory that hides the concrete instanciation of a specific AGAuthenticationModule implementation.
* The class offers simple APIs to add, remove or get access to a 'authentication module'.
*
*/
@interface AGAuthenticationManager : NSObject
/**
* A factory method to instantiate an empty AGAuthenticationManager.
*
* @return the AGAuthenticationManager object
*/
+(id) manager;
/**
* Creates a new default (REST) AGAuthenticationModule implemention.
*
* @param moduleName The name of the actual auth module object.
* @param baseURL the base url for the server.
*/
-(id<AGAuthenticationModule>)add:(NSString*) moduleName baseURL:(NSURL*)baseURL;
/**
* Creates a new AGAuthenticationModule implemention. The actual type is determined by the type argument.
*
* @param moduleName The name of the actual auth module object.
* @param baseURL the base url for the server.
* @param type The type of the new auth module object.
*/
-(id<AGAuthenticationModule>)add:(NSString*) moduleName baseURL:(NSURL*)baseURL type:(NSString*) type;
/**
* Removes a AGAuthenticationModule implemention from the AGAuthenticationManager. The auth module,
* to be removed is determined by the moduleName argument.
*
* @param moduleName The name of the actual auth module object.
*/
-(id<AGAuthenticationModule>)remove:(NSString*) moduleName;
/**
* Loads a given AGAuthenticationModule implemention, based on the given moduleName argument.
*
* @param moduleName The name of the actual auth module object.
*/
-(id<AGAuthenticationModule>)get:(NSString*) moduleName;
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment