org.teleal.cling.controlpoint
Class SubscriptionCallback
java.lang.Object
org.teleal.cling.controlpoint.SubscriptionCallback
- All Implemented Interfaces:
- java.lang.Runnable
public abstract class SubscriptionCallback
- extends java.lang.Object
- implements java.lang.Runnable
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
log
protected static java.util.logging.Logger log
deviceService
protected final DeviceService deviceService
requestedDurationSeconds
protected final java.lang.Integer requestedDurationSeconds
SubscriptionCallback
protected SubscriptionCallback(DeviceService deviceService)
SubscriptionCallback
protected SubscriptionCallback(DeviceService deviceService,
int requestedDurationSeconds)
getDeviceService
public DeviceService getDeviceService()
getControlPoint
public ControlPoint getControlPoint()
setControlPoint
public void setControlPoint(ControlPoint controlPoint)
getSubscription
public GENASubscription getSubscription()
setSubscription
public void setSubscription(GENASubscription subscription)
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
end
public void end()
failed
protected abstract void failed(GENASubscription subscription,
UpnpResponse responseStatus,
java.lang.Exception exception)
- Called when establishing a local or remote subscription failed. To get a nice error message that
transparently detects local or remote errors use createDefaultFailureMessage().
- Parameters:
subscription
- The failed subscription object, not very useful at this point.responseStatus
- For a remote subscription, if a response was received at all, this is it, otherwise null.exception
- For a local subscription, any exception that caused the failure, otherwise null.- See Also:
createDefaultFailureMessage(org.teleal.cling.model.message.UpnpResponse, java.lang.Exception)
established
protected abstract void established(GENASubscription subscription)
ended
protected abstract void ended(GENASubscription subscription,
CancelReason reason,
UpnpResponse responseStatus)
- Called when a local or remote subscription ended, either on user request or because of a failure.
- Parameters:
subscription
- The ended subscription instance.reason
- If the subscription ended regularly (through end()), this is null.responseStatus
- For a remote subscription, if the cause implies a remopte response and it was
received, this is it (e.g. renewal failure response).
eventReceived
protected abstract void eventReceived(GENASubscription subscription)
eventsMissed
protected abstract void eventsMissed(GENASubscription subscription,
int numberOfMissedEvents)
createDefaultFailureMessage
public static java.lang.String createDefaultFailureMessage(UpnpResponse responseStatus,
java.lang.Exception exception)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 2010 Teleal GmbH, Switzerland. All Rights Reserved.