org.fourthline.cling

## Interface UpnpServiceConfiguration

- All Known Implementing Classes:
    AndroidUpnpServiceConfiguration, DefaultUpnpServiceConfiguration, ManagedUpnpServiceConfiguration, MockUpnpServiceConfiguration

      public interface UpnpServiceConfiguration

  Shared configuration data of the UPnP stack.

  This interface offers methods for retrieval of configuration data by the `Router` and the `Registry`, as well as other parts of the UPnP stack.

  You can re-use this interface if you implement a subclass of `UpnpServiceImpl` or if you create a new implementation of `UpnpService`.

  Author:
    Christian Bauer

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `DatagramIO` | `createDatagramIO(NetworkAddressFactory networkAddressFactory)`
    `MulticastReceiver` | `createMulticastReceiver(NetworkAddressFactory networkAddressFactory)`
    `NetworkAddressFactory` | `createNetworkAddressFactory()`
    `StreamClient` | `createStreamClient()`
    `StreamServer` | `createStreamServer(NetworkAddressFactory networkAddressFactory)`
    `int` | `getAliveIntervalMillis()` Optional setting for flooding alive NOTIFY messages for local devices.
    `Executor` | `getAsyncProtocolExecutor()`
    `Executor` | `getDatagramIOExecutor()`
    `DatagramProcessor` | `getDatagramProcessor()`
    `UpnpHeaders` | `getDescriptorRetrievalHeaders(RemoteDeviceIdentity identity)` Optional extra headers for device descriptor retrieval HTTP requests.
    `DeviceDescriptorBinder` | `getDeviceDescriptorBinderUDA10()`
    `UpnpHeaders` | `getEventSubscriptionHeaders(RemoteService service)` Optional extra headers for event subscription (almost HTTP) messages.
    `ServiceType[]` | `getExclusiveServiceTypes()` Returns service types that can be handled by this UPnP stack, all others will be ignored.
    `GENAEventProcessor` | `getGenaEventProcessor()`
    `Executor` | `getMulticastReceiverExecutor()`
    `Namespace` | `getNamespace()`
    `Executor` | `getRegistryListenerExecutor()`
    `Executor` | `getRegistryMaintainerExecutor()`
    `int` | `getRegistryMaintenanceIntervalMillis()`
    `Integer` | `getRemoteDeviceMaxAgeSeconds()` Returns the time in seconds a remote device will be registered until it is expired.
    `ServiceDescriptorBinder` | `getServiceDescriptorBinderUDA10()`
    `SOAPActionProcessor` | `getSoapActionProcessor()`
    `ExecutorService` | `getStreamServerExecutorService()`
    `ExecutorService` | `getSyncProtocolExecutorService()`
    `boolean` | `isReceivedSubscriptionTimeoutIgnored()` Ignore the received event subscription timeout from remote control points.
    `void` | `shutdown()` Called by the `UpnpService` on shutdown, useful to e.g.

- - ### Method Detail

    - #### createNetworkAddressFactory

          NetworkAddressFactory createNetworkAddressFactory()

      Returns:
        A new instance of the `NetworkAddressFactory` interface.

    - #### getDatagramProcessor

          DatagramProcessor getDatagramProcessor()

      Returns:
        The shared implementation of `DatagramProcessor`.

    - #### getSoapActionProcessor

          SOAPActionProcessor getSoapActionProcessor()

      Returns:
        The shared implementation of `SOAPActionProcessor`.

    - #### getGenaEventProcessor

          GENAEventProcessor getGenaEventProcessor()

      Returns:
        The shared implementation of `GENAEventProcessor`.

    - #### createStreamClient

          StreamClient createStreamClient()

      Returns:
        A new instance of the `StreamClient` interface.

    - #### createMulticastReceiver

          MulticastReceiver createMulticastReceiver(NetworkAddressFactory networkAddressFactory)

      Parameters:
        `networkAddressFactory` - The configured `NetworkAddressFactory`.
      Returns:
        A new instance of the `MulticastReceiver` interface.

    - #### createDatagramIO

          DatagramIO createDatagramIO(NetworkAddressFactory networkAddressFactory)

      Parameters:
        `networkAddressFactory` - The configured `NetworkAddressFactory`.
      Returns:
        A new instance of the `DatagramIO` interface.

    - #### createStreamServer

          StreamServer createStreamServer(NetworkAddressFactory networkAddressFactory)

      Parameters:
        `networkAddressFactory` - The configured `NetworkAddressFactory`.
      Returns:
        A new instance of the `StreamServer` interface.

    - #### getMulticastReceiverExecutor

          Executor getMulticastReceiverExecutor()

      Returns:
        The executor which runs the listening background threads for multicast datagrams.

    - #### getDatagramIOExecutor

          Executor getDatagramIOExecutor()

      Returns:
        The executor which runs the listening background threads for unicast datagrams.

    - #### getStreamServerExecutorService

          ExecutorService getStreamServerExecutorService()

      Returns:
        The executor which runs the listening background threads for HTTP requests.

    - #### getDeviceDescriptorBinderUDA10

          DeviceDescriptorBinder getDeviceDescriptorBinderUDA10()

      Returns:
        The shared implementation of `DeviceDescriptorBinder` for the UPnP 1.0 Device Architecture..

    - #### getServiceDescriptorBinderUDA10

          ServiceDescriptorBinder getServiceDescriptorBinderUDA10()

      Returns:
        The shared implementation of `ServiceDescriptorBinder` for the UPnP 1.0 Device Architecture..

    - #### getExclusiveServiceTypes

          ServiceType[] getExclusiveServiceTypes()

      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.

      Returns:
        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.

    - #### getRegistryMaintenanceIntervalMillis

          int getRegistryMaintenanceIntervalMillis()

      Returns:
        The time in milliseconds to wait between each registry maintenance operation.

    - #### getAliveIntervalMillis

          int getAliveIntervalMillis()

      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 Cling, but will handle NOTIFY alive messages just fine.

      Returns:
        The time in milliseconds for ALIVE message intervals, set to `0` to disable

    - #### isReceivedSubscriptionTimeoutIgnored

          boolean isReceivedSubscriptionTimeoutIgnored()

      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.

      Returns:
        `true` if the timeout in incoming event subscriptions should be ignored and the default value (`UserConstants.DEFAULT_SUBSCRIPTION_DURATION_SECONDS`) should be used instead.

    - #### getRemoteDeviceMaxAgeSeconds

          Integer getRemoteDeviceMaxAgeSeconds()

      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 maximum 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.

      Returns:
        `null` (the default) to accept the remote device's proposed maximum age, or `0` for unlimited age, or a value in seconds.

    - #### getDescriptorRetrievalHeaders

          UpnpHeaders getDescriptorRetrievalHeaders(RemoteDeviceIdentity identity)

      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 Cling. See `ClientInfo` for action request messages.

      Parameters:
        `identity` - The (so far) discovered identity of the remote device.
      Returns:
        `null` or extra HTTP headers.

    - #### getEventSubscriptionHeaders

          UpnpHeaders getEventSubscriptionHeaders(RemoteService service)

      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.

      Returns:
        `null` or extra HTTP headers.

    - #### getAsyncProtocolExecutor

          Executor getAsyncProtocolExecutor()

      Returns:
        The executor which runs the processing of asynchronous aspects of the UPnP stack (discovery).

    - #### getSyncProtocolExecutorService

          ExecutorService getSyncProtocolExecutorService()

      Returns:
        The executor service which runs the processing of synchronous aspects of the UPnP stack (description, control, GENA).

    - #### getNamespace

          Namespace getNamespace()

      Returns:
        An instance of `Namespace` for this UPnP stack.

    - #### getRegistryMaintainerExecutor

          Executor getRegistryMaintainerExecutor()

      Returns:
        The executor which runs the background thread for maintaining the registry.

    - #### getRegistryListenerExecutor

          Executor getRegistryListenerExecutor()

      Returns:
        The executor which runs the notification threads of registry listeners.

    - #### shutdown

          void shutdown()

      Called by the `UpnpService` on shutdown, useful to e.g. shutdown thread pools.

Copyright © 2016 4th Line GmbH, Switzerland. All rights reserved.