org.fourthline.cling.mock

## Class MockProtocolFactory

- java.lang.Object
- - org.fourthline.cling.mock.MockProtocolFactory

- All Implemented Interfaces:
    ProtocolFactory

      @Alternative
      public class MockProtocolFactory
      extends Object
      implements ProtocolFactory

  Author:
    Christian Bauer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MockProtocolFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ReceivingAsync` | `createReceivingAsync(IncomingDatagramMessage message)` Creates a `ReceivingNotification`, `ReceivingSearch`, or `ReceivingSearchResponse` protocol.
    `ReceivingSync` | `createReceivingSync(StreamRequestMessage requestMessage)` Creates a `ReceivingRetrieval`, `ReceivingAction`, `ReceivingSubscribe`, `ReceivingUnsubscribe`, or `ReceivingEvent` protocol.
    `SendingAction` | `createSendingAction(ActionInvocation actionInvocation, URL controlURL)` Called by the `ControlPoint`, creates a protocol for executing an action.
    `SendingEvent` | `createSendingEvent(LocalGENASubscription subscription)` Called by the `GENASubscription`, creates a protocol for sending GENA events.
    `SendingNotificationAlive` | `createSendingNotificationAlive(LocalDevice localDevice)` Called by the `Registry`, creates a protocol for announcing local devices.
    `SendingNotificationByebye` | `createSendingNotificationByebye(LocalDevice localDevice)` Called by the `Registry`, creates a protocol for announcing local devices.
    `SendingRenewal` | `createSendingRenewal(RemoteGENASubscription subscription)` Called by the `ControlPoint`, creates a protocol for GENA renewal.
    `SendingSearch` | `createSendingSearch(UpnpHeader searchTarget, int mxSeconds)` Called by the `ControlPoint`, creates a protocol for a multicast search.
    `SendingSubscribe` | `createSendingSubscribe(RemoteGENASubscription subscription)` Called by the `ControlPoint`, creates a protocol for GENA subscription.
    `SendingUnsubscribe` | `createSendingUnsubscribe(RemoteGENASubscription subscription)` Called by the `ControlPoint`, creates a protocol for GENA unsubscription.
    `UpnpService` | `getUpnpService()`

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

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

- - ### Constructor Detail

    - #### MockProtocolFactory

          public MockProtocolFactory()

  - ### Method Detail

    - #### getUpnpService

          public UpnpService getUpnpService()

      Specified by:
        `getUpnpService` in interface `ProtocolFactory`

    - #### createReceivingAsync

          public ReceivingAsync createReceivingAsync(IncomingDatagramMessage message)
                                              throws ProtocolCreationException

      Description copied from interface: `ProtocolFactory`
      Creates a `ReceivingNotification`, `ReceivingSearch`, or `ReceivingSearchResponse` protocol.
      Specified by:
        `createReceivingAsync` in interface `ProtocolFactory`
      Parameters:
        `message` - The incoming message, either `UpnpRequest` or `UpnpResponse`.
      Returns:
        The appropriate protocol that handles the messages or `null` if the message should be dropped.
      Throws:
        `ProtocolCreationException` - If no protocol could be found for the message.

    - #### createReceivingSync

          public ReceivingSync createReceivingSync(StreamRequestMessage requestMessage)
                                            throws ProtocolCreationException

      Description copied from interface: `ProtocolFactory`
      Creates a `ReceivingRetrieval`, `ReceivingAction`, `ReceivingSubscribe`, `ReceivingUnsubscribe`, or `ReceivingEvent` protocol.
      Specified by:
        `createReceivingSync` in interface `ProtocolFactory`
      Parameters:
        `requestMessage` - The incoming message, examime `UpnpRequest.Method` to determine the protocol.
      Returns:
        The appropriate protocol that handles the messages.
      Throws:
        `ProtocolCreationException` - If no protocol could be found for the message.

    - #### createSendingNotificationAlive

          public SendingNotificationAlive createSendingNotificationAlive(LocalDevice localDevice)

      Description copied from interface: `ProtocolFactory`
      Called by the `Registry`, creates a protocol for announcing local devices.
      Specified by:
        `createSendingNotificationAlive` in interface `ProtocolFactory`

    - #### createSendingNotificationByebye

          public SendingNotificationByebye createSendingNotificationByebye(LocalDevice localDevice)

      Description copied from interface: `ProtocolFactory`
      Called by the `Registry`, creates a protocol for announcing local devices.
      Specified by:
        `createSendingNotificationByebye` in interface `ProtocolFactory`

    - #### createSendingSearch

          public SendingSearch createSendingSearch(UpnpHeader searchTarget,
                                          int mxSeconds)

      Description copied from interface: `ProtocolFactory`
      Called by the `ControlPoint`, creates a protocol for a multicast search.
      Specified by:
        `createSendingSearch` in interface `ProtocolFactory`

    - #### createSendingAction

          public SendingAction createSendingAction(ActionInvocation actionInvocation,
                                          URL controlURL)

      Description copied from interface: `ProtocolFactory`
      Called by the `ControlPoint`, creates a protocol for executing an action.
      Specified by:
        `createSendingAction` in interface `ProtocolFactory`

    - #### createSendingSubscribe

          public SendingSubscribe createSendingSubscribe(RemoteGENASubscription subscription)

      Description copied from interface: `ProtocolFactory`
      Called by the `ControlPoint`, creates a protocol for GENA subscription.
      Specified by:
        `createSendingSubscribe` in interface `ProtocolFactory`

    - #### createSendingRenewal

          public SendingRenewal createSendingRenewal(RemoteGENASubscription subscription)

      Description copied from interface: `ProtocolFactory`
      Called by the `ControlPoint`, creates a protocol for GENA renewal.
      Specified by:
        `createSendingRenewal` in interface `ProtocolFactory`

    - #### createSendingUnsubscribe

          public SendingUnsubscribe createSendingUnsubscribe(RemoteGENASubscription subscription)

      Description copied from interface: `ProtocolFactory`
      Called by the `ControlPoint`, creates a protocol for GENA unsubscription.
      Specified by:
        `createSendingUnsubscribe` in interface `ProtocolFactory`

    - #### createSendingEvent

          public SendingEvent createSendingEvent(LocalGENASubscription subscription)

      Description copied from interface: `ProtocolFactory`
      Called by the `GENASubscription`, creates a protocol for sending GENA events.
      Specified by:
        `createSendingEvent` in interface `ProtocolFactory`

Copyright © 2014 4th Line GmbH, Switzerland. All Rights Reserved.