public DomainBareJid findProvisioningServerComponent ( ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { final XMPPConnection connection = connection ( ) ; ServiceDiscoveryManager sdm = ServiceDiscoveryManager . getInstanceFor ( connection ) ; List < DiscoverInfo > discoverInfos = sdm . findServicesDiscoverInfo ( Constants . IOT_PROVISIONING_NAMESPACE , true , true ) ; if ( discoverInfos . isEmpty ( ) ) { return null ; } Jid jid = discoverInfos . get ( 0 ) . getFrom ( ) ; assert ( jid . isDomainBareJid ( ) ) ; return jid . asDomainBareJid ( ) ; }
Try to find a provisioning server component .