Class NSURLSessionTask

    • Constructor Detail

      • NSURLSessionTask

        protected NSURLSessionTask​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static NSURLSessionTask allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • new_objc

        @Deprecated
        public static NSURLSessionTask new_objc()
        Deprecated.
        API-Since: 7.0 Deprecated-Since: 13.0 Deprecated-Message: Not supported
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • cancel

        public void cancel()
        -cancel returns immediately, but marks a task as being canceled. The task will signal -URLSession:task:didCompleteWithError: with an error value of { NSURLErrorDomain, NSURLErrorCancelled }. In some cases, the task may signal other work before it acknowledges the cancelation. -cancel may be sent to a task that has been suspended.
      • copyWithZone

        @NotNull
        public @NotNull java.lang.Object copyWithZone​(@Nullable
                                                      @Nullable org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        copyWithZone in interface NSCopying
      • countOfBytesExpectedToReceive

        public long countOfBytesExpectedToReceive()
        number of byte bytes we expect to receive, usually derived from the Content-Length header of an HTTP response.
      • countOfBytesExpectedToSend

        public long countOfBytesExpectedToSend()
        number of body bytes we expect to send, derived from the Content-Length of the HTTP request
      • countOfBytesReceived

        public long countOfBytesReceived()
        number of body bytes already received
      • countOfBytesSent

        public long countOfBytesSent()
        number of body bytes already sent
      • currentRequest

        @Nullable
        public @Nullable NSURLRequest currentRequest()
        may differ from originalRequest due to http server redirection
      • error

        @Nullable
        public @Nullable NSError error()
        The error, if any, delivered via -URLSession:task:didCompleteWithError: This property will be nil in the event that no error occurred.
      • init

        @Deprecated
        public NSURLSessionTask init()
        Deprecated.
        API-Since: 7.0 Deprecated-Since: 13.0 Deprecated-Message: Not supported
        Overrides:
        init in class NSObject
      • originalRequest

        @Nullable
        public @Nullable NSURLRequest originalRequest()
        may be nil if this is a stream task
      • priority

        public float priority()
        Sets a scaling factor for the priority of the task. The scaling factor is a value between 0.0 and 1.0 (inclusive), where 0.0 is considered the lowest priority and 1.0 is considered the highest. The priority is a hint and not a hard requirement of task performance. The priority of a task may be changed using this API at any time, but not all protocols support this; in these cases, the last priority that took effect will be used. If no priority is specified, the task will operate with the default priority as defined by the constant NSURLSessionTaskPriorityDefault. Two additional priority levels are provided: NSURLSessionTaskPriorityLow and NSURLSessionTaskPriorityHigh, but use is not restricted to these. API-Since: 8.0
      • response

        @Nullable
        public @Nullable NSURLResponse response()
        may be nil if no response has been received
      • resume

        public void resume()
      • setPriority

        public void setPriority​(float value)
        Sets a scaling factor for the priority of the task. The scaling factor is a value between 0.0 and 1.0 (inclusive), where 0.0 is considered the lowest priority and 1.0 is considered the highest. The priority is a hint and not a hard requirement of task performance. The priority of a task may be changed using this API at any time, but not all protocols support this; in these cases, the last priority that took effect will be used. If no priority is specified, the task will operate with the default priority as defined by the constant NSURLSessionTaskPriorityDefault. Two additional priority levels are provided: NSURLSessionTaskPriorityLow and NSURLSessionTaskPriorityHigh, but use is not restricted to these. API-Since: 8.0
      • setTaskDescription

        public void setTaskDescription​(@Nullable
                                       @Nullable java.lang.String value)
        The taskDescription property is available for the developer to provide a descriptive label for the task.
      • state

        public long state()
        The current state of the task within the session.
      • suspend

        public void suspend()
        Suspending a task will prevent the NSURLSession from continuing to load data. There may still be delegate calls made on behalf of this task (for instance, to report data received while suspending) but no further transmissions will be made on behalf of the task until -resume is sent. The timeout timer associated with the task will be disabled while a task is suspended. -suspend and -resume are nestable.
      • taskDescription

        @Nullable
        public @Nullable java.lang.String taskDescription()
        The taskDescription property is available for the developer to provide a descriptive label for the task.
      • taskIdentifier

        public long taskIdentifier()
        an identifier for this task, assigned by and unique to the owning session
      • countOfBytesClientExpectsToReceive

        public long countOfBytesClientExpectsToReceive()
        API-Since: 11.0
      • countOfBytesClientExpectsToSend

        public long countOfBytesClientExpectsToSend()
        The number of bytes that the client expects (a best-guess upper-bound) will be sent and received by this task. These values are used by system scheduling policy. If unspecified, NSURLSessionTransferSizeUnknown is used. API-Since: 11.0
      • earliestBeginDate

        @Nullable
        public @Nullable NSDate earliestBeginDate()
        Start the network load for this task no earlier than the specified date. If not specified, no start delay is used. Only applies to tasks created from background NSURLSession instances; has no effect for tasks created from other session types. API-Since: 11.0
      • setCountOfBytesClientExpectsToReceive

        public void setCountOfBytesClientExpectsToReceive​(long value)
        API-Since: 11.0
      • setCountOfBytesClientExpectsToSend

        public void setCountOfBytesClientExpectsToSend​(long value)
        The number of bytes that the client expects (a best-guess upper-bound) will be sent and received by this task. These values are used by system scheduling policy. If unspecified, NSURLSessionTransferSizeUnknown is used. API-Since: 11.0
      • setEarliestBeginDate

        public void setEarliestBeginDate​(@Nullable
                                         @Nullable NSDate value)
        Start the network load for this task no earlier than the specified date. If not specified, no start delay is used. Only applies to tasks created from background NSURLSession instances; has no effect for tasks created from other session types. API-Since: 11.0
      • delegate

        @Nullable
        public @Nullable NSURLSessionTaskDelegate delegate()
        Sets a task-specific delegate. Methods not implemented on this delegate will still be forwarded to the session delegate. Cannot be modified after task resumes. Not supported on background session. Delegate is strongly referenced until the task completes, after which it is reset to `nil`. API-Since: 15.0
      • prefersIncrementalDelivery

        public boolean prefersIncrementalDelivery()
        Provides a hint indicating if incremental delivery of a partial response body would be useful for the application, or if it cannot process the response until it is complete. Indicating that incremental delivery is not desired may improve task performance. For example, if a response cannot be decoded until the entire content is received, set this property to false. Defaults to true unless this task is created with completion-handler based convenience methods, or if it is a download task. API-Since: 14.5
      • setDelegate

        public void setDelegate​(@Nullable
                                @Nullable NSURLSessionTaskDelegate value)
        Sets a task-specific delegate. Methods not implemented on this delegate will still be forwarded to the session delegate. Cannot be modified after task resumes. Not supported on background session. Delegate is strongly referenced until the task completes, after which it is reset to `nil`. API-Since: 15.0
      • setPrefersIncrementalDelivery

        public void setPrefersIncrementalDelivery​(boolean value)
        Provides a hint indicating if incremental delivery of a partial response body would be useful for the application, or if it cannot process the response until it is complete. Indicating that incremental delivery is not desired may improve task performance. For example, if a response cannot be decoded until the entire content is received, set this property to false. Defaults to true unless this task is created with completion-handler based convenience methods, or if it is a download task. API-Since: 14.5
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.