org.teleal.cling.protocol
Class ProtocolFactoryImpl

java.lang.Object
  extended by org.teleal.cling.protocol.ProtocolFactoryImpl
All Implemented Interfaces:
ProtocolFactory
Direct Known Subclasses:
MockUpnpService.MockProtocolFactory

public class ProtocolFactoryImpl
extends Object
implements ProtocolFactory

Default implementation, directly instantiates the appropriate protocols.

Author:
Christian Bauer

Field Summary
protected  UpnpService upnpService
           
 
Constructor Summary
ProtocolFactoryImpl(UpnpService upnpService)
           
 
Method Summary
 ReceivingAsync createReceivingAsync(IncomingDatagramMessage message)
          Creates a ReceivingNotification, ReceivingSearch, or ReceivingSearchResponse protocol.
 ReceivingSync createReceivingSync(StreamRequestMessage message)
          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()
           
protected  boolean isByeBye(IncomingDatagramMessage message)
           
protected  boolean isSupportedServiceAdvertisement(IncomingDatagramMessage message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

upnpService

protected final UpnpService upnpService
Constructor Detail

ProtocolFactoryImpl

public ProtocolFactoryImpl(UpnpService upnpService)
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.

isByeBye

protected boolean isByeBye(IncomingDatagramMessage message)

isSupportedServiceAdvertisement

protected boolean isSupportedServiceAdvertisement(IncomingDatagramMessage message)

createReceivingSync

public ReceivingSync createReceivingSync(StreamRequestMessage message)
                                  throws ProtocolCreationException
Description copied from interface: ProtocolFactory
Creates a ReceivingRetrieval, ReceivingAction, ReceivingSubscribe, ReceivingUnsubscribe, or ReceivingEvent protocol.

Specified by:
createReceivingSync in interface ProtocolFactory
Parameters:
message - 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 © 2011 Teleal GmbH, Switzerland. All Rights Reserved.