public class OSGiUpnpServiceConfiguration extends Object implements UpnpServiceConfiguration
This configuration utilizes the default network transport implementation found in org.jupnp.transport.impl.
This configuration utilizes the SAX default descriptor binders found in org.jupnp.binding.xml.
The thread Executor is an Executors.newCachedThreadPool() with a custom
QueueingThreadFactory.
The default Namespace is configured without any base path or prefix.
| Modifier | Constructor and Description |
|---|---|
|
OSGiUpnpServiceConfiguration()
Defaults to port '0', ephemeral.
|
protected |
OSGiUpnpServiceConfiguration(boolean checkRuntime) |
|
OSGiUpnpServiceConfiguration(int streamListenPort) |
|
OSGiUpnpServiceConfiguration(int streamListenPort,
int multicastResponsePort) |
protected |
OSGiUpnpServiceConfiguration(int streamListenPort,
int multicastResponsePort,
boolean checkRuntime) |
public OSGiUpnpServiceConfiguration()
public OSGiUpnpServiceConfiguration(int streamListenPort)
public OSGiUpnpServiceConfiguration(int streamListenPort,
int multicastResponsePort)
protected OSGiUpnpServiceConfiguration(boolean checkRuntime)
protected OSGiUpnpServiceConfiguration(int streamListenPort,
int multicastResponsePort,
boolean checkRuntime)
protected void activate(org.osgi.framework.BundleContext context,
Map<String,Object> configProps)
throws org.osgi.service.cm.ConfigurationException
org.osgi.service.cm.ConfigurationExceptionprotected void deactivate()
public DatagramProcessor getDatagramProcessor()
getDatagramProcessor in interface UpnpServiceConfigurationDatagramProcessor.public SOAPActionProcessor getSoapActionProcessor()
getSoapActionProcessor in interface UpnpServiceConfigurationSOAPActionProcessor.public GENAEventProcessor getGenaEventProcessor()
getGenaEventProcessor in interface UpnpServiceConfigurationGENAEventProcessor.public StreamClient createStreamClient()
createStreamClient in interface UpnpServiceConfigurationStreamClient interface.public MulticastReceiver createMulticastReceiver(NetworkAddressFactory networkAddressFactory)
createMulticastReceiver in interface UpnpServiceConfigurationnetworkAddressFactory - The configured NetworkAddressFactory.MulticastReceiver interface.public DatagramIO createDatagramIO(NetworkAddressFactory networkAddressFactory)
createDatagramIO in interface UpnpServiceConfigurationnetworkAddressFactory - The configured NetworkAddressFactory.DatagramIO interface.public StreamServer createStreamServer(NetworkAddressFactory networkAddressFactory)
createStreamServer in interface UpnpServiceConfigurationnetworkAddressFactory - The configured NetworkAddressFactory.StreamServer interface.public ExecutorService getMulticastReceiverExecutor()
getMulticastReceiverExecutor in interface UpnpServiceConfigurationpublic ExecutorService getDatagramIOExecutor()
getDatagramIOExecutor in interface UpnpServiceConfigurationpublic ExecutorService getStreamServerExecutorService()
getStreamServerExecutorService in interface UpnpServiceConfigurationpublic DeviceDescriptorBinder getDeviceDescriptorBinderUDA10()
getDeviceDescriptorBinderUDA10 in interface UpnpServiceConfigurationDeviceDescriptorBinder for the UPnP 1.0 Device Architecture..public ServiceDescriptorBinder getServiceDescriptorBinderUDA10()
getServiceDescriptorBinderUDA10 in interface UpnpServiceConfigurationServiceDescriptorBinder for the UPnP 1.0 Device Architecture..public ServiceType[] getExclusiveServiceTypes()
UpnpServiceConfiguration
Return null to completely disable remote device and service discovery.
All incoming notifications and search responses will then be dropped immediately.
This is mostly useful in applications that only provide services with no (remote)
control point functionality.
Note that a discovered service type with version 2 or 3 will match an exclusive service type with version 1. UPnP services are required to be backwards compatible, version 2 is a superset of version 1, and version 3 is a superset of version 2, etc.
getExclusiveServiceTypes in interface UpnpServiceConfigurationnull return value will disable discovery!
An empty array means all services will be discovered.public boolean isReceivedSubscriptionTimeoutIgnored()
UpnpServiceConfiguration
Some control points have trouble renewing subscriptions properly; enabling this option
in conjunction with a high value for
UserConstants.DEFAULT_SUBSCRIPTION_DURATION_SECONDS
ensures that your devices will not disappear on such control points.
isReceivedSubscriptionTimeoutIgnored in interface UpnpServiceConfigurationfalse.public UpnpHeaders getDescriptorRetrievalHeaders(RemoteDeviceIdentity identity)
UpnpServiceConfiguration
Some devices might require extra headers to recognize your control point, use this
method to set these headers. They will be used for every descriptor (XML) retrieval
HTTP request by jUPnP. See ClientInfo for
action request messages.
getDescriptorRetrievalHeaders in interface UpnpServiceConfigurationidentity - The (so far) discovered identity of the remote device.null or extra HTTP headers.public UpnpHeaders getEventSubscriptionHeaders(RemoteService service)
UpnpServiceConfigurationSome devices might require extra headers to recognize your control point, use this method to set these headers for GENA subscriptions. Note that the headers will not be applied to actual event messages, only subscribe, unsubscribe, and renewal.
getEventSubscriptionHeaders in interface UpnpServiceConfigurationnull or extra HTTP headers.public int getRegistryMaintenanceIntervalMillis()
getRegistryMaintenanceIntervalMillis in interface UpnpServiceConfigurationpublic int getAliveIntervalMillis()
UpnpServiceConfiguration
Use this to advertise local devices at the specified interval, independent of its
DeviceIdentity.maxAgeSeconds value. Note
that this will increase network traffic.
Some control points (XBMC and other Platinum UPnP SDK based devices, OPPO-93) seem to not properly receive SSDP M-SEARCH replies sent by jUPnP, but will handle NOTIFY alive messages just fine.
getAliveIntervalMillis in interface UpnpServiceConfigurationpublic Integer getRemoteDeviceMaxAgeSeconds()
UpnpServiceConfiguration
This setting is useful on systems which do not support multicast networking
(Android on HTC phones, for example). On such a system you will not receive messages when a
remote device disappears from the network and you will not receive its periodic heartbeat
alive messages. Only an initial search response (UDP unicast) has been received from the
remote device, with its proposed maximum age. To avoid (early) expiration of the remote
device, you can override its maxium age with this configuration setting, ignoring the
initial maximum age sent by the device. You most likely want to return
0 in this case, so that the remote device is never expired unless you
manually remove it from the Registry. You typically remove
the device when an action or GENA subscription request to the remote device failed.
getRemoteDeviceMaxAgeSeconds in interface UpnpServiceConfigurationnull (the default) to accept the remote device's proposed maximum age, or
0 for unlimited age, or a value in seconds.public ExecutorService getAsyncProtocolExecutor()
getAsyncProtocolExecutor in interface UpnpServiceConfigurationpublic ExecutorService getSyncProtocolExecutorService()
getSyncProtocolExecutorService in interface UpnpServiceConfigurationpublic Namespace getNamespace()
getNamespace in interface UpnpServiceConfigurationNamespace for this UPnP stack.public Executor getRegistryMaintainerExecutor()
getRegistryMaintainerExecutor in interface UpnpServiceConfigurationpublic Executor getRegistryListenerExecutor()
getRegistryListenerExecutor in interface UpnpServiceConfigurationpublic Executor getRemoteListenerExecutor()
getRemoteListenerExecutor in interface UpnpServiceConfigurationpublic NetworkAddressFactory createNetworkAddressFactory()
createNetworkAddressFactory in interface UpnpServiceConfigurationNetworkAddressFactory interface.public void shutdown()
UpnpServiceConfigurationUpnpService on shutdown, useful to e.g. shutdown thread pools.shutdown in interface UpnpServiceConfigurationprotected void shutdownExecutorServices()
protected NetworkAddressFactory createNetworkAddressFactory(int streamListenPort, int multicastResponsePort)
protected DatagramProcessor createDatagramProcessor()
protected SOAPActionProcessor createSOAPActionProcessor()
protected GENAEventProcessor createGENAEventProcessor()
protected DeviceDescriptorBinder createDeviceDescriptorBinderUDA10()
protected ServiceDescriptorBinder createServiceDescriptorBinderUDA10()
protected Namespace createNamespace()
protected ExecutorService getRemoteExecutorService()
protected ExecutorService getMainExecutorService()
protected ExecutorService createMainExecutorService()
Copyright © 2023 jUPnP.org. All rights reserved.