ArcGIS Runtime SDK for iOS: AGSJob.h Source File
ArcGIS Runtime SDK for iOS  100.11
AGSJob.h
Go to the documentation of this file.
1 /*
2  COPYRIGHT 2021 ESRI
3 
4  All rights reserved under the copyright laws of the United States
5  and applicable international laws, treaties, and conventions.
6 
7  This material is licensed for use under the Esri Master License
8  Agreement (MLA), and is bound by the terms of that agreement.
9  You may redistribute and use this code without modification,
10  provided you adhere to the terms of the MLA and include this
11  copyright notice.
12 
13  See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english
14 
15  For additional information, contact:
16  Environmental Systems Research Institute, Inc.
17  Attn: Contracts and Legal Services Department
18  380 New York Street
19  Redlands, California, 92373
20  USA
21 
22  email: contracts@esri.com
23  */
24  //Required for Globals API doc
26 
27 #import <Foundation/Foundation.h>
28 #import <ArcGIS/AGSObject.h>
29 #import <ArcGIS/AGSRemoteResource.h>
30 #import <ArcGIS/AGSJSONSerializable.h>
31 
32 
33 
38 typedef NS_ENUM(NSInteger, AGSJobType) {
46 };
47 
52 typedef NS_ENUM(NSInteger, AGSJobStatus) {
58 };
59 
60 @class AGSJobMessage;
61 
62 @protocol AGSCancelable;
63 
72 @interface AGSJob : AGSObject <AGSRemoteResource, AGSJSONSerializable, NSProgressReporting>
73 
74 #pragma mark -
75 #pragma mark initializers
76 
77 
78 
79 #pragma mark -
80 #pragma mark properties
81 
85 @property (nullable, nonatomic, strong, readonly) NSError *error;
86 
90 @property (nonatomic, assign, readonly) AGSJobType jobType;
91 
95 @property (nonatomic, copy, readonly) NSArray<AGSJobMessage*> *messages;
96 
100 @property (nonatomic, copy, readonly) NSString *serverJobID;
101 
105 @property (nonatomic, assign, readonly) AGSJobStatus status;
106 
110 @property (nullable, nonatomic, strong, readonly) id result;
111 
118 @property (nonatomic, strong, readonly) NSProgress *progress;
119 
120 #pragma mark -
121 #pragma mark methods
122 
123 -(void)startWithStatusHandler:(nullable void(^)(AGSJobStatus status))statusHandler
124  completion:(void(^)(id __nullable result, NSError * __nullable error))completion;
125 
131 -(BOOL)pause ;
132 
138 -(BOOL)cancel ;
139 
144 -(id<AGSCancelable>)checkStatusWithCompletion:(void(^)(NSError * __nullable error))completion;
145 
146 @end
147 
148 
AGSJobStatus
Definition: AGSJob.h:52
@ AGSJobStatusFailed
Definition: AGSJob.h:57
@ AGSJobStatusNotStarted
Definition: AGSJob.h:53
@ AGSJobStatusPaused
Definition: AGSJob.h:55
@ AGSJobStatusStarted
Definition: AGSJob.h:54
@ AGSJobStatusSucceeded
Definition: AGSJob.h:56
AGSJobType
Definition: AGSJob.h:38
@ AGSJobTypeExportTileCache
Definition: AGSJob.h:41
@ AGSJobTypeOfflineMapSync
Definition: AGSJob.h:45
@ AGSJobTypeGenerateGeodatabase
Definition: AGSJob.h:39
@ AGSJobTypeGeoprocessingJob
Definition: AGSJob.h:43
@ AGSJobTypeEstimateTileCacheSize
Definition: AGSJob.h:42
@ AGSJobTypeSyncGeodatabase
Definition: AGSJob.h:40
@ AGSJobTypeGenerateOfflineMap
Definition: AGSJob.h:44
A long running job on a remote server.
Definition: AGSJob.h:72
id result
Definition: AGSJob.h:110
AGSJobType jobType
Definition: AGSJob.h:90
NSProgress * progress
Definition: AGSJob.h:118
BOOL cancel()
AGSJobStatus status
Definition: AGSJob.h:105
NSError * error
Definition: AGSJob.h:85
BOOL pause()
NSArray< AGSJobMessage * > * messages
Definition: AGSJob.h:95
NSString * serverJobID
Definition: AGSJob.h:100
Informational message about the execution of a job.
Definition: AGSJobMessage.h:59
Definition: AGSObject.h:28
A protocol exposed by operations that allow cancellation.
Definition: AGSCancelable.h:38
A protocol to convert objects to and from JSON.
Definition: AGSJSONSerializable.h:38
A protocol adopted by classes that access remote network resources that have the potential to be secu...
Definition: AGSRemoteResource.h:40