00001
00002
00003
00004
00005
00006
00007
00008
00009 #import <Foundation/Foundation.h>
00010
00011 @class RMCall;
00012 @protocol RMResultDelegate;
00013 @protocol RMCallProtocol;
00014 @class RMResponse;
00015 @class ASIHTTPRequest;
00016
00017
00021 @protocol RMAuthenticator <NSObject>
00022
00023 @required
00030 - (void) authenticateWithCall: (RMCall*) call;
00031 @required
00037 - (id<RMCallProtocol>) callProtocol;
00038
00039 @optional
00046 - (BOOL) authenticateResponseString:(NSString*) responseString;
00047
00048 @optional
00055 - (BOOL) authenticateResponseData:(NSData*) responseData;
00056
00057 @end
00058
00062 @interface RMSession : NSObject<RMResultDelegate> {
00063 RMCall *call;
00064 id<RMAuthenticator> authenticator;
00065 NSMutableArray *delegateChain;
00066 BOOL authenticated;
00067 }
00068
00072 @property (readonly) RMCall *call;
00076 @property (readonly,getter=semaphore) id semaphore;
00077
00086 - (id) initWithAuthenticator: (id<RMAuthenticator>) authenticator
00087 call:(RMCall*) call;
00088
00092 - (void) authenticate;
00093
00099 @property(readonly) BOOL authenticated;
00100
00107 - (BOOL)call:(NSString*) method
00108 arguments:(NSDictionary*) arguments;
00109
00119 - (BOOL)call:(NSString*) method
00120 arguments:(NSDictionary*) arguments
00121 delegate:(id) delegate;
00122
00123
00127 - (void)close;
00128
00134 - (void) addDelegate: (id<RMResultDelegate>) delegate;
00135
00141 - (void) removeDelegate: (id<RMResultDelegate>) delegate;
00142
00143 @end