org.fourthline.cling.model.gena

## Class GENASubscription<S extends Service>

- java.lang.Object
- - org.fourthline.cling.model.gena.GENASubscription<S>

- Direct Known Subclasses:
    LocalGENASubscription, RemoteGENASubscription

      public abstract class GENASubscription<S extends Service>
      extends Object

  An established subscription, with identifer, expiration duration, sequence handling, and state variable values.

  For every subscription, no matter if it's an incoming subscription to a local service, or a local control point subscribing to a remote servce, an instance is maintained by the `Registry`.

  Author:
    Christian Bauer

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `actualDurationSeconds`
    `protected UnsignedIntegerFourBytes` | `currentSequence`
    `protected Map<String,StateVariableValue<S>>` | `currentValues`
    `protected int` | `requestedDurationSeconds`
    `protected S` | `service`
    `protected String` | `subscriptionId`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `GENASubscription(S service)` Defaults to `UserConstants.DEFAULT_SUBSCRIPTION_DURATION_SECONDS`.
    `` | `GENASubscription(S service, int requestedDurationSeconds)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `established()`
    `abstract void` | `eventReceived()`
    `int` | `getActualDurationSeconds()`
    `UnsignedIntegerFourBytes` | `getCurrentSequence()`
    `Map<String,StateVariableValue<S>>` | `getCurrentValues()`
    `int` | `getRequestedDurationSeconds()`
    `S` | `getService()`
    `String` | `getSubscriptionId()`
    `void` | `setActualSubscriptionDurationSeconds(int seconds)`
    `void` | `setSubscriptionId(String subscriptionId)`
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### service

          protected S extends Service service

    - #### subscriptionId

          protected String subscriptionId

    - #### requestedDurationSeconds

          protected int requestedDurationSeconds

    - #### actualDurationSeconds

          protected int actualDurationSeconds

    - #### currentSequence

          protected UnsignedIntegerFourBytes currentSequence

    - #### currentValues

          protected Map<String,StateVariableValue<S extends Service>> currentValues

  - ### Constructor Detail

    - #### GENASubscription

          protected GENASubscription(S service)

      Defaults to `UserConstants.DEFAULT_SUBSCRIPTION_DURATION_SECONDS`.

    - #### GENASubscription

          public GENASubscription(S service,
                                  int requestedDurationSeconds)

  - ### Method Detail

    - #### getService

          public S getService()

    - #### getSubscriptionId

          public String getSubscriptionId()

    - #### setSubscriptionId

          public void setSubscriptionId(String subscriptionId)

    - #### getRequestedDurationSeconds

          public int getRequestedDurationSeconds()

    - #### getActualDurationSeconds

          public int getActualDurationSeconds()

    - #### setActualSubscriptionDurationSeconds

          public void setActualSubscriptionDurationSeconds(int seconds)

    - #### getCurrentSequence

          public UnsignedIntegerFourBytes getCurrentSequence()

    - #### getCurrentValues

          public Map<String,StateVariableValue<S>> getCurrentValues()

    - #### established

          public abstract void established()

    - #### eventReceived

          public abstract void eventReceived()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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