Search in sources :

Example 1 with DiscoveryProviderListener

use of com.connectsdk.discovery.DiscoveryProviderListener in project butter-android by butterproject.

the class SSDPDiscoveryProvider method notifyListenersOfLostService.

private void notifyListenersOfLostService(ServiceDescription service) {
    List<String> serviceIds = serviceIdsForFilter(service.getServiceFilter());
    for (String serviceId : serviceIds) {
        ServiceDescription _newService = service.clone();
        _newService.setServiceID(serviceId);
        final ServiceDescription newService = _newService;
        Util.runOnUI(new Runnable() {

            @Override
            public void run() {
                for (DiscoveryProviderListener listener : serviceListeners) {
                    listener.onServiceRemoved(SSDPDiscoveryProvider.this, newService);
                }
            }
        });
    }
}
Also used : ServiceDescription(com.connectsdk.service.config.ServiceDescription) DiscoveryProviderListener(com.connectsdk.discovery.DiscoveryProviderListener)

Example 2 with DiscoveryProviderListener

use of com.connectsdk.discovery.DiscoveryProviderListener in project butter-android by butterproject.

the class SSDPDiscoveryProvider method notifyListenersOfNewService.

private void notifyListenersOfNewService(ServiceDescription service) {
    List<String> serviceIds = serviceIdsForFilter(service.getServiceFilter());
    for (String serviceId : serviceIds) {
        ServiceDescription _newService = service.clone();
        _newService.setServiceID(serviceId);
        final ServiceDescription newService = _newService;
        Util.runOnUI(new Runnable() {

            @Override
            public void run() {
                for (DiscoveryProviderListener listener : serviceListeners) {
                    listener.onServiceAdded(SSDPDiscoveryProvider.this, newService);
                }
            }
        });
    }
}
Also used : ServiceDescription(com.connectsdk.service.config.ServiceDescription) DiscoveryProviderListener(com.connectsdk.discovery.DiscoveryProviderListener)

Aggregations

DiscoveryProviderListener (com.connectsdk.discovery.DiscoveryProviderListener)2 ServiceDescription (com.connectsdk.service.config.ServiceDescription)2