org.fourthline.cling.support.avtransport.impl

## Class AVTransportService<T extends AVTransport>

- java.lang.Object
- - org.fourthline.cling.support.avtransport.AbstractAVTransportService
  - - org.fourthline.cling.support.avtransport.impl.AVTransportService<T>

- All Implemented Interfaces:
    LastChangeDelegator

      public class AVTransportService<T extends AVTransport>
      extends AbstractAVTransportService

  State-machine based implementation of AVTransport service.

  One logical AVTransport is represented by:

  - One `AVTransportStateMachine` instance that accepts the action method call as a proxy.
  - Each state machine holds several instances of `AbstractState`, created on instantation of the state machine. The "current" state will be the target of the action call. It is the state implementation that decides how to handle the call and what the next state is after a possible transition.
  - Each state has a reference to an implementation of `AVTransport`, where the state can hold information about well, the state.

  Simplified, this means that each AVTransport instance ID is typically handled by one state machine, and the internal state of that machine is stored in an `AVTransport`.

  Override the `createTransport(org.fourthline.cling.model.types.UnsignedIntegerFourBytes, org.fourthline.cling.support.lastchange.LastChange)` method to utilize a subclass of `AVTransport` as your internal state holder.

  Author:
    Christian Bauer

- - ### Field Summary

    - ### Fields inherited from class org.fourthline.cling.support.avtransport.AbstractAVTransportService

      `propertyChangeSupport`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AVTransportService(Class<? extends AVTransportStateMachine> stateMachineDefinition, Class<? extends AbstractState> initialState)`
    `AVTransportService(Class<? extends AVTransportStateMachine> stateMachineDefinition, Class<? extends AbstractState> initialState, Class<T> transportClass)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected AVTransportStateMachine` | `createStateMachine(UnsignedIntegerFourBytes instanceId)`
    `protected AVTransport` | `createTransport(UnsignedIntegerFourBytes instanceId, LastChange lastChange)`
    `protected AVTransportStateMachine` | `findStateMachine(UnsignedIntegerFourBytes instanceId)`
    `protected AVTransportStateMachine` | `findStateMachine(UnsignedIntegerFourBytes instanceId, boolean createDefaultTransport)`
    `UnsignedIntegerFourBytes[]` | `getCurrentInstanceIds()`
    `protected TransportAction[]` | `getCurrentTransportActions(UnsignedIntegerFourBytes instanceId)`
    `DeviceCapabilities` | `getDeviceCapabilities(UnsignedIntegerFourBytes instanceId)`
    `MediaInfo` | `getMediaInfo(UnsignedIntegerFourBytes instanceId)`
    `PositionInfo` | `getPositionInfo(UnsignedIntegerFourBytes instanceId)`
    `TransportInfo` | `getTransportInfo(UnsignedIntegerFourBytes instanceId)`
    `TransportSettings` | `getTransportSettings(UnsignedIntegerFourBytes instanceId)`
    `void` | `next(UnsignedIntegerFourBytes instanceId)`
    `void` | `pause(UnsignedIntegerFourBytes instanceId)`
    `void` | `play(UnsignedIntegerFourBytes instanceId, String speed)`
    `void` | `previous(UnsignedIntegerFourBytes instanceId)`
    `void` | `record(UnsignedIntegerFourBytes instanceId)`
    `void` | `seek(UnsignedIntegerFourBytes instanceId, String unit, String target)`
    `void` | `setAVTransportURI(UnsignedIntegerFourBytes instanceId, String currentURI, String currentURIMetaData)`
    `void` | `setNextAVTransportURI(UnsignedIntegerFourBytes instanceId, String nextURI, String nextURIMetaData)`
    `void` | `setPlayMode(UnsignedIntegerFourBytes instanceId, String newPlayMode)`
    `void` | `setRecordQualityMode(UnsignedIntegerFourBytes instanceId, String newRecordQualityMode)`
    `void` | `stop(UnsignedIntegerFourBytes instanceId)`

    - ### Methods inherited from class org.fourthline.cling.support.avtransport.AbstractAVTransportService

      `appendCurrentState, getCurrentTransportActionsString, getDefaultInstanceID, getLastChange, getPropertyChangeSupport`

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

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

- - ### Constructor Detail

    - #### AVTransportService

          public AVTransportService(Class<? extends AVTransportStateMachine> stateMachineDefinition,
                                    Class<? extends AbstractState> initialState)

    - #### AVTransportService

          public AVTransportService(Class<? extends AVTransportStateMachine> stateMachineDefinition,
                                    Class<? extends AbstractState> initialState,
                                    Class<T> transportClass)

  - ### Method Detail

    - #### setAVTransportURI

          public void setAVTransportURI(UnsignedIntegerFourBytes instanceId,
                                        String currentURI,
                                        String currentURIMetaData)
                                 throws AVTransportException

      Specified by:
        `setAVTransportURI` in class `AbstractAVTransportService`
      Throws:
        `AVTransportException`

    - #### setNextAVTransportURI

          public void setNextAVTransportURI(UnsignedIntegerFourBytes instanceId,
                                            String nextURI,
                                            String nextURIMetaData)
                                     throws AVTransportException

      Specified by:
        `setNextAVTransportURI` in class `AbstractAVTransportService`
      Throws:
        `AVTransportException`

    - #### setPlayMode

          public void setPlayMode(UnsignedIntegerFourBytes instanceId,
                                  String newPlayMode)
                           throws AVTransportException

      Specified by:
        `setPlayMode` in class `AbstractAVTransportService`
      Throws:
        `AVTransportException`

    - #### setRecordQualityMode

          public void setRecordQualityMode(UnsignedIntegerFourBytes instanceId,
                                           String newRecordQualityMode)
                                    throws AVTransportException

      Specified by:
        `setRecordQualityMode` in class `AbstractAVTransportService`
      Throws:
        `AVTransportException`

    - #### getMediaInfo

          public MediaInfo getMediaInfo(UnsignedIntegerFourBytes instanceId)
                                 throws AVTransportException

      Specified by:
        `getMediaInfo` in class `AbstractAVTransportService`
      Throws:
        `AVTransportException`

    - #### getTransportInfo

          public TransportInfo getTransportInfo(UnsignedIntegerFourBytes instanceId)
                                         throws AVTransportException

      Specified by:
        `getTransportInfo` in class `AbstractAVTransportService`
      Throws:
        `AVTransportException`

    - #### getPositionInfo

          public PositionInfo getPositionInfo(UnsignedIntegerFourBytes instanceId)
                                       throws AVTransportException

      Specified by:
        `getPositionInfo` in class `AbstractAVTransportService`
      Throws:
        `AVTransportException`

    - #### getDeviceCapabilities

          public DeviceCapabilities getDeviceCapabilities(UnsignedIntegerFourBytes instanceId)
                                                   throws AVTransportException

      Specified by:
        `getDeviceCapabilities` in class `AbstractAVTransportService`
      Throws:
        `AVTransportException`

    - #### getTransportSettings

          public TransportSettings getTransportSettings(UnsignedIntegerFourBytes instanceId)
                                                 throws AVTransportException

      Specified by:
        `getTransportSettings` in class `AbstractAVTransportService`
      Throws:
        `AVTransportException`

    - #### stop

          public void stop(UnsignedIntegerFourBytes instanceId)
                    throws AVTransportException

      Specified by:
        `stop` in class `AbstractAVTransportService`
      Throws:
        `AVTransportException`

    - #### play

          public void play(UnsignedIntegerFourBytes instanceId,
                           String speed)
                    throws AVTransportException

      Specified by:
        `play` in class `AbstractAVTransportService`
      Throws:
        `AVTransportException`

    - #### pause

          public void pause(UnsignedIntegerFourBytes instanceId)
                     throws AVTransportException

      Specified by:
        `pause` in class `AbstractAVTransportService`
      Throws:
        `AVTransportException`

    - #### record

          public void record(UnsignedIntegerFourBytes instanceId)
                      throws AVTransportException

      Specified by:
        `record` in class `AbstractAVTransportService`
      Throws:
        `AVTransportException`

    - #### seek

          public void seek(UnsignedIntegerFourBytes instanceId,
                           String unit,
                           String target)
                    throws AVTransportException

      Specified by:
        `seek` in class `AbstractAVTransportService`
      Throws:
        `AVTransportException`

    - #### next

          public void next(UnsignedIntegerFourBytes instanceId)
                    throws AVTransportException

      Specified by:
        `next` in class `AbstractAVTransportService`
      Throws:
        `AVTransportException`

    - #### previous

          public void previous(UnsignedIntegerFourBytes instanceId)
                        throws AVTransportException

      Specified by:
        `previous` in class `AbstractAVTransportService`
      Throws:
        `AVTransportException`

    - #### getCurrentTransportActions

          protected TransportAction[] getCurrentTransportActions(UnsignedIntegerFourBytes instanceId)
                                                          throws Exception

      Specified by:
        `getCurrentTransportActions` in class `AbstractAVTransportService`
      Throws:
        `Exception`

    - #### getCurrentInstanceIds

          public UnsignedIntegerFourBytes[] getCurrentInstanceIds()

    - #### findStateMachine

          protected AVTransportStateMachine findStateMachine(UnsignedIntegerFourBytes instanceId)
                                                      throws AVTransportException

      Throws:
        `AVTransportException`

    - #### findStateMachine

          protected AVTransportStateMachine findStateMachine(UnsignedIntegerFourBytes instanceId,
                                                             boolean createDefaultTransport)
                                                      throws AVTransportException

      Throws:
        `AVTransportException`

    - #### createStateMachine

          protected AVTransportStateMachine createStateMachine(UnsignedIntegerFourBytes instanceId)

    - #### createTransport

          protected AVTransport createTransport(UnsignedIntegerFourBytes instanceId,
                                                LastChange lastChange)

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