de.unikassel.android.sdcframework.util.facade
Interface ChainWorker<T>

Package class diagram package ChainWorker
Type Parameters:
T - the workers client type
All Known Subinterfaces:
ConnectionStrategy, DatabaseFullStrategy
All Known Implementing Classes:
AbstractChainWorker, AbstractConnectionStrategy, AbstractDatabaseFullStrategy, DeleteSamplesStrategy, MobileConnectionStrategy, NotificationStrategy, StopServiceStrategy, UseAvailableConnectionStrategy, WaitStrategy, WLANConnectionStrategy

public interface ChainWorker<T>

Interface for processors in a Chain of Responsibility.

A chain worker does know an optional successor and is calling its successor if he is not responsible or unable to do the work for the calling client.


Method Summary
 boolean doWork(T client)
          The work method called by the client
 ChainWorker<T> getSuccessor()
          The getter for the successor
 void setSuccessor(ChainWorker<T> successor)
          The setter for the successor
 ChainWorker<T> withSuccessor(ChainWorker<T> successor)
          A setter for the successor returning a reference to successor set
 

Method Detail

doWork

boolean doWork(T client)
The work method called by the client

Parameters:
client - the client to do the work for
Returns:
true if successful, false otherwise

setSuccessor

void setSuccessor(ChainWorker<T> successor)
The setter for the successor

Parameters:
successor - the successor to set

getSuccessor

ChainWorker<T> getSuccessor()
The getter for the successor

Returns:
the successor

withSuccessor

ChainWorker<T> withSuccessor(ChainWorker<T> successor)
A setter for the successor returning a reference to successor set

Parameters:
successor - the successor to set
Returns:
a reference to the successor set