org.fourthline.cling.UpnpServiceConfiguration Java Examples

The following examples show how to use org.fourthline.cling.UpnpServiceConfiguration. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClingRouterFactory.java    From portmapper with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected List<IRouter> findRoutersInternal() throws RouterException {
    final UpnpServiceConfiguration config = new DefaultUpnpServiceConfiguration();
    final ClingRegistryListener clingRegistryListener = new ClingRegistryListener();
    final UpnpService upnpService = new UpnpServiceImpl(config, clingRegistryListener);
    shutdownServiceOnExit(upnpService);

    final UpnpHeader<?> searchType = new UDADeviceTypeHeader(ClingRegistryListener.IGD_DEVICE_TYPE);
    log.info("Start searching {} for device type {}", DISCOVERY_TIMEOUT, searchType);
    upnpService.getControlPoint().search(searchType, (int) DISCOVERY_TIMEOUT.toSeconds());
    return clingRegistryListener
            .waitForServiceFound(DISCOVERY_TIMEOUT) //
            .map(service -> (RemoteService) service)
            .map(service -> createRouter(service, upnpService)) //
            .collect(toList());
}
 
Example #2
Source File: SempDiscovery.java    From SmartApplianceEnabler with GNU General Public License v2.0 6 votes vote down vote up
private UpnpServiceConfiguration createServiceConfiguration() {
    return new DefaultUpnpServiceConfiguration() {
        @Override
        public DeviceDescriptorBinder getDeviceDescriptorBinderUDA10() {
            return new SempDeviceDescriptorBinderImpl(this, sempServerUrl);
        }

        @Override
        public StreamClient createStreamClient() {
            // disable the client in order to avoid requesting descriptors from UPnP devices
            return null;
        }

        @Override
        public StreamServer createStreamServer(NetworkAddressFactory networkAddressFactory) {
            return new org.fourthline.cling.transport.impl.apache.StreamServerImpl(
                    new StreamServerConfigurationImpl()
            );
        }
    };
}
 
Example #3
Source File: RouterImpl.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param configuration   The configuration used by this router.
 * @param protocolFactory The protocol factory used by this router.
 */
@Inject
public RouterImpl(UpnpServiceConfiguration configuration, ProtocolFactory protocolFactory) {
    log.info("Creating Router: " + getClass().getName());
    this.configuration = configuration;
    this.protocolFactory = protocolFactory;
}
 
Example #4
Source File: UpnpPortMapperModule.java    From bt with Apache License 2.0 5 votes vote down vote up
@Override
protected void configure() {
    ServiceModule.extend(binder()).addPortMapper(UpnpPortMapper.class);

    bind(UpnpServiceConfiguration.class).to(JettyAsyncUpnpServiceConfiguration.class);
    bind(UpnpPortMappingServicesRegistrar.class);
}
 
Example #5
Source File: AndroidRouter.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
public AndroidRouter(UpnpServiceConfiguration configuration,
                     ProtocolFactory protocolFactory,
                     Context context) throws InitializationException {
    super(configuration, protocolFactory);

    this.context = context;
    this.wifiManager = ((WifiManager) context.getSystemService(Context.WIFI_SERVICE));
    this.networkInfo = NetworkUtils.getConnectedNetworkInfo(context);

    // Only register for network connectivity changes if we are not running on emulator
    if (!ModelUtil.ANDROID_EMULATOR) {
        this.broadcastReceiver = new ConnectivityBroadcastReceiver();
        context.registerReceiver(broadcastReceiver, new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
    }
}
 
Example #6
Source File: RouterImpl.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
/**
 * @param configuration   The configuration used by this router.
 * @param protocolFactory The protocol factory used by this router.
 */
@Inject
public RouterImpl(UpnpServiceConfiguration configuration, ProtocolFactory protocolFactory) {
    log.info("Creating Router: " + getClass().getName());
    this.configuration = configuration;
    this.protocolFactory = protocolFactory;
}
 
Example #7
Source File: ControlPointImpl.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
@Inject
public ControlPointImpl(UpnpServiceConfiguration configuration, ProtocolFactory protocolFactory, Registry registry) {
    log.fine("Creating ControlPoint: " + getClass().getName());
    
    this.configuration = configuration;
    this.protocolFactory = protocolFactory;
    this.registry = registry;
}
 
Example #8
Source File: ControlPointImpl.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
@Inject
public ControlPointImpl(UpnpServiceConfiguration configuration, ProtocolFactory protocolFactory, Registry registry) {
    log.fine("Creating ControlPoint: " + getClass().getName());
    
    this.configuration = configuration;
    this.protocolFactory = protocolFactory;
    this.registry = registry;
}
 
Example #9
Source File: AndroidRouter.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
public AndroidRouter(UpnpServiceConfiguration configuration,
                     ProtocolFactory protocolFactory,
                     Context context) throws InitializationException {
    super(configuration, protocolFactory);

    this.context = context;
    this.wifiManager = ((WifiManager) context.getSystemService(Context.WIFI_SERVICE));
    this.networkInfo = NetworkUtils.getConnectedNetworkInfo(context);

    // Only register for network connectivity changes if we are not running on emulator
    if (!ModelUtil.ANDROID_EMULATOR) {
        this.broadcastReceiver = new ConnectivityBroadcastReceiver();
        context.registerReceiver(broadcastReceiver, new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
    }
}
 
Example #10
Source File: AndroidUpnpServiceImpl.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
protected AndroidRouter createRouter(UpnpServiceConfiguration configuration,
                                               ProtocolFactory protocolFactory,
                                               Context context) {
    return new AndroidRouter(configuration, protocolFactory, context);
}
 
Example #11
Source File: AndroidUpnpServiceImpl.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
protected UpnpServiceConfiguration createConfiguration() {
    return new AndroidUpnpServiceConfiguration();
}
 
Example #12
Source File: ControlPointImpl.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public UpnpServiceConfiguration getConfiguration() {
    return configuration;
}
 
Example #13
Source File: RouterImpl.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public UpnpServiceConfiguration getConfiguration() {
    return configuration;
}
 
Example #14
Source File: AndroidUpnpServiceImpl.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public UpnpServiceConfiguration getConfiguration() {
    return upnpService.getConfiguration();
}
 
Example #15
Source File: MockRouter.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
@Override
public UpnpServiceConfiguration getConfiguration() {
    return configuration;
}
 
Example #16
Source File: MockRouter.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public MockRouter(UpnpServiceConfiguration configuration,
                  ProtocolFactory protocolFactory) {
    this.configuration = configuration;
    this.protocolFactory = protocolFactory;
}
 
Example #17
Source File: MockUpnpService.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public UpnpServiceConfiguration getConfiguration() {
    return configuration;
}
 
Example #18
Source File: RegistryImpl.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
public UpnpServiceConfiguration getConfiguration() {
    return getUpnpService().getConfiguration();
}
 
Example #19
Source File: BeyondUpnpService.java    From BeyondUPnP with Apache License 2.0 4 votes vote down vote up
public UpnpServiceConfiguration getConfiguration() {
    return upnpService.getConfiguration();
}
 
Example #20
Source File: AndroidUpnpServiceImpl.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
protected UpnpServiceConfiguration createConfiguration() {
    return new AndroidUpnpServiceConfiguration();
}
 
Example #21
Source File: MockRouter.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
public MockRouter(UpnpServiceConfiguration configuration,
                  ProtocolFactory protocolFactory) {
    this.configuration = configuration;
    this.protocolFactory = protocolFactory;
}
 
Example #22
Source File: MockRouter.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
@Override
public UpnpServiceConfiguration getConfiguration() {
    return configuration;
}
 
Example #23
Source File: RouterImpl.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
public UpnpServiceConfiguration getConfiguration() {
    return configuration;
}
 
Example #24
Source File: ControlPointImpl.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
public UpnpServiceConfiguration getConfiguration() {
    return configuration;
}
 
Example #25
Source File: MockUpnpService.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
public UpnpServiceConfiguration getConfiguration() {
    return configuration;
}
 
Example #26
Source File: AndroidUpnpServiceImpl.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
protected AndroidRouter createRouter(UpnpServiceConfiguration configuration,
                                               ProtocolFactory protocolFactory,
                                               Context context) {
    return new AndroidRouter(configuration, protocolFactory, context);
}
 
Example #27
Source File: AndroidUpnpServiceImpl.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
public UpnpServiceConfiguration getConfiguration() {
    return upnpService.getConfiguration();
}
 
Example #28
Source File: RegistryImpl.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
public UpnpServiceConfiguration getConfiguration() {
    return getUpnpService().getConfiguration();
}
 
Example #29
Source File: UpnpPortMappingServicesRegistrar.java    From bt with Apache License 2.0 4 votes vote down vote up
@Inject
public UpnpPortMappingServicesRegistrar(IRuntimeLifecycleBinder lifecycleBinder, UpnpServiceConfiguration upnpServiceConfiguration) {
    this.lifecycleBinder = lifecycleBinder;
    this.upnpServiceConfiguration = upnpServiceConfiguration;
}
 
Example #30
Source File: BeyondUpnpService.java    From BeyondUPnP with Apache License 2.0 4 votes vote down vote up
@Override
protected UpnpServiceConfiguration createConfiguration() {
    return new FixedAndroidUpnpServiceConfiguration();
}