Package apple.foundation
Class NSURLSessionTask
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.foundation.NSURLSessionTask
-
- All Implemented Interfaces:
NSCopying,NSProgressReporting,NSObject
- Direct Known Subclasses:
AVAggregateAssetDownloadTask,AVAssetDownloadTask,NSURLSessionDataTask,NSURLSessionDownloadTask,NSURLSessionStreamTask,NSURLSessionWebSocketTask
public class NSURLSessionTask extends NSObject implements NSCopying, NSProgressReporting
NSURLSessionTask - a cancelable object that refers to the lifetime of processing a given request.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNSURLSessionTask(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()static NSURLSessionTaskalloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)voidcancel()-cancel returns immediately, but marks a task as being canceled.static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()java.lang.ObjectcopyWithZone(org.moe.natj.general.ptr.VoidPtr zone)longcountOfBytesClientExpectsToReceive()longcountOfBytesClientExpectsToSend()The number of bytes that the client expects (a best-guess upper-bound) will be sent and received by this task.longcountOfBytesExpectedToReceive()number of byte bytes we expect to receive, usually derived from the Content-Length header of an HTTP response.longcountOfBytesExpectedToSend()number of body bytes we expect to send, derived from the Content-Length of the HTTP requestlongcountOfBytesReceived()number of body bytes already receivedlongcountOfBytesSent()number of body bytes already sentNSURLRequestcurrentRequest()may differ from originalRequest due to http server redirectionstatic java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()NSDateearliestBeginDate()Start the network load for this task no earlier than the specified date.NSErrorerror()The error, if any, delivered via -URLSession:task:didCompleteWithError: This property will be nil in the event that no error occured.static longhash_static()NSURLSessionTaskinit()static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)static java.lang.Objectnew_objc()NSURLRequestoriginalRequest()may be nil if this is a stream taskfloatpriority()Sets a scaling factor for the priority of the task.NSProgressprogress()static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)NSURLResponseresponse()may be nil if no response has been receivedvoidresume()voidsetCountOfBytesClientExpectsToReceive(long value)voidsetCountOfBytesClientExpectsToSend(long value)The number of bytes that the client expects (a best-guess upper-bound) will be sent and received by this task.voidsetEarliestBeginDate(NSDate value)Start the network load for this task no earlier than the specified date.voidsetPriority(float value)Sets a scaling factor for the priority of the task.voidsetTaskDescription(java.lang.String value)The taskDescription property is available for the developer to provide a descriptive label for the task.static voidsetVersion_static(long aVersion)longstate()The current state of the task within the session.static org.moe.natj.objc.Classsuperclass_static()voidsuspend()Suspending a task will prevent the NSURLSession from continuing to load data.java.lang.StringtaskDescription()The taskDescription property is available for the developer to provide a descriptive label for the task.longtaskIdentifier()an identifier for this task, assigned by and unique to the owning sessionstatic longversion_static()-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static NSURLSessionTask alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static 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()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
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
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
new_objc
public static java.lang.Object new_objc()
-
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
public java.lang.Object copyWithZone(org.moe.natj.general.ptr.VoidPtr zone)
- Specified by:
copyWithZonein interfaceNSCopying
-
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
public NSURLRequest currentRequest()
may differ from originalRequest due to http server redirection
-
error
public NSError error()
The error, if any, delivered via -URLSession:task:didCompleteWithError: This property will be nil in the event that no error occured.
-
init
public NSURLSessionTask init()
-
originalRequest
public 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.
-
response
public 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.
-
setTaskDescription
public void setTaskDescription(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
public 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()
-
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.
-
earliestBeginDate
public 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.
-
progress
public NSProgress progress()
- Specified by:
progressin interfaceNSProgressReporting
-
setCountOfBytesClientExpectsToReceive
public void setCountOfBytesClientExpectsToReceive(long value)
-
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.
-
setEarliestBeginDate
public void setEarliestBeginDate(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.
-
-