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 classstatic class -
Konstruktorübersicht
KonstruktorenModifiziererKonstruktorBeschreibungDefaults to port '0', ephemeral.protectedDefaultUpnpServiceConfiguration(boolean checkRuntime) DefaultUpnpServiceConfiguration(int streamListenPort) DefaultUpnpServiceConfiguration(int streamListenPort, int multicastResponsePort) protectedDefaultUpnpServiceConfiguration(int streamListenPort, int multicastResponsePort, boolean checkRuntime) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcreateDatagramIO(NetworkAddressFactory networkAddressFactory) protected DatagramProcessorprotected ExecutorServiceprotected DeviceDescriptorBinderprotected GENAEventProcessorcreateMulticastReceiver(NetworkAddressFactory networkAddressFactory) protected Namespaceprotected NetworkAddressFactorycreateNetworkAddressFactory(int streamListenPort, int multicastResponsePort) protected ServiceDescriptorBinderprotected SOAPActionProcessorcreateStreamServer(NetworkAddressFactory networkAddressFactory) intOptional setting for flooding alive NOTIFY messages for local devices.protected ExecutorServiceOptional 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.intReturns the time in seconds a remote device will be registered until it is expired.booleanIgnore the received event subscription timeout from remote control points.voidshutdown()Called by theUpnpServiceon 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:
getDatagramProcessorin SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- The shared implementation of
DatagramProcessor.
-
getSoapActionProcessor
- Angegeben von:
getSoapActionProcessorin SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- The shared implementation of
SOAPActionProcessor.
-
getGenaEventProcessor
- Angegeben von:
getGenaEventProcessorin SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- The shared implementation of
GENAEventProcessor.
-
createStreamClient
- Angegeben von:
createStreamClientin SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- A new instance of the
StreamClientinterface.
-
createStreamServer
- Angegeben von:
createStreamServerin SchnittstelleUpnpServiceConfiguration- Parameter:
networkAddressFactory- The configuredNetworkAddressFactory.- Gibt zurück:
- A new instance of the
StreamServerinterface.
-
createMulticastReceiver
- Angegeben von:
createMulticastReceiverin SchnittstelleUpnpServiceConfiguration- Parameter:
networkAddressFactory- The configuredNetworkAddressFactory.- Gibt zurück:
- A new instance of the
MulticastReceiverinterface.
-
createDatagramIO
- Angegeben von:
createDatagramIOin SchnittstelleUpnpServiceConfiguration- Parameter:
networkAddressFactory- The configuredNetworkAddressFactory.- Gibt zurück:
- A new instance of the
DatagramIOinterface.
-
getMulticastReceiverExecutor
- Angegeben von:
getMulticastReceiverExecutorin SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- The executor which runs the listening background threads for multicast datagrams.
-
getDatagramIOExecutor
- Angegeben von:
getDatagramIOExecutorin SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- The executor which runs the listening background threads for unicast datagrams.
-
getStreamServerExecutorService
- Angegeben von:
getStreamServerExecutorServicein SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- The executor which runs the listening background threads for HTTP requests.
-
getDeviceDescriptorBinderUDA10
- Angegeben von:
getDeviceDescriptorBinderUDA10in SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- The shared implementation of
DeviceDescriptorBinderfor the UPnP 1.0 Device Architecture..
-
getServiceDescriptorBinderUDA10
- Angegeben von:
getServiceDescriptorBinderUDA10in SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- The shared implementation of
ServiceDescriptorBinderfor the UPnP 1.0 Device Architecture..
-
getExclusiveServiceTypes
Beschreibung aus Schnittstelle kopiert:UpnpServiceConfigurationReturns service types that can be handled by this UPnP stack, all others will be ignored.Return
nullto 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:
getExclusiveServiceTypesin SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- An array of service types that are exclusively discovered, no other service will
be discovered. A
nullreturn value will disable discovery! An empty array means all services will be discovered.
-
isReceivedSubscriptionTimeoutIgnored
public boolean isReceivedSubscriptionTimeoutIgnored()Beschreibung aus Schnittstelle kopiert:UpnpServiceConfigurationIgnore 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_SECONDSensures that your devices will not disappear on such control points.- Angegeben von:
isReceivedSubscriptionTimeoutIgnoredin SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- Defaults to
false.
-
getDescriptorRetrievalHeaders
Beschreibung aus Schnittstelle kopiert:UpnpServiceConfigurationOptional 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
ClientInfofor action request messages.- Angegeben von:
getDescriptorRetrievalHeadersin SchnittstelleUpnpServiceConfiguration- Parameter:
identity- The (so far) discovered identity of the remote device.- Gibt zurück:
nullor extra HTTP headers.
-
getEventSubscriptionHeaders
Beschreibung aus Schnittstelle kopiert:UpnpServiceConfigurationOptional 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:
getEventSubscriptionHeadersin SchnittstelleUpnpServiceConfiguration- Gibt zurück:
nullor extra HTTP headers.
-
getRegistryMaintenanceIntervalMillis
public int getRegistryMaintenanceIntervalMillis()- Angegeben von:
getRegistryMaintenanceIntervalMillisin SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- Defaults to 1000 milliseconds.
-
getAliveIntervalMillis
public int getAliveIntervalMillis()Beschreibung aus Schnittstelle kopiert:UpnpServiceConfigurationOptional setting for flooding alive NOTIFY messages for local devices.Use this to advertise local devices at the specified interval, independent of its
DeviceIdentity.maxAgeSecondsvalue. 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:
getAliveIntervalMillisin SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- Defaults to zero, disabling ALIVE flooding.
-
getRemoteDeviceMaxAgeSeconds
Beschreibung aus Schnittstelle kopiert:UpnpServiceConfigurationReturns 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
0in 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:
getRemoteDeviceMaxAgeSecondsin SchnittstelleUpnpServiceConfiguration- Gibt zurück:
null(the default) to accept the remote device's proposed maximum age, or0for unlimited age, or a value in seconds.
-
getAsyncProtocolExecutor
- Angegeben von:
getAsyncProtocolExecutorin SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- The executor which runs the processing of asynchronous aspects of the UPnP stack (discovery).
-
getSyncProtocolExecutorService
- Angegeben von:
getSyncProtocolExecutorServicein SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- The executor service which runs the processing of synchronous aspects of the UPnP stack (description, control, GENA).
-
getNamespace
- Angegeben von:
getNamespacein SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- An instance of
Namespacefor this UPnP stack.
-
getRegistryMaintainerExecutor
- Angegeben von:
getRegistryMaintainerExecutorin SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- The executor which runs the background thread for maintaining the registry.
-
getRegistryListenerExecutor
- Angegeben von:
getRegistryListenerExecutorin SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- The executor which runs the notification threads of registry listeners.
-
getRemoteListenerExecutor
- Angegeben von:
getRemoteListenerExecutorin SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- The executor which runs the remote listener threads.
-
createNetworkAddressFactory
- Angegeben von:
createNetworkAddressFactoryin SchnittstelleUpnpServiceConfiguration- Gibt zurück:
- A new instance of the
NetworkAddressFactoryinterface.
-
shutdown
public void shutdown()Beschreibung aus Schnittstelle kopiert:UpnpServiceConfigurationCalled by theUpnpServiceon shutdown, useful to e.g. shutdown thread pools.- Angegeben von:
shutdownin SchnittstelleUpnpServiceConfiguration
-
createNetworkAddressFactory
protected NetworkAddressFactory createNetworkAddressFactory(int streamListenPort, int multicastResponsePort) -
createDatagramProcessor
-
createSOAPActionProcessor
-
createGENAEventProcessor
-
createDeviceDescriptorBinderUDA10
-
createServiceDescriptorBinderUDA10
-
createNamespace
-
getDefaultExecutorService
-
createDefaultExecutorService
-