/Source/externals/GData/Source/BaseClasses/GDataServiceBase.h

http://google-email-uploader-mac.googlecode.com/ · C++ Header · 584 lines · 253 code · 122 blank · 209 comment · 0 complexity · 8b1c8d7f36307e3dca7342dcdb57602c MD5 · raw file

  1. /* Copyright (c) 2007 Google Inc.
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. //
  16. // GDataServiceBase.h
  17. //
  18. #import "GTMHTTPFetcherService.h"
  19. #import "GDataEntryBase.h"
  20. #import "GDataFeedBase.h"
  21. #import "GDataQuery.h"
  22. #undef _EXTERN
  23. #undef _INITIALIZE_AS
  24. #ifdef GDATASERVICEBASE_DEFINE_GLOBALS
  25. #define _EXTERN
  26. #define _INITIALIZE_AS(x) =x
  27. #else
  28. #define _EXTERN GDATA_EXTERN
  29. #define _INITIALIZE_AS(x)
  30. #endif
  31. _EXTERN Class const kGDataUseRegisteredClass _INITIALIZE_AS(nil);
  32. _EXTERN NSString* const kGDataServiceErrorDomain _INITIALIZE_AS(@"com.google.GDataServiceDomain");
  33. _EXTERN NSUInteger const kGDataStandardUploadChunkSize _INITIALIZE_AS(NSUIntegerMax);
  34. // we'll consistently store the server error string in the userInfo under
  35. // this key
  36. _EXTERN NSString* const kGDataServerErrorStringKey _INITIALIZE_AS(@"error");
  37. // when servers return us structured XML errors, the NSError will
  38. // contain a GDataErrorGroup in the userInfo dictionary under the key
  39. // kGDataStructuredErrorsKey
  40. _EXTERN NSString* const kGDataStructuredErrorsKey _INITIALIZE_AS(@"serverErrors");
  41. // when specifying an ETag for updating or deleting a single entry, use
  42. // kGDataETagWildcard to tell the server to replace the current value
  43. // unconditionally. Do not use this in entries in a batch feed.
  44. _EXTERN NSString* const kGDataETagWildcard _INITIALIZE_AS(@"*");
  45. // notifications when parsing of a fetcher feed or entry begins or ends
  46. _EXTERN NSString* const kGDataServiceTicketParsingStartedNotification _INITIALIZE_AS(@"kGDataServiceTicketParsingStartedNotification");
  47. _EXTERN NSString* const kGDataServiceTicketParsingStoppedNotification _INITIALIZE_AS(@"kGDataServiceTicketParsingStoppedNotification");
  48. enum {
  49. kGDataCouldNotConstructObjectError = -100,
  50. };
  51. @class GDataServiceTicketBase;
  52. // block types used for fetch callbacks
  53. //
  54. // these typedefs are not used in the header file method declarations
  55. // since it's more useful when code sense expansions show the argument
  56. // types rather than the typedefs
  57. #if NS_BLOCKS_AVAILABLE
  58. typedef void (^GDataServiceCompletionHandler)(GDataServiceTicketBase *ticket, id object, NSError *error);
  59. typedef void (^GDataServiceFeedBaseCompletionHandler)(GDataServiceTicketBase *ticket, GDataFeedBase *feed, NSError *error);
  60. typedef void (^GDataServiceEntryBaseCompletionHandler)(GDataServiceTicketBase *ticket, GDataEntryBase *entry, NSError *error);
  61. typedef void (^GDataServiceUploadProgressHandler)(GDataServiceTicketBase *ticket, unsigned long long numberOfBytesRead, unsigned long long dataLength);
  62. #else
  63. typedef void *GDataServiceCompletionHandler;
  64. typedef void *GDataServiceFeedBaseCompletionHandler;
  65. typedef void *GDataServiceEntryBaseCompletionHandler;
  66. typedef void *GDataServiceUploadProgressHandler;
  67. #endif // NS_BLOCKS_AVAILABLE
  68. @class GDataServiceBase;
  69. //
  70. // ticket base class
  71. //
  72. @interface GDataServiceTicketBase : NSObject {
  73. @protected
  74. GDataServiceBase *service_;
  75. id userData_;
  76. NSMutableDictionary *ticketProperties_;
  77. NSDictionary *surrogates_;
  78. GTMHTTPFetcher *currentFetcher_; // object or auth fetcher if mid-fetch
  79. GTMHTTPFetcher *objectFetcher_;
  80. SEL uploadProgressSelector_;
  81. BOOL shouldFollowNextLinks_;
  82. BOOL shouldFeedsIgnoreUnknowns_;
  83. BOOL isRetryEnabled_;
  84. SEL retrySEL_;
  85. NSTimeInterval maxRetryInterval_;
  86. #if NS_BLOCKS_AVAILABLE
  87. GDataServiceUploadProgressHandler uploadProgressBlock_;
  88. #elif !__LP64__
  89. // placeholders: for 32-bit builds, keep the size of the object's ivar section
  90. // the same with and without blocks
  91. id uploadProgressPlaceholder_;
  92. #endif
  93. GDataObject *postedObject_;
  94. GDataObject *fetchedObject_;
  95. GDataFeedBase *accumulatedFeed_;
  96. NSError *fetchError_;
  97. BOOL hasCalledCallback_;
  98. NSUInteger nextLinksFollowedCounter_;
  99. NSOperation *parseOperation_;
  100. // OAuth support
  101. id authorizer_;
  102. }
  103. + (id)ticketForService:(GDataServiceBase *)service;
  104. - (id)initWithService:(GDataServiceBase *)service;
  105. // if cancelTicket is called, the fetch is stopped if it is in progress,
  106. // the callbacks will not be called, and the ticket will no longer be useful
  107. // (though the client must still release the ticket if it retained the ticket)
  108. - (void)cancelTicket;
  109. // chunked upload tickets may be paused
  110. - (void)pauseUpload;
  111. - (void)resumeUpload;
  112. - (BOOL)isUploadPaused;
  113. - (id)service;
  114. - (id)userData;
  115. - (void)setUserData:(id)obj;
  116. // Properties are supported for client convenience.
  117. //
  118. // Property keys beginning with _ are reserved by the library.
  119. - (void)setProperties:(NSDictionary *)dict;
  120. - (NSDictionary *)properties;
  121. - (void)setProperty:(id)obj forKey:(NSString *)key; // pass nil obj to remove property
  122. - (id)propertyForKey:(NSString *)key;
  123. - (NSDictionary *)surrogates;
  124. - (void)setSurrogates:(NSDictionary *)dict;
  125. - (GTMHTTPFetcher *)currentFetcher; // object or auth fetcher, if active
  126. - (void)setCurrentFetcher:(GTMHTTPFetcher *)fetcher;
  127. - (GTMHTTPFetcher *)objectFetcher;
  128. - (void)setObjectFetcher:(GTMHTTPFetcher *)fetcher;
  129. - (void)setUploadProgressSelector:(SEL)progressSelector;
  130. - (SEL)uploadProgressSelector;
  131. #if NS_BLOCKS_AVAILABLE
  132. - (void)setUploadProgressHandler:(void (^) (GDataServiceTicketBase *ticket, unsigned long long numberOfBytesRead, unsigned long long dataLength))handler;
  133. - (GDataServiceUploadProgressHandler)uploadProgressHandler;
  134. #endif
  135. - (BOOL)shouldFollowNextLinks;
  136. - (void)setShouldFollowNextLinks:(BOOL)flag;
  137. - (BOOL)shouldFeedsIgnoreUnknowns;
  138. - (void)setShouldFeedsIgnoreUnknowns:(BOOL)flag;
  139. - (BOOL)isRetryEnabled;
  140. - (void)setIsRetryEnabled:(BOOL)flag;
  141. - (SEL)retrySelector;
  142. - (void)setRetrySelector:(SEL)theSel;
  143. - (NSTimeInterval)maxRetryInterval;
  144. - (void)setMaxRetryInterval:(NSTimeInterval)secs;
  145. - (BOOL)hasCalledCallback;
  146. - (void)setHasCalledCallback:(BOOL)flag;
  147. - (void)setPostedObject:(GDataObject *)obj;
  148. - (id)postedObject;
  149. - (void)setFetchedObject:(GDataObject *)obj;
  150. - (GDataObject *)fetchedObject;
  151. - (void)setFetchError:(NSError *)error;
  152. - (NSError *)fetchError;
  153. - (void)setAccumulatedFeed:(GDataFeedBase *)feed;
  154. - (GDataFeedBase *)accumulatedFeed;
  155. // accumulateFeed is used by the service to append an incomplete feed
  156. // to the ticket when shouldFollowNextLinks is enabled
  157. - (void)accumulateFeed:(GDataFeedBase *)newFeed;
  158. - (void)setNextLinksFollowedCounter:(NSUInteger)val;
  159. - (NSUInteger)nextLinksFollowedCounter;
  160. - (NSInteger)statusCode; // server status from object fetch
  161. - (NSOperation *)parseOperation;
  162. - (void)setParseOperation:(NSOperation *)op;
  163. // OAuth support
  164. - (id)authorizer;
  165. - (void)setAuthorizer:(id)obj;
  166. @end
  167. // category to provide opaque access to tickets stored in fetcher properties
  168. @interface GTMHTTPFetcher (GDataServiceTicketAdditions)
  169. - (id)ticket;
  170. @end
  171. //
  172. // service base class
  173. //
  174. @interface GDataServiceBase : NSObject {
  175. NSOperationQueue *operationQueue_;
  176. NSString *serviceVersion_;
  177. NSString *userAgent_;
  178. GTMHTTPFetcherService *fetcherService_;
  179. NSString *username_;
  180. NSMutableData *password_;
  181. NSString *serviceUserData_; // initial value for userData in future tickets
  182. NSMutableDictionary *serviceProperties_; // initial values for properties in future tickets
  183. NSDictionary *serviceSurrogates_; // initial value for surrogates in future tickets
  184. BOOL shouldServiceFeedsIgnoreUnknowns_; // YES when feeds should ignore unknown XML
  185. SEL serviceUploadProgressSelector_; // optional
  186. #if NS_BLOCKS_AVAILABLE
  187. GDataServiceUploadProgressHandler serviceUploadProgressBlock_;
  188. #elif !__LP64__
  189. // placeholders: for 32-bit builds, keep the size of the object's ivar section
  190. // the same with and without blocks
  191. id serviceUploadProgressPlaceholder_;
  192. #endif
  193. NSUInteger uploadChunkSize_; // zero when uploading via multi-part MIME http body
  194. BOOL isServiceRetryEnabled_; // user allows auto-retries
  195. SEL serviceRetrySEL_; // optional; set with setServiceRetrySelector
  196. NSTimeInterval serviceMaxRetryInterval_; // default to 600. seconds
  197. NSInteger cookieStorageMethod_; // constant from GTMHTTPFetcher.h
  198. BOOL serviceShouldFollowNextLinks_;
  199. }
  200. // Applications should call setUserAgent: with a string of the form
  201. // CompanyName-AppName-AppVersion (without whitespace or punctuation
  202. // other than dashes and periods)
  203. - (NSString *)userAgent;
  204. - (void)setUserAgent:(NSString *)userAgent;
  205. // Run loop modes are used for scheduling NSURLConnections on 10.5 and later.
  206. //
  207. // The default value, nil, schedules connections using the current run
  208. // loop mode. To use the service during a modal dialog, specify
  209. // an array with NSRunLoopCommonModes.
  210. //
  211. // These methods just call through to the fetcher service object's
  212. // runLoopModes property.
  213. - (NSArray *)runLoopModes;
  214. - (void)setRunLoopModes:(NSArray *)modes;
  215. // On iOS 4 and later, the fetch may optionally continue in the background
  216. // until finished or stopped by OS expiration
  217. //
  218. // The default value is NO
  219. //
  220. // For Mac OS X, background fetches are always supported, and this property
  221. // is ignored
  222. - (BOOL)shouldFetchInBackground;
  223. - (void)setShouldFetchInBackground:(BOOL)flag;
  224. // The request user agent includes the library and OS version appended to the
  225. // base userAgent
  226. - (NSString *)requestUserAgent;
  227. // Users may call requestForURL:httpMethod to get a request with the proper
  228. // user-agent and authentication token
  229. //
  230. // For http method, pass nil (for default GET method), POST, PUT, or DELETE
  231. - (NSMutableURLRequest *)requestForURL:(NSURL *)url
  232. ETag:(NSString *)etag
  233. httpMethod:(NSString *)httpMethod;
  234. - (NSMutableURLRequest *)requestForURL:(NSURL *)url
  235. ETag:(NSString *)etag
  236. httpMethod:(NSString *)httpMethod
  237. ticket:(GDataServiceTicketBase *)ticket;
  238. // objectRequestForURL returns an NSMutableURLRequest for an XML GData object
  239. //
  240. //
  241. // the object is the object being sent to the server, or nil;
  242. // the http method may be nil for get, or POST, PUT, DELETE
  243. - (NSMutableURLRequest *)objectRequestForURL:(NSURL *)url
  244. object:(GDataObject *)object
  245. ETag:(NSString *)etag
  246. httpMethod:(NSString *)httpMethod
  247. ticket:(GDataServiceTicketBase *)ticket;
  248. //
  249. // Fetch methods
  250. //
  251. // fetchPublicFeed/fetchPublicEntry/fetchPublicFeedWithQuery (GET)
  252. // fetchPublicEntryByInsertingEntry (POST)
  253. // fetchPublicEntryByUpdatingEntry (PUT)
  254. // deleteEntry/deleteResourceURL (DELETE)
  255. //
  256. // NOTE:
  257. // These base class methods are for unauthenticated fetches to public feeds.
  258. //
  259. // To make authenticated fetches to a user's account, use the methods in the
  260. // service's GDataServiceXxxx class, or in the GDataServiceGoogle class.
  261. //
  262. // finishedSelector has a signature like:
  263. //
  264. // - (void)serviceTicket:(GDataServiceTicketBase *)ticket
  265. // finishedWithObject:(GDataObject *)object // a feed or an entry
  266. // error:(NSError *)error
  267. //
  268. // If an error occurred, the error parameter will be non-nil. Otherwise,
  269. // the object parameter will point to a feed or entry, if any was returned by
  270. // the fetch. (Delete fetches return no object, so the second parameter will
  271. // be nil.)
  272. - (GDataServiceTicketBase *)fetchPublicFeedWithURL:(NSURL *)feedURL
  273. feedClass:(Class)feedClass
  274. delegate:(id)delegate
  275. didFinishSelector:(SEL)finishedSelector;
  276. - (GDataServiceTicketBase *)fetchPublicFeedWithQuery:(GDataQuery *)query
  277. feedClass:(Class)feedClass
  278. delegate:(id)delegate
  279. didFinishSelector:(SEL)finishedSelector;
  280. - (GDataServiceTicketBase *)fetchPublicEntryWithURL:(NSURL *)entryURL
  281. entryClass:(Class)entryClass
  282. delegate:(id)delegate
  283. didFinishSelector:(SEL)finishedSelector;
  284. - (GDataServiceTicketBase *)fetchPublicFeedWithBatchFeed:(GDataFeedBase *)batchFeed
  285. forFeedURL:(NSURL *)feedURL
  286. delegate:(id)delegate
  287. didFinishSelector:(SEL)finishedSelector;
  288. #if NS_BLOCKS_AVAILABLE
  289. - (GDataServiceTicketBase *)fetchPublicFeedWithURL:(NSURL *)feedURL
  290. feedClass:(Class)feedClass
  291. completionHandler:(void (^)(GDataServiceTicketBase *ticket, GDataFeedBase *feed, NSError *error))handler;
  292. - (GDataServiceTicketBase *)fetchPublicFeedWithQuery:(GDataQuery *)query
  293. feedClass:(Class)feedClass
  294. completionHandler:(void (^)(GDataServiceTicketBase *ticket, GDataFeedBase *feed, NSError *error))handler;
  295. - (GDataServiceTicketBase *)fetchPublicEntryWithURL:(NSURL *)entryURL
  296. entryClass:(Class)entryClass
  297. completionHandler:(void (^)(GDataServiceTicketBase *ticket, GDataEntryBase *entry, NSError *error))handler;
  298. - (GDataServiceTicketBase *)fetchPublicFeedWithBatchFeed:(GDataFeedBase *)batchFeed
  299. forFeedURL:(NSURL *)feedURL
  300. completionHandler:(void (^)(GDataServiceTicketBase *ticket, GDataFeedBase *feed, NSError *error))handler;
  301. #endif
  302. // reset the response cache to avoid getting a Not Modified status
  303. // based on prior queries
  304. - (void)clearResponseDataCache;
  305. // Turn on data caching to receive a copy of previously-retrieved objects.
  306. // Otherwise, fetches may return status 304 (Not Modifier) rather than actual
  307. // data
  308. - (void)setShouldCacheResponseData:(BOOL)flag;
  309. - (BOOL)shouldCacheResponseData;
  310. // If dated data caching is on, this specifies the capacity of the cache.
  311. // Default is 15MB for Mac and 1 MB for iPhone.
  312. - (void)setResponseDataCacheCapacity:(NSUInteger)totalBytes;
  313. - (NSUInteger)responseDataCacheCapacity;
  314. // Fetcher service, if necessary for sharing cookies and dated data
  315. // cache with standalone http fetchers
  316. - (void)setFetcherService:(GTMHTTPFetcherService *)obj;
  317. - (GTMHTTPFetcherService *)fetcherService;
  318. // Default storage for cookies is in the service object's fetchHistory.
  319. //
  320. // Apps that want to share cookies between all standalone fetchers and the
  321. // service object may specify static application-wide cookie storage,
  322. // kGTMHTTPFetcherCookieStorageMethodStatic.
  323. - (void)setCookieStorageMethod:(NSInteger)method;
  324. - (NSInteger)cookieStorageMethod;
  325. // For feed requests, where the feed requires following "next" links to retrieve
  326. // all entries, the service can optionally do the additional fetches using the
  327. // original ticket, calling the client's finish selector only when a complete
  328. // feed has been obtained. During the fetch, the feed accumulated so far is
  329. // available from the ticket.
  330. //
  331. // Note that the final feed may be a combination of multiple partial feeds,
  332. // so is not exactly a genuine feed. In particular, it will not have a valid
  333. // "self" link, as it does not represent an object with a distinct URL.
  334. //
  335. // Default value is NO.
  336. - (BOOL)serviceShouldFollowNextLinks;
  337. - (void)setServiceShouldFollowNextLinks:(BOOL)flag;
  338. // set a non-zero value to enable uploading via chunked fetches
  339. // (resumable uploads); typically this defaults to kGDataStandardUploadChunkSize
  340. // for service subclasses that support chunked uploads
  341. - (NSUInteger)serviceUploadChunkSize;
  342. - (void)setServiceUploadChunkSize:(NSUInteger)val;
  343. // service subclasses may specify their own default chunk size
  344. + (NSUInteger)defaultServiceUploadChunkSize;
  345. // The service userData becomes the initial value for each future ticket's
  346. // userData.
  347. //
  348. // Since the network transactions may begin before the client has been
  349. // returned the ticket by the fetch call, it's preferable to call
  350. // setServiceUserData before the ticket is created rather than call the
  351. // ticket's setUserData:. Either way, the ticket's userData:
  352. // method will return the value.
  353. - (void)setServiceUserData:(id)userData;
  354. - (id)serviceUserData;
  355. // Properties are supported for client convenience.
  356. //
  357. // Property keys beginning with _ are reserved by the library.
  358. //
  359. // The service properties dictionary is copied to become the initial property
  360. // dictionary for each ticket.
  361. - (void)setServiceProperties:(NSDictionary *)dict;
  362. - (NSDictionary *)serviceProperties;
  363. - (void)setServiceProperty:(id)obj forKey:(NSString *)key; // pass nil obj to remove property
  364. - (id)servicePropertyForKey:(NSString *)key;
  365. // Set the surrogates to be used for future tickets. Surrogates are subclasses
  366. // to be used instead of standard classes when creating objects from the XML.
  367. // For example, this code will make the framework generate objects
  368. // using MyCalendarEntrySubclass instead of GDataEntryCalendar and
  369. // MyCalendarEventSubclass instead of GDataEntryCalendarEvent.
  370. //
  371. // NSDictionary *surrogates = [NSDictionary dictionaryWithObjectsAndKeys:
  372. // [MyCalendarEntrySubclass class], [GDataEntryCalendar class],
  373. // [MyCalendarEventSubclass class], [GDataEntryCalendarEvent class],
  374. // nil];
  375. // [calendarService setServiceSurrogates:surrogates];
  376. //
  377. - (NSDictionary *)serviceSurrogates;
  378. - (void)setServiceSurrogates:(NSDictionary *)dict;
  379. // Set if feeds fetched (and the entries and elements contained in the feeds)
  380. // keep track of unparsed XML elements. Setting this to YES offers a
  381. // performance and memory improvement, particularly for iPhone apps. However,
  382. // the entries in those feeds cannot be updated (as the unparsed XML inside the
  383. // entries has been lost, so cannot be sent back to the server.) An entry
  384. // can be re-fetched singly for updating. Default is NO. iPhone
  385. // apps retrieving large feeds should probably set this to YES.
  386. //
  387. - (BOOL)shouldServiceFeedsIgnoreUnknowns;
  388. - (void)setShouldServiceFeedsIgnoreUnknowns:(BOOL)flag;
  389. // The service uploadProgressSelector becomes the initial value for each future
  390. // ticket's uploadProgressSelector.
  391. //
  392. // The optional uploadProgressSelector will be called in the delegate as bytes
  393. // are uploaded to the server. It should have a signature matching
  394. //
  395. // - (void)ticket:(GDataServiceTicketBase *)ticket
  396. // hasDeliveredByteCount:(unsigned long long)numberOfBytesRead
  397. // ofTotalByteCount:(unsigned long long)dataLength;
  398. - (void)setServiceUploadProgressSelector:(SEL)progressSelector;
  399. - (SEL)serviceUploadProgressSelector;
  400. #if NS_BLOCKS_AVAILABLE
  401. - (void)setServiceUploadProgressHandler:(void (^) (GDataServiceTicketBase *ticket, unsigned long long numberOfBytesRead, unsigned long long dataLength))handler;
  402. - (GDataServiceUploadProgressHandler)serviceUploadProgressHandler;
  403. #endif
  404. // retrying; see comments on retry support at the top of GTMHTTPFetcher.
  405. - (BOOL)isServiceRetryEnabled;
  406. - (void)setIsServiceRetryEnabled:(BOOL)flag;
  407. // retry selector is optional for retries.
  408. //
  409. // If present, it should have the signature:
  410. // -(BOOL)ticket:(GDataServiceTicketBase *)ticket willRetry:(BOOL)suggestedWillRetry forError:(NSError *)error
  411. // and return YES to cause a retry. Note that unlike the GTMHTTPFetcher retry
  412. // selector, this selector's first argument is a ticket, not a fetcher.
  413. // The current fetcher can be retrived with [ticket currentFetcher]
  414. - (SEL)serviceRetrySelector;
  415. - (void)setServiceRetrySelector:(SEL)theSel;
  416. - (NSTimeInterval)serviceMaxRetryInterval;
  417. - (void)setServiceMaxRetryInterval:(NSTimeInterval)secs;
  418. // access to the parsing operation queue, for clients wanting to manage the
  419. // queue explicitly
  420. - (id)operationQueue;
  421. - (void)setOperationQueue:(id)queue;
  422. // credentials
  423. - (void)setUserCredentialsWithUsername:(NSString *)username
  424. password:(NSString *)password;
  425. - (NSString *)username;
  426. - (NSString *)password;
  427. // OAuth support
  428. - (id)authorizer;
  429. - (void)setAuthorizer:(id)obj;
  430. // Subclasses typically override defaultServiceVersion to specify the expected
  431. // version of the feed, but clients may also explicitly set the version
  432. // if they are using an instance of the base class directly.
  433. + (NSString *)defaultServiceVersion;
  434. - (NSString *)serviceVersion;
  435. - (void)setServiceVersion:(NSString *)str;
  436. // Wait synchronously for fetch to complete (strongly discouraged)
  437. //
  438. // This just runs the current event loop until the fetch completes
  439. // or the timout limit is reached. This may discard unexpected events
  440. // that occur while spinning, so it's really not appropriate for use
  441. // in serious applications.
  442. //
  443. // Returns true if an object was successfully fetched. If the wait
  444. // timed out, returns false and the returned error is nil.
  445. //
  446. // The returned object or error, if any, will be already autoreleased
  447. //
  448. // This routine will likely be removed in some future releases of the library.
  449. - (BOOL)waitForTicket:(GDataServiceTicketBase *)ticket
  450. timeout:(NSTimeInterval)timeoutInSeconds
  451. fetchedObject:(GDataObject **)outObjectOrNil
  452. error:(NSError **)outErrorOrNil;
  453. //
  454. // internal utilities
  455. //
  456. - (void)addAuthenticationToFetcher:(GTMHTTPFetcher *)fetcher;
  457. - (void)objectFetcher:(GTMHTTPFetcher *)fetcher finishedWithData:(NSData *)data error:(NSError *)error;
  458. + (NSString *)defaultApplicationIdentifier;
  459. + (NSString *)systemVersionString;
  460. - (BOOL)invokeRetrySelector:(SEL)retrySelector delegate:(id)delegate ticket:(GDataServiceTicketBase *)ticket willRetry:(BOOL)willRetry error:(NSError *)error;
  461. + (void)invokeCallback:(SEL)callbackSel target:(id)target ticket:(id)ticket object:(id)object error:(id)error;
  462. @end