anon.client
Class AbstractAutoSwitchedMixCascadeContainer
java.lang.Object
java.util.Observable
anon.client.BasicTrustModel
anon.infoservice.AbstractMixCascadeContainer
anon.client.AbstractAutoSwitchedMixCascadeContainer
- All Implemented Interfaces:
- ITrustModel, IServiceContainer
- Direct Known Subclasses:
- Controller.AutoSwitchedMixCascadeContainer, JAPController.AutoSwitchedMixCascadeContainer
public abstract class AbstractAutoSwitchedMixCascadeContainer
- extends AbstractMixCascadeContainer
This class returns a new random cascade from all currently available cascades every time
getNextCascade() is called. If all available cascades have been returned once, this class starts
again by choosing the random cascades from all available ones.
- Author:
- Rolf Wendolsky
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_alreadyTriedCascades
private java.util.Hashtable m_alreadyTriedCascades
m_random
private java.util.Random m_random
m_initialCascade
private MixCascade m_initialCascade
m_currentCascade
private MixCascade m_currentCascade
m_bKeepCurrentCascade
private boolean m_bKeepCurrentCascade
m_bSkipInitialCascade
private boolean m_bSkipInitialCascade
AbstractAutoSwitchedMixCascadeContainer
public AbstractAutoSwitchedMixCascadeContainer(boolean a_bSkipInitialCascade,
MixCascade a_initialCascade)
getInitialCascade
public final MixCascade getInitialCascade()
getNextRandomCascade
public final MixCascade getNextRandomCascade()
- Explicitly chooses the next cascade at random. If auto-reconnect is active,
this method is equal to getNextCascade().
- Returns:
- the next cascade at random
getNextCascade
public final MixCascade getNextCascade()
- Description copied from class:
AbstractMixCascadeContainer
- Must return a MixCascade and never null. The returned MixCascade may change
with every call of this method.
- Specified by:
getNextCascade
in class AbstractMixCascadeContainer
- Returns:
- a MixCascade and never null
getNextCascade
private final MixCascade getNextCascade(boolean a_bForceNextRandom)
isServiceAutoSwitched
public abstract boolean isServiceAutoSwitched()
- Specified by:
isServiceAutoSwitched
in interface IServiceContainer
- Specified by:
isServiceAutoSwitched
in class AbstractMixCascadeContainer
isReconnectedAutomatically
public abstract boolean isReconnectedAutomatically()
- Specified by:
isReconnectedAutomatically
in interface IServiceContainer
- Specified by:
isReconnectedAutomatically
in class AbstractMixCascadeContainer
isPaidServiceAllowed
public abstract boolean isPaidServiceAllowed()
isSuitableCascade
private final boolean isSuitableCascade(MixCascade a_cascade)
getCurrentCascade
public final MixCascade getCurrentCascade()
- Description copied from class:
AbstractMixCascadeContainer
- Returns the last return value of getNextCascade().
- Specified by:
getCurrentCascade
in class AbstractMixCascadeContainer
- Returns:
- the last return value of getNextCascade() (may be null if no call has been
done yet)
setCurrentCascade
public final boolean setCurrentCascade(MixCascade a_cascade)
keepCurrentService
public final void keepCurrentService(boolean a_bKeepCurrentCascade)
- Description copied from class:
AbstractMixCascadeContainer
- Optional method that should allow to return the last MixCascade (Service) that was returned
by getNextService() also the next time this method is called.
- Specified by:
keepCurrentService
in interface IServiceContainer
- Specified by:
keepCurrentService
in class AbstractMixCascadeContainer
- Parameters:
a_bKeepCurrentCascade
- allows or dissallows to keep the current cascade for the next call
checkTrust
public final void checkTrust(MixCascade a_cascade)
throws TrustException,
java.security.SignatureException
- Specified by:
checkTrust
in interface ITrustModel
- Overrides:
checkTrust
in class BasicTrustModel
- Throws:
TrustException
java.security.SignatureException