Class THClient

  • All Implemented Interfaces:
    NSObject

    public class THClient
    extends NSObject
    A class that supports safely sharing Thread credentials between multiple clients. Request credentials for either a specific Thread network or for the _preferred network_ using `THClient`. The preferred network is the default Thread network chosen by the framework for a home. The ThreadNetwork framework maintains a database of network credentials. The class allows clients to store, list, and delete credentials for a given network from the database. Some methods in `THClient` use the _team ID_, a string that you store in your application’s `Info.plist`. The ThreadNetwork framework uses the team ID to preserve the privacy of the Thread network credentials across different clients. For example, credentials stored by one client can’t be deleted or modified by another client. - Important: Thread credentials give you the ability to add any device into the Thread network. Use this information responsibly. API-Since: 15.0
    • Constructor Detail

      • THClient

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • alloc

        public static THClient alloc()
      • allocWithZone

        public static THClient 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()
      • deleteCredentialsForBorderAgentCompletion

        public void deleteCredentialsForBorderAgentCompletion​(@NotNull
                                                              @NotNull NSData borderAgentID,
                                                              @NotNull
                                                              @NotNull THClient.Block_deleteCredentialsForBorderAgentCompletion completion)
        Deletes Thread network credentials from the framework database for a Border Agent. The Border Agent is the software component running in the Border Router responsible for advertising itself in the Wi-Fi or Ethernet network. - Parameters: - borderAgentID: The identifer of a Thread network Border Agent. - completion: The completion handler the framework calls after deleting the credentials. > Concurrency Note: You can call this method from synchronous code using a completion handler, > as shown on this page, or you can call it as an asynchronous method that has the > following declaration: > > ```swift > func deleteCredentials(forBorderAgent borderAgentID: Data) async throws > ``` > > For information about concurrency and asynchronous code in Swift, see . API-Since: 15.0
      • description_static

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

        public static long hash_static()
      • init

        public THClient init()
        Creates the client object. - Returns: An instance of the client object. API-Since: 15.0
        Overrides:
        init in class NSObject
      • 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

        public static THClient new_objc()
      • resolveClassMethod

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

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

        public void retrieveAllCredentials​(@NotNull
                                           @NotNull THClient.Block_retrieveAllCredentials completion)
        Requests all Thread credentials from the framework. The framework identifies the developer by the team ID. When calling this method, you receive credentials for your team ID only. - Parameters: - completion: The completion handler the framework calls when the credentials become available. > Concurrency Note: You can call this method from synchronous code using a completion handler, > as shown on this page, or you can call it as an asynchronous method that has the > following declaration: > > ```swift > func allCredentials() async throws -> Set > ``` > > For information about concurrency and asynchronous code in Swift, see . API-Since: 15.0
      • retrieveCredentialsForBorderAgentCompletion

        public void retrieveCredentialsForBorderAgentCompletion​(@NotNull
                                                                @NotNull NSData borderAgentID,
                                                                @NotNull
                                                                @NotNull THClient.Block_retrieveCredentialsForBorderAgentCompletion completion)
        Requests Thread credentials for a Border Agent. The framework identifies the developer by the team ID. When calling this method, you receive credentials for your team ID only. - Parameters: - borderAgentID: The identifer of a Thread network Border Agent. - completion: The completion handler the framework calls when the credentials become available. > Concurrency Note: You can call this method from synchronous code using a completion handler, > as shown on this page, or you can call it as an asynchronous method that has the > following declaration: > > ```swift > func credentials(forBorderAgentID borderAgentID: Data) async throws -> THCredentials > ``` > > For information about concurrency and asynchronous code in Swift, see . API-Since: 15.0
      • retrieveCredentialsForExtendedPANIDCompletion

        public void retrieveCredentialsForExtendedPANIDCompletion​(@NotNull
                                                                  @NotNull NSData extendedPANID,
                                                                  @NotNull
                                                                  @NotNull THClient.Block_retrieveCredentialsForExtendedPANIDCompletion completion)
        Requests Thread credentials for an extended Personal Area Network (PAN) ID. When calling this method, an alert appears asking for user permission to access credentials. - Parameters: - extendedPANID: The extended PAN identifier. - completion: The completion handler the framework calls when the credentials become available. > Concurrency Note: You can call this method from synchronous code using a completion handler, > as shown on this page, or you can call it as an asynchronous method that has the > following declaration: > > ```swift > func credentials(forExtendedPANID extendedPANID: Data) async throws -> THCredentials > ``` > > For information about concurrency and asynchronous code in Swift, see . API-Since: 15.0
      • retrievePreferredCredentials

        public void retrievePreferredCredentials​(@NotNull
                                                 @NotNull THClient.Block_retrievePreferredCredentials completion)
        Requests Thread credentials for the preferred network. When you call this method, an alert appears asking for user permission to access credentials. - Parameters: - completion: The completion handler the framework calls when the credentials become available. > Concurrency Note: You can call this method from synchronous code using a completion handler, > as shown on this page, or you can call it as an asynchronous method that has the > following declaration: > > ```swift > func preferredCredentials() async throws -> THCredentials > ``` > > For information about concurrency and asynchronous code in Swift, see . API-Since: 15.0
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • storeCredentialsForBorderAgentActiveOperationalDataSetCompletion

        public void storeCredentialsForBorderAgentActiveOperationalDataSetCompletion​(@NotNull
                                                                                     @NotNull NSData borderAgentID,
                                                                                     @NotNull
                                                                                     @NotNull NSData activeOperationalDataSet,
                                                                                     @NotNull
                                                                                     @NotNull THClient.Block_storeCredentialsForBorderAgentActiveOperationalDataSetCompletion completion)
        Stores Thread network credentials into the framework database that a Border Agent provides. The Border Agent is the software component running in the Border Router responsible for advertising itself in the Wi-Fi or Ethernet network. The framework only stores credentials if it can find an mDNS record for the Border Agent that contains the specified Border Agent identifier. - Parameters: - borderAgentID: The identifer of an active Thread network Border Agent. - activeOperationalDataSet: The essential operational parameters for the Thread network. - completion: The completion handler the framework calls after storing the credentials. > Concurrency Note: You can call this method from synchronous code using a completion handler, > as shown on this page, or you can call it as an asynchronous method that has the > following declaration: > > ```swift > func storeCredentials(forBorderAgent borderAgentID: Data, activeOperationalDataSet: Data) async throws > ``` > > For information about concurrency and asynchronous code in Swift, see . API-Since: 15.0
      • superclass_static

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

        public static long version_static()
      • checkPreferredNetworkForActiveOperationalDatasetCompletion

        public void checkPreferredNetworkForActiveOperationalDatasetCompletion​(@NotNull
                                                                               @NotNull NSData activeOperationalDataSet,
                                                                               @NotNull
                                                                               @NotNull THClient.Block_checkPreferredNetworkForActiveOperationalDatasetCompletion completion)
        Determines if the essential operating parameters match the preferred network’s parameters. - Parameters: - activeOperationalDataSet: The essential operating parameters to compare against the preferred network’s parameters. - completion: The completion handler that returns the result of the comparison. > Concurrency Note: You can call this method from synchronous code using a completion handler, > as shown on this page, or you can call it as an asynchronous method that has the > following declaration: > > ```swift > func isPreferred(forActiveOperationalDataset activeOperationalDataSet: Data) async -> Bool > ``` > > For information about concurrency and asynchronous code in Swift, see . API-Since: 15.5
      • isPreferredNetworkAvailableWithCompletion

        public void isPreferredNetworkAvailableWithCompletion​(@NotNull
                                                              @NotNull THClient.Block_isPreferredNetworkAvailableWithCompletion completion)
        Determines if the preferred network is available or not - Parameters: - completion: The completion handler that returns the result of the preferred network availability. > Concurrency Note: You can call this method from synchronous code using a completion handler, > as shown on this page, or you can call it as an asynchronous method that has the > following declaration: > > ```swift > func isPreferredAvailable() async -> Bool > ``` > > For information about concurrency and asynchronous code in Swift, see . API-Since: 16.4
      • retrieveAllActiveCredentials

        public void retrieveAllActiveCredentials​(@NotNull
                                                 @NotNull THClient.Block_retrieveAllActiveCredentials completion)
        Requests all Thread credentials with active border routers around from the framework. The framework identifies the developer by the team ID. When calling this method, you will receive credentials for active border routers around. You receive credentials for your team ID only. - Parameters: - completion: The completion handler the framework calls when the credentials become available. > Concurrency Note: You can call this method from synchronous code using a completion handler, > as shown on this page, or you can call it as an asynchronous method that has the > following declaration: > > ```swift > func allActiveCredentials() async throws -> Set > ``` > > For information about concurrency and asynchronous code in Swift, see . API-Since: 16.4
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.