Klasse OSGiUpnpServiceConfiguration
- Alle implementierten Schnittstellen:
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.
OSGiUpnpServiceConfigurationEnabler
based on the autoEnable
configuration value. Set autoEnable
to false
when using a custom
UpnpServiceConfiguration
component.- Autor:
- Christian Bauer, Kai Kreuzer - introduced bounded thread pool and http service streaming server, Victor Toni - consolidated transport abstraction into one interface, Wouter Born - conditionally enable component based on autoEnable configuration value, Laurent Garnier - added OSGi dependency to HttpService and removed its release, Laurent Garnier - added parameter "interfaces" to set a list of network interfaces to consider
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprotected ExecutorService
protected boolean
protected int
protected Namespace
protected org.osgi.framework.BundleContext
protected DatagramProcessor
protected DeviceDescriptorBinder
protected GENAEventProcessor
protected int
protected org.osgi.service.http.HttpService
protected String
protected ExecutorService
protected boolean
protected int
protected Namespace
protected static final String
protected ExecutorService
protected boolean
protected int
protected Integer
protected Integer
protected ServiceDescriptorBinder
protected SOAPActionProcessor
protected int
protected int
protected Integer
protected TransportConfiguration
-
Konstruktorübersicht
KonstruktorenModifiziererKonstruktorBeschreibungDefaults to port '0', ephemeral.protected
OSGiUpnpServiceConfiguration
(boolean checkRuntime) OSGiUpnpServiceConfiguration
(int streamListenPort) OSGiUpnpServiceConfiguration
(int streamListenPort, int multicastResponsePort) protected
OSGiUpnpServiceConfiguration
(int streamListenPort, int multicastResponsePort, boolean checkRuntime) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected void
protected ExecutorService
createDatagramIO
(NetworkAddressFactory networkAddressFactory) protected DatagramProcessor
protected DeviceDescriptorBinder
protected void
protected GENAEventProcessor
protected ExecutorService
createMulticastReceiver
(NetworkAddressFactory networkAddressFactory) protected Namespace
protected NetworkAddressFactory
createNetworkAddressFactory
(int streamListenPort, int multicastResponsePort) protected ExecutorService
protected ServiceDescriptorBinder
protected SOAPActionProcessor
createStreamServer
(NetworkAddressFactory networkAddressFactory) protected void
int
Optional setting for flooding alive NOTIFY messages for local devices.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.protected ExecutorService
int
Returns the time in seconds a remote device will be registered until it is expired.protected ExecutorService
boolean
Ignore the received event subscription timeout from remote control points.protected void
setConfigValues
(Map<String, Object> properties) void
setHttpService
(org.osgi.service.http.HttpService httpService) void
shutdown()
Called by theUpnpService
on shutdown, useful to e.g. shutdown thread pools.protected void
void
unsetHttpService
(org.osgi.service.http.HttpService httpService)
-
Felddetails
-
OSGI_SERVICE_HTTP_PORT
- Siehe auch:
-
threadPoolSize
protected int threadPoolSize -
asyncThreadPoolSize
protected int asyncThreadPoolSize -
remoteThreadPoolSize
protected int remoteThreadPoolSize -
interfaces
-
multicastResponsePort
protected int multicastResponsePort -
httpProxyPort
protected int httpProxyPort -
streamListenPort
protected int streamListenPort -
asyncThreadPool
protected boolean asyncThreadPool -
mainThreadPool
protected boolean mainThreadPool -
remoteThreadPool
protected boolean remoteThreadPool -
callbackURI
-
mainExecutorService
-
asyncExecutorService
-
remoteExecutorService
-
datagramProcessor
-
soapActionProcessor
-
genaEventProcessor
-
deviceDescriptorBinderUDA10
-
serviceDescriptorBinderUDA10
-
namespace
-
context
protected org.osgi.framework.BundleContext context -
transportConfiguration
-
timeoutSeconds
-
retryIterations
-
retryAfterSeconds
-
httpService
protected org.osgi.service.http.HttpService httpService
-
-
Konstruktordetails
-
OSGiUpnpServiceConfiguration
public OSGiUpnpServiceConfiguration()Defaults to port '0', ephemeral. -
OSGiUpnpServiceConfiguration
public OSGiUpnpServiceConfiguration(int streamListenPort) -
OSGiUpnpServiceConfiguration
public OSGiUpnpServiceConfiguration(int streamListenPort, int multicastResponsePort) -
OSGiUpnpServiceConfiguration
protected OSGiUpnpServiceConfiguration(boolean checkRuntime) -
OSGiUpnpServiceConfiguration
protected OSGiUpnpServiceConfiguration(int streamListenPort, int multicastResponsePort, boolean checkRuntime)
-
-
Methodendetails
-
activate
-
deactivate
protected void deactivate() -
setHttpService
public void setHttpService(org.osgi.service.http.HttpService httpService) -
unsetHttpService
public void unsetHttpService(org.osgi.service.http.HttpService httpService) -
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.
-
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.
-
createStreamServer
- Angegeben von:
createStreamServer
in SchnittstelleUpnpServiceConfiguration
- Parameter:
networkAddressFactory
- The configuredNetworkAddressFactory
.- Gibt zurück:
- A new instance of the
StreamServer
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
-
shutdownExecutorServices
protected void shutdownExecutorServices() -
createNetworkAddressFactory
protected NetworkAddressFactory createNetworkAddressFactory(int streamListenPort, int multicastResponsePort) -
createDatagramProcessor
-
createSOAPActionProcessor
-
createGENAEventProcessor
-
createDeviceDescriptorBinderUDA10
-
createServiceDescriptorBinderUDA10
-
createNamespace
-
getRemoteExecutorService
-
getMainExecutorService
-
createExecutorServices
protected void createExecutorServices() -
createMainExecutorService
-
createAsyncProtocolExecutorService
-
createRemoteProtocolExecutorService
-
setConfigValues
-