Klasse DefaultUpnpServiceConfiguration
- Alle implementierten Schnittstellen:
UpnpServiceConfiguration
This configuration utilizes the default network transport implementation found in
org.jupnp.transport.impl
.
This configuration utilizes the DOM default descriptor binders found in
org.jupnp.binding.xml
.
The thread Executor
is an Executors.newCachedThreadPool()
with
a custom DefaultUpnpServiceConfiguration.JUPnPThreadFactory
(it only sets a thread name).
Note that this pool is effectively unlimited, so the number of threads will grow (and shrink) as needed - or restricted by your JVM.
The default Namespace
is configured without any
base path or prefix.
- Autor:
- Christian Bauer, Kai Kreuzer - introduced bounded thread pool, Jochen Hiller - increased thread pool size to 200, Victor Toni - consolidated transport abstraction into one interface
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic class
static class
-
Konstruktorübersicht
KonstruktorenModifiziererKonstruktorBeschreibungDefaults to port '0', ephemeral.protected
DefaultUpnpServiceConfiguration
(boolean checkRuntime) DefaultUpnpServiceConfiguration
(int streamListenPort) DefaultUpnpServiceConfiguration
(int streamListenPort, int multicastResponsePort) protected
DefaultUpnpServiceConfiguration
(int streamListenPort, int multicastResponsePort, boolean checkRuntime) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcreateDatagramIO
(NetworkAddressFactory networkAddressFactory) protected DatagramProcessor
protected ExecutorService
protected DeviceDescriptorBinder
protected GENAEventProcessor
createMulticastReceiver
(NetworkAddressFactory networkAddressFactory) protected Namespace
protected NetworkAddressFactory
createNetworkAddressFactory
(int streamListenPort, int multicastResponsePort) protected ServiceDescriptorBinder
protected SOAPActionProcessor
createStreamServer
(NetworkAddressFactory networkAddressFactory) int
Optional setting for flooding alive NOTIFY messages for local devices.protected ExecutorService
Optional extra headers for device descriptor retrieval HTTP requests.getEventSubscriptionHeaders
(RemoteService service) Optional extra headers for event subscription (almost HTTP) messages.Returns service types that can be handled by this UPnP stack, all others will be ignored.int
Returns the time in seconds a remote device will be registered until it is expired.boolean
Ignore the received event subscription timeout from remote control points.void
shutdown()
Called by theUpnpService
on shutdown, useful to e.g. shutdown thread pools.
-
Konstruktordetails
-
DefaultUpnpServiceConfiguration
public DefaultUpnpServiceConfiguration()Defaults to port '0', ephemeral. -
DefaultUpnpServiceConfiguration
public DefaultUpnpServiceConfiguration(int streamListenPort) -
DefaultUpnpServiceConfiguration
public DefaultUpnpServiceConfiguration(int streamListenPort, int multicastResponsePort) -
DefaultUpnpServiceConfiguration
protected DefaultUpnpServiceConfiguration(boolean checkRuntime) -
DefaultUpnpServiceConfiguration
protected DefaultUpnpServiceConfiguration(int streamListenPort, int multicastResponsePort, boolean checkRuntime)
-
-
Methodendetails
-
getDatagramProcessor
- Angegeben von:
getDatagramProcessor
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- The shared implementation of
DatagramProcessor
.
-
getSoapActionProcessor
- Angegeben von:
getSoapActionProcessor
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- The shared implementation of
SOAPActionProcessor
.
-
getGenaEventProcessor
- Angegeben von:
getGenaEventProcessor
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- The shared implementation of
GENAEventProcessor
.
-
createStreamClient
- Angegeben von:
createStreamClient
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- A new instance of the
StreamClient
interface.
-
createStreamServer
- Angegeben von:
createStreamServer
in SchnittstelleUpnpServiceConfiguration
- Parameter:
networkAddressFactory
- The configuredNetworkAddressFactory
.- Gibt zurück:
- A new instance of the
StreamServer
interface.
-
createMulticastReceiver
- Angegeben von:
createMulticastReceiver
in SchnittstelleUpnpServiceConfiguration
- Parameter:
networkAddressFactory
- The configuredNetworkAddressFactory
.- Gibt zurück:
- A new instance of the
MulticastReceiver
interface.
-
createDatagramIO
- Angegeben von:
createDatagramIO
in SchnittstelleUpnpServiceConfiguration
- Parameter:
networkAddressFactory
- The configuredNetworkAddressFactory
.- Gibt zurück:
- A new instance of the
DatagramIO
interface.
-
getMulticastReceiverExecutor
- Angegeben von:
getMulticastReceiverExecutor
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- The executor which runs the listening background threads for multicast datagrams.
-
getDatagramIOExecutor
- Angegeben von:
getDatagramIOExecutor
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- The executor which runs the listening background threads for unicast datagrams.
-
getStreamServerExecutorService
- Angegeben von:
getStreamServerExecutorService
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- The executor which runs the listening background threads for HTTP requests.
-
getDeviceDescriptorBinderUDA10
- Angegeben von:
getDeviceDescriptorBinderUDA10
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- The shared implementation of
DeviceDescriptorBinder
for the UPnP 1.0 Device Architecture..
-
getServiceDescriptorBinderUDA10
- Angegeben von:
getServiceDescriptorBinderUDA10
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- The shared implementation of
ServiceDescriptorBinder
for the UPnP 1.0 Device Architecture..
-
getExclusiveServiceTypes
Beschreibung aus Schnittstelle kopiert:UpnpServiceConfiguration
Returns service types that can be handled by this UPnP stack, all others will be ignored.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.
- Angegeben von:
getExclusiveServiceTypes
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- An array of service types that are exclusively discovered, no other service will
be discovered. A
null
return value will disable discovery! An empty array means all services will be discovered.
-
isReceivedSubscriptionTimeoutIgnored
public boolean isReceivedSubscriptionTimeoutIgnored()Beschreibung aus Schnittstelle kopiert:UpnpServiceConfiguration
Ignore the received event subscription timeout from remote control points.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.- Angegeben von:
isReceivedSubscriptionTimeoutIgnored
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- Defaults to
false
.
-
getDescriptorRetrievalHeaders
Beschreibung aus Schnittstelle kopiert:UpnpServiceConfiguration
Optional extra headers for device descriptor retrieval HTTP requests.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.- Angegeben von:
getDescriptorRetrievalHeaders
in SchnittstelleUpnpServiceConfiguration
- Parameter:
identity
- The (so far) discovered identity of the remote device.- Gibt zurück:
null
or extra HTTP headers.
-
getEventSubscriptionHeaders
Beschreibung aus Schnittstelle kopiert:UpnpServiceConfiguration
Optional extra headers for event subscription (almost HTTP) messages.Some 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.
- Angegeben von:
getEventSubscriptionHeaders
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
null
or extra HTTP headers.
-
getRegistryMaintenanceIntervalMillis
public int getRegistryMaintenanceIntervalMillis()- Angegeben von:
getRegistryMaintenanceIntervalMillis
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- Defaults to 1000 milliseconds.
-
getAliveIntervalMillis
public int getAliveIntervalMillis()Beschreibung aus Schnittstelle kopiert:UpnpServiceConfiguration
Optional setting for flooding alive NOTIFY messages for local devices.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.
- Angegeben von:
getAliveIntervalMillis
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- Defaults to zero, disabling ALIVE flooding.
-
getRemoteDeviceMaxAgeSeconds
Beschreibung aus Schnittstelle kopiert:UpnpServiceConfiguration
Returns the time in seconds a remote device will be registered until it is expired.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 theRegistry
. You typically remove the device when an action or GENA subscription request to the remote device failed.- Angegeben von:
getRemoteDeviceMaxAgeSeconds
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
null
(the default) to accept the remote device's proposed maximum age, or0
for unlimited age, or a value in seconds.
-
getAsyncProtocolExecutor
- Angegeben von:
getAsyncProtocolExecutor
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- The executor which runs the processing of asynchronous aspects of the UPnP stack (discovery).
-
getSyncProtocolExecutorService
- Angegeben von:
getSyncProtocolExecutorService
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- The executor service which runs the processing of synchronous aspects of the UPnP stack (description, control, GENA).
-
getNamespace
- Angegeben von:
getNamespace
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- An instance of
Namespace
for this UPnP stack.
-
getRegistryMaintainerExecutor
- Angegeben von:
getRegistryMaintainerExecutor
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- The executor which runs the background thread for maintaining the registry.
-
getRegistryListenerExecutor
- Angegeben von:
getRegistryListenerExecutor
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- The executor which runs the notification threads of registry listeners.
-
getRemoteListenerExecutor
- Angegeben von:
getRemoteListenerExecutor
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- The executor which runs the remote listener threads.
-
createNetworkAddressFactory
- Angegeben von:
createNetworkAddressFactory
in SchnittstelleUpnpServiceConfiguration
- Gibt zurück:
- A new instance of the
NetworkAddressFactory
interface.
-
shutdown
public void shutdown()Beschreibung aus Schnittstelle kopiert:UpnpServiceConfiguration
Called by theUpnpService
on shutdown, useful to e.g. shutdown thread pools.- Angegeben von:
shutdown
in SchnittstelleUpnpServiceConfiguration
-
createNetworkAddressFactory
protected NetworkAddressFactory createNetworkAddressFactory(int streamListenPort, int multicastResponsePort) -
createDatagramProcessor
-
createSOAPActionProcessor
-
createGENAEventProcessor
-
createDeviceDescriptorBinderUDA10
-
createServiceDescriptorBinderUDA10
-
createNamespace
-
getDefaultExecutorService
-
createDefaultExecutorService
-