org.fourthline.cling.protocol
Class ProtocolFactoryImpl

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

@ApplicationScoped
public class ProtocolFactoryImpl
extends Object
implements ProtocolFactory

Default implementation, directly instantiates the appropriate protocols.

Author:
Christian Bauer

Field Summary
protected  UpnpService upnpService
           
 
Constructor Summary
protected ProtocolFactoryImpl()
           
  ProtocolFactoryImpl(UpnpService upnpService)
           
 
Method Summary
protected  ReceivingAction createReceivingAction(StreamRequestMessage message)
           
 ReceivingAsync createReceivingAsync(IncomingDatagramMessage message)
          Creates a ReceivingNotification, ReceivingSearch, or ReceivingSearchResponse protocol.
protected  ReceivingEvent createReceivingEvent(StreamRequestMessage message)
           
protected  ReceivingAsync createReceivingNotification(IncomingDatagramMessage<UpnpRequest> incomingRequest)
           
protected  ReceivingRetrieval createReceivingRetrieval(StreamRequestMessage message)
           
protected  ReceivingAsync createReceivingSearch(IncomingDatagramMessage<UpnpRequest> incomingRequest)
           
protected  ReceivingAsync createReceivingSearchResponse(IncomingDatagramMessage<UpnpResponse> incomingResponse)
           
protected  ReceivingSubscribe createReceivingSubscribe(StreamRequestMessage message)
           
 ReceivingSync createReceivingSync(StreamRequestMessage message)
          Creates a ReceivingRetrieval, ReceivingAction, ReceivingSubscribe, ReceivingUnsubscribe, or ReceivingEvent protocol.
protected  ReceivingUnsubscribe createReceivingUnsubscribe(StreamRequestMessage message)
           
 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

protected ProtocolFactoryImpl()

ProtocolFactoryImpl

@Inject
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.

createReceivingNotification

protected ReceivingAsync createReceivingNotification(IncomingDatagramMessage<UpnpRequest> incomingRequest)

createReceivingSearch

protected ReceivingAsync createReceivingSearch(IncomingDatagramMessage<UpnpRequest> incomingRequest)

createReceivingSearchResponse

protected ReceivingAsync createReceivingSearchResponse(IncomingDatagramMessage<UpnpResponse> incomingResponse)

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)
                                        throws ProtocolCreationException
Description copied from interface: ProtocolFactory
Called by the ControlPoint, creates a protocol for GENA subscription.

Specified by:
createSendingSubscribe in interface ProtocolFactory
Throws:
ProtocolCreationException

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

createReceivingRetrieval

protected ReceivingRetrieval createReceivingRetrieval(StreamRequestMessage message)

createReceivingAction

protected ReceivingAction createReceivingAction(StreamRequestMessage message)

createReceivingSubscribe

protected ReceivingSubscribe createReceivingSubscribe(StreamRequestMessage message)

createReceivingUnsubscribe

protected ReceivingUnsubscribe createReceivingUnsubscribe(StreamRequestMessage message)

createReceivingEvent

protected ReceivingEvent createReceivingEvent(StreamRequestMessage message)


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