aliyun-oss-react-native

OSSNetworkingRequestDelegate.h 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //
  2. // OSSNetworkingRequestDelegate.h
  3. // AliyunOSSSDK
  4. //
  5. // Created by huaixu on 2018/1/22.
  6. // Copyright © 2018年 aliyun. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "OSSConstants.h"
  10. #import "OSSTask.h"
  11. @class OSSAllRequestNeededMessage;
  12. @class OSSURLRequestRetryHandler;
  13. @class OSSHttpResponseParser;
  14. /**
  15. The proxy object class for each OSS request.
  16. */
  17. @interface OSSNetworkingRequestDelegate : NSObject
  18. @property (nonatomic, strong) NSMutableArray * interceptors;
  19. @property (nonatomic, strong) NSMutableURLRequest *internalRequest;
  20. @property (nonatomic, assign) OSSOperationType operType;
  21. @property (nonatomic, assign) BOOL isAccessViaProxy;
  22. @property (nonatomic, assign) BOOL isRequestCancelled;
  23. @property (nonatomic, strong) OSSAllRequestNeededMessage *allNeededMessage;
  24. @property (nonatomic, strong) OSSURLRequestRetryHandler *retryHandler;
  25. @property (nonatomic, strong) OSSHttpResponseParser *responseParser;
  26. @property (nonatomic, strong) NSData * uploadingData;
  27. @property (nonatomic, strong) NSURL * uploadingFileURL;
  28. @property (nonatomic, assign) int64_t payloadTotalBytesWritten;
  29. @property (nonatomic, assign) BOOL isBackgroundUploadFileTask;
  30. @property (nonatomic, assign) BOOL isHttpdnsEnable;
  31. @property (nonatomic, assign) uint32_t currentRetryCount;
  32. @property (nonatomic, strong) NSError * error;
  33. @property (nonatomic, assign) BOOL isHttpRequestNotSuccessResponse;
  34. @property (nonatomic, strong) NSMutableData *httpRequestNotSuccessResponseBody;
  35. @property (atomic, strong) NSURLSessionDataTask *currentSessionTask;
  36. @property (nonatomic, copy) OSSNetworkingUploadProgressBlock uploadProgress;
  37. @property (nonatomic, copy) OSSNetworkingDownloadProgressBlock downloadProgress;
  38. @property (nonatomic, copy) OSSNetworkingRetryBlock retryCallback;
  39. @property (nonatomic, copy) OSSNetworkingCompletionHandlerBlock completionHandler;
  40. @property (nonatomic, copy) OSSNetworkingOnRecieveDataBlock onRecieveData;
  41. /**
  42. * when put object to server,client caculate crc64 code and assigns it to
  43. * this property.
  44. */
  45. @property (nonatomic, copy) NSString *contentCRC;
  46. /** last crc64 code */
  47. @property (nonatomic, copy) NSString *lastCRC;
  48. /**
  49. * determine whether to verify crc64 code
  50. */
  51. @property (nonatomic, assign) BOOL crc64Verifiable;
  52. - (OSSTask *)buildInternalHttpRequest;
  53. - (void)reset;
  54. - (void)cancel;
  55. @end