private void asyncGetGlobalCapabilitities ( final String [ ] domains , final String interfaceName , Collection < DiscoveryEntryWithMetaInfo > localDiscoveryEntries2 , long discoveryTimeout , final CapabilitiesCallback capabilitiesCallback ) { final Collection < DiscoveryEntryWithMetaInfo > localDiscoveryEntries = localDiscoveryEntries2 == null ? new LinkedList < DiscoveryEntryWithMetaInfo > ( ) : localDiscoveryEntries2 ; globalCapabilitiesDirectoryClient . lookup ( new Callback < List < GlobalDiscoveryEntry > > ( ) { @ Override public void onSuccess ( List < GlobalDiscoveryEntry > globalDiscoverEntries ) { if ( globalDiscoverEntries != null ) { registerIncomingEndpoints ( globalDiscoverEntries ) ; globalDiscoveryEntryCache . add ( globalDiscoverEntries ) ; Collection < DiscoveryEntryWithMetaInfo > allDisoveryEntries = new ArrayList < DiscoveryEntryWithMetaInfo > ( globalDiscoverEntries . size ( ) + localDiscoveryEntries . size ( ) ) ; allDisoveryEntries . addAll ( CapabilityUtils . convertToDiscoveryEntryWithMetaInfoList ( false , globalDiscoverEntries ) ) ; allDisoveryEntries . addAll ( localDiscoveryEntries ) ; capabilitiesCallback . processCapabilitiesReceived ( allDisoveryEntries ) ; } else { capabilitiesCallback . onError ( new NullPointerException ( "Received capabilities are null" ) ) ; } } @ Override public void onFailure ( JoynrRuntimeException exception ) { capabilitiesCallback . onError ( exception ) ; } } , domains , interfaceName , discoveryTimeout ) ; }
mixes in the localDiscoveryEntries to global capabilities found by participantId