Class NSURLSession

    • Constructor Detail

      • NSURLSession

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • 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()
      • 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)
      • sessionWithConfiguration

        public static NSURLSession sessionWithConfiguration​(NSURLSessionConfiguration configuration)
        Customization of NSURLSession occurs during creation of a new session. If you only need to use the convenience routines with custom configuration options it is not necessary to specify a delegate. If you do specify a delegate, the delegate will be retained until after the delegate has been sent the URLSession:didBecomeInvalidWithError: message.
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • sharedSession

        public static NSURLSession sharedSession()
        The shared session uses the currently set global NSURLCache, NSHTTPCookieStorage and NSURLCredentialStorage objects.
      • superclass_static

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

        public static long version_static()
      • dataTaskWithRequest

        public NSURLSessionDataTask dataTaskWithRequest​(NSURLRequest request)
        Creates a data task with the given request. The request may have a body stream.
      • dataTaskWithRequestCompletionHandler

        public NSURLSessionDataTask dataTaskWithRequestCompletionHandler​(NSURLRequest request,
                                                                         NSURLSession.Block_dataTaskWithRequestCompletionHandler completionHandler)
        data task convenience methods. These methods create tasks that bypass the normal delegate calls for response and data delivery, and provide a simple cancelable asynchronous interface to receiving data. Errors will be returned in the NSURLErrorDomain, see . The delegate, if any, will still be called for authentication challenges.
      • dataTaskWithURL

        public NSURLSessionDataTask dataTaskWithURL​(NSURL url)
        Creates a data task to retrieve the contents of the given URL.
      • downloadTaskWithResumeData

        public NSURLSessionDownloadTask downloadTaskWithResumeData​(NSData resumeData)
        Creates a download task with the resume data. If the download cannot be successfully resumed, URLSession:task:didCompleteWithError: will be called.
      • downloadTaskWithURL

        public NSURLSessionDownloadTask downloadTaskWithURL​(NSURL url)
        Creates a download task to download the contents of the given URL.
      • finishTasksAndInvalidate

        public void finishTasksAndInvalidate()
        -finishTasksAndInvalidate returns immediately and existing tasks will be allowed to run to completion. New tasks may not be created. The session will continue to make delegate callbacks until URLSession:didBecomeInvalidWithError: has been issued. -finishTasksAndInvalidate and -invalidateAndCancel do not have any effect on the shared session singleton. When invalidating a background session, it is not safe to create another background session with the same identifier until URLSession:didBecomeInvalidWithError: has been issued.
      • flushWithCompletionHandler

        public void flushWithCompletionHandler​(NSURLSession.Block_flushWithCompletionHandler completionHandler)
        flush storage to disk and clear transient network caches. Invokes completionHandler() on the delegate queue if not nil.
      • invalidateAndCancel

        public void invalidateAndCancel()
        -invalidateAndCancel acts as -finishTasksAndInvalidate, but issues -cancel to all outstanding tasks for this session. Note task cancellation is subject to the state of the task, and some tasks may have already have completed at the time they are sent -cancel.
      • resetWithCompletionHandler

        public void resetWithCompletionHandler​(NSURLSession.Block_resetWithCompletionHandler completionHandler)
        empty all cookies, cache and credential stores, removes disk files, issues -flushWithCompletionHandler:. Invokes completionHandler() on the delegate queue if not nil.
      • sessionDescription

        public java.lang.String sessionDescription()
        The sessionDescription property is available for the developer to provide a descriptive label for the session.
      • setSessionDescription

        public void setSessionDescription​(java.lang.String value)
        The sessionDescription property is available for the developer to provide a descriptive label for the session.
      • streamTaskWithHostNamePort

        public NSURLSessionStreamTask streamTaskWithHostNamePort​(java.lang.String hostname,
                                                                 long port)
        Creates a bidirectional stream task to a given host and port.
      • streamTaskWithNetService

        public NSURLSessionStreamTask streamTaskWithNetService​(NSNetService service)
        Creates a bidirectional stream task with an NSNetService to identify the endpoint. The NSNetService will be resolved before any IO completes.
      • uploadTaskWithRequestFromData

        public NSURLSessionUploadTask uploadTaskWithRequestFromData​(NSURLRequest request,
                                                                    NSData bodyData)
        Creates an upload task with the given request. The body of the request is provided from the bodyData.
      • uploadTaskWithRequestFromFile

        public NSURLSessionUploadTask uploadTaskWithRequestFromFile​(NSURLRequest request,
                                                                    NSURL fileURL)
        Creates an upload task with the given request. The body of the request will be created from the file referenced by fileURL
      • uploadTaskWithStreamedRequest

        public NSURLSessionUploadTask uploadTaskWithStreamedRequest​(NSURLRequest request)
        Creates an upload task with the given request. The previously set body stream of the request (if any) is ignored and the URLSession:task:needNewBodyStream: delegate will be called when the body payload is required.
      • webSocketTaskWithRequest

        public NSURLSessionWebSocketTask webSocketTaskWithRequest​(NSURLRequest request)
        Creates a WebSocket task given the request. The request properties can be modified and will be used by the task during the HTTP handshake phase. Clients who want to add custom protocols can do so by directly adding headers with the key Sec-WebSocket-Protocol and a comma separated list of protocols they wish to negotiate with the server. The custom HTTP headers provided by the client will remain unchanged for the handshake with the server.
      • webSocketTaskWithURL

        public NSURLSessionWebSocketTask webSocketTaskWithURL​(NSURL url)
        Creates a WebSocket task given the url. The given url must have a ws or wss scheme.
      • webSocketTaskWithURLProtocols

        public NSURLSessionWebSocketTask webSocketTaskWithURLProtocols​(NSURL url,
                                                                       NSArray<java.lang.String> protocols)
        Creates a WebSocket task given the url and an array of protocols. The protocols will be used in the WebSocket handshake to negotiate a prefered protocol with the server Note - The protocol will not affect the WebSocket framing. More details on the protocol can be found by reading the WebSocket RFC