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 ExecutorServiceprotected booleanprotected intprotected Namespaceprotected org.osgi.framework.BundleContextprotected DatagramProcessorprotected DeviceDescriptorBinderprotected GENAEventProcessorprotected intprotected org.osgi.service.http.HttpServiceprotected Stringprotected ExecutorServiceprotected booleanprotected intprotected Namespaceprotected static final Stringprotected ExecutorServiceprotected booleanprotected intprotected Integerprotected Integerprotected ServiceDescriptorBinderprotected SOAPActionProcessorprotected intprotected intprotected Integerprotected TransportConfiguration -
Konstruktorübersicht
KonstruktorenModifiziererKonstruktorBeschreibungDefaults to port '0', ephemeral.protectedOSGiUpnpServiceConfiguration(boolean checkRuntime) OSGiUpnpServiceConfiguration(int streamListenPort) OSGiUpnpServiceConfiguration(int streamListenPort, int multicastResponsePort) protectedOSGiUpnpServiceConfiguration(int streamListenPort, int multicastResponsePort, boolean checkRuntime) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected voidprotected ExecutorServicecreateDatagramIO(NetworkAddressFactory networkAddressFactory) protected DatagramProcessorprotected DeviceDescriptorBinderprotected voidprotected GENAEventProcessorprotected ExecutorServicecreateMulticastReceiver(NetworkAddressFactory networkAddressFactory) protected Namespaceprotected NetworkAddressFactorycreateNetworkAddressFactory(int streamListenPort, int multicastResponsePort) protected ExecutorServiceprotected ServiceDescriptorBinderprotected SOAPActionProcessorcreateStreamServer(NetworkAddressFactory networkAddressFactory) protected voidintOptional 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 ExecutorServiceintReturns the time in seconds a remote device will be registered until it is expired.protected ExecutorServicebooleanIgnore the received event subscription timeout from remote control points.protected voidsetConfigValues(Map<String, Object> properties) voidsetHttpService(org.osgi.service.http.HttpService httpService) voidshutdown()Called by theUpnpServiceon shutdown, useful to e.g. shutdown thread pools.protected voidvoidunsetHttpService(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:
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.
-
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.
-
createStreamServer
- Angegeben von:
createStreamServerin SchnittstelleUpnpServiceConfiguration- Parameter:
networkAddressFactory- The configuredNetworkAddressFactory.- Gibt zurück:
- A new instance of the
StreamServerinterface.
-
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
-
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
-