com.octo.android.robospice.request.notifier
Interface RequestListenerNotifier

All Known Implementing Classes:
DefaultRequestListenerNotifier

public interface RequestListenerNotifier

Defines the behavior of an entity that reports on progress processing inside a given RequestProcessor.

Author:
SNI

Method Summary
<T> void
clearNotificationsForRequest(CachedSpiceRequest<T> request, Set<RequestListener<?>> listeners)
          Clears all pending notifications for a given request.
<T> void
notifyListenersOfRequestAdded(CachedSpiceRequest<T> request, Set<RequestListener<?>> listeners)
          Notify listeners that a pending request has been found.
<T> void
notifyListenersOfRequestAggregated(CachedSpiceRequest<T> request, Set<RequestListener<?>> listeners)
          Notify listeners that a pending request has been found.
<T> void
notifyListenersOfRequestCancellation(CachedSpiceRequest<T> request, Set<RequestListener<?>> listeners)
          Notify listeners of a request's cancelation.
<T> void
notifyListenersOfRequestFailure(CachedSpiceRequest<T> request, SpiceException e, Set<RequestListener<?>> listeners)
          Notify listeners of a request's failure.
<T> void
notifyListenersOfRequestNotFound(CachedSpiceRequest<T> request, Set<RequestListener<?>> listeners)
          Notify listeners that no pending request is found (used by SpiceManager.addListenerIfPending(Class, Object, com.octo.android.robospice.request.listener.PendingRequestListener) .
<T> void
notifyListenersOfRequestProgress(CachedSpiceRequest<T> request, Set<RequestListener<?>> listeners, RequestProgress progress)
          Notify listeners of a request's progress.
<T> void
notifyListenersOfRequestSuccess(CachedSpiceRequest<T> request, T result, Set<RequestListener<?>> listeners)
          Notify listeners of a request's success.
 

Method Detail

notifyListenersOfRequestNotFound

<T> void notifyListenersOfRequestNotFound(CachedSpiceRequest<T> request,
                                          Set<RequestListener<?>> listeners)
Notify listeners that no pending request is found (used by SpiceManager.addListenerIfPending(Class, Object, com.octo.android.robospice.request.listener.PendingRequestListener) .

Parameters:
request - a given request.
listeners - a set of RequestListener. Only instances of PendingRequestListener will be notified of the event.

notifyListenersOfRequestAdded

<T> void notifyListenersOfRequestAdded(CachedSpiceRequest<T> request,
                                       Set<RequestListener<?>> listeners)
Notify listeners that a pending request has been found. This callback is invoked when a request is added into request queue, not during aggregation to a pending request.

Parameters:
request - a given request.
listeners - a set of RequestListener.

notifyListenersOfRequestAggregated

<T> void notifyListenersOfRequestAggregated(CachedSpiceRequest<T> request,
                                            Set<RequestListener<?>> listeners)
Notify listeners that a pending request has been found. This callback is invoked when a request is aggregated to a pending request.

Parameters:
request - a given request.
listeners - a set of RequestListener.

notifyListenersOfRequestSuccess

<T> void notifyListenersOfRequestSuccess(CachedSpiceRequest<T> request,
                                         T result,
                                         Set<RequestListener<?>> listeners)
Notify listeners of a request's success.

Parameters:
request - a given request.
listeners - a set of RequestListener.

notifyListenersOfRequestFailure

<T> void notifyListenersOfRequestFailure(CachedSpiceRequest<T> request,
                                         SpiceException e,
                                         Set<RequestListener<?>> listeners)
Notify listeners of a request's failure.

Parameters:
request - a given request.
listeners - a set of RequestListener.

notifyListenersOfRequestCancellation

<T> void notifyListenersOfRequestCancellation(CachedSpiceRequest<T> request,
                                              Set<RequestListener<?>> listeners)
Notify listeners of a request's cancelation.

Parameters:
request - a given request.
listeners - a set of RequestListener.

notifyListenersOfRequestProgress

<T> void notifyListenersOfRequestProgress(CachedSpiceRequest<T> request,
                                          Set<RequestListener<?>> listeners,
                                          RequestProgress progress)
Notify listeners of a request's progress.

Parameters:
request - a given request.
listeners - a set of RequestListener. Only RequestProgressListener will be notified of the event.

clearNotificationsForRequest

<T> void clearNotificationsForRequest(CachedSpiceRequest<T> request,
                                      Set<RequestListener<?>> listeners)
Clears all pending notifications for a given request.

Parameters:
request - the request not to notify listeners of.
listeners - the listeners that won't be notified.


Copyright © 2012-2014. All Rights Reserved.