de.unikassel.android.sdcframework.persistence
Class WaitStrategy

Package class diagram package WaitStrategy
java.lang.Object
  extended by de.unikassel.android.sdcframework.util.AbstractChainWorker<PersistentStorageManager>
      extended by de.unikassel.android.sdcframework.persistence.AbstractDatabaseFullStrategy
          extended by de.unikassel.android.sdcframework.persistence.WaitStrategy
All Implemented Interfaces:
DatabaseFullStrategy, ChainWorker<PersistentStorageManager>

public final class WaitStrategy
extends AbstractDatabaseFullStrategy

Implementation of a the database full strategy which does just wait a bit.

The idea behind this strategy is, that the transmission service may be just a bit busy but soon samples will be removed for transmission.

This strategy should just be a first choice, e.g. for the case of an absent transmission possibility, because the queued samples in the storage service may exceed memory limits soon.


Field Summary
private  long sleepTime
          The wait time
 
Constructor Summary
WaitStrategy(long waitTime)
          Constructor
 
Method Summary
 long getSleepTime()
          Getter for the wait time
 boolean process(PersistentStorageManager storageManager)
          Processing method of the worker
 
Methods inherited from class de.unikassel.android.sdcframework.util.AbstractChainWorker
doWork, getSuccessor, setSuccessor, withSuccessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.unikassel.android.sdcframework.util.facade.ChainWorker
doWork, getSuccessor, setSuccessor, withSuccessor
 

Field Detail

sleepTime

private final long sleepTime
The wait time

Constructor Detail

WaitStrategy

public WaitStrategy(long waitTime)
Constructor

Parameters:
waitTime - the time to wait in milliseconds
Method Detail

getSleepTime

public final long getSleepTime()
Getter for the wait time

Returns:
the wait time

process

public final boolean process(PersistentStorageManager storageManager)
Description copied from class: AbstractChainWorker
Processing method of the worker

Overrides:
process in class AbstractDatabaseFullStrategy
Parameters:
storageManager - the client
Returns:
true if successful