org.fourthline.cling.protocol.sync

## Class SendingSubscribe

- java.lang.Object
- - org.fourthline.cling.protocol.SendingAsync
  - - org.fourthline.cling.protocol.SendingSync<OutgoingSubscribeRequestMessage,IncomingSubscribeResponseMessage>
    - - org.fourthline.cling.protocol.sync.SendingSubscribe

- All Implemented Interfaces:
    Runnable

      public class SendingSubscribe
      extends SendingSync<OutgoingSubscribeRequestMessage,IncomingSubscribeResponseMessage>

  Establishing a GENA event subscription with a remote host.

  Calls the `RemoteGENASubscription.establish()` method if the subscription request was responded to correctly.

  The `RemoteGENASubscription.fail(org.fourthline.cling.model.message.UpnpResponse)` method will be called if the request failed. No response from the remote host is indicated with a `null` argument value. Note that this is also the response if the subscription has to be aborted early, when no local stream server for callback URL creation is available. This is the case when the local network transport layer is switched off, subscriptions will fail immediately with no response.

  Author:
    Christian Bauer

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected RemoteGENASubscription` | `subscription`

    - ### Fields inherited from class org.fourthline.cling.protocol.SendingSync

      `outputMessage`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SendingSubscribe(UpnpService upnpService, RemoteGENASubscription subscription, List<NetworkAddress> activeStreamServers)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected IncomingSubscribeResponseMessage` | `executeSync()`
    `protected void` | `onSubscriptionFailure()`

    - ### Methods inherited from class org.fourthline.cling.protocol.SendingSync

      `execute, getInputMessage, getOutputMessage, toString`

    - ### Methods inherited from class org.fourthline.cling.protocol.SendingAsync

      `getUpnpService, run`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### subscription

          protected final RemoteGENASubscription subscription

  - ### Constructor Detail

    - #### SendingSubscribe

          public SendingSubscribe(UpnpService upnpService,
                                  RemoteGENASubscription subscription,
                                  List<NetworkAddress> activeStreamServers)

  - ### Method Detail

    - #### executeSync

          protected IncomingSubscribeResponseMessage executeSync()
                                                          throws RouterException

      Specified by:
        `executeSync` in class `SendingSync<OutgoingSubscribeRequestMessage,IncomingSubscribeResponseMessage>`
      Throws:
        `RouterException`

    - #### onSubscriptionFailure

          protected void onSubscriptionFailure()

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