anon.infoservice.update
Class AbstractDatabaseUpdater
java.lang.Object
anon.util.Updater
anon.infoservice.update.AbstractDatabaseUpdater
- All Implemented Interfaces:
- java.util.Observer
- Direct Known Subclasses:
- AbstractMixCascadeUpdater, InfoServiceUpdater, JAPFeedback, JavaVersionUpdater, MessageUpdater, MinVersionUpdater, PaymentInstanceUpdater, PerformanceInfoUpdater, TermsAndConditionsUpdater
public abstract class AbstractDatabaseUpdater
- extends Updater
Updates the local database. This may be done automatically (by a background thread) and manually
by method call. The automatic update is only done if this is allowed by the model.
- Author:
- Rolf Wendolsky
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KEEP_ENTRY_FACTOR
public static final long KEEP_ENTRY_FACTOR
- Keep all entries KEEP_ENTRY_FACTOR times of the update interval, even if the InfoService
does not hold this object any longer. If the update interval is 5 minutes, for example,
each entry read into the JAP database is kept for at least 15 minutes before it is deleted (if
the database does not delete it before).
- See Also:
- Constant Field Values
m_successfulUpdate
private boolean m_successfulUpdate
m_bFirstUpdateDone
private boolean m_bFirstUpdateDone
AbstractDatabaseUpdater
public AbstractDatabaseUpdater(long a_updateInterval,
Updater.ObservableInfo a_observableInfo)
- Initialises and starts the database update thread.
AbstractDatabaseUpdater
public AbstractDatabaseUpdater(Updater.IUpdateInterval a_updateInterval,
Updater.ObservableInfo a_observableInfo)
- Initialises and starts the database update thread.
updateInternal
protected void updateInternal()
- Does the update. Subclasses may overwrite to, for example, synchronize the update with another object.
- Specified by:
updateInternal
in class Updater
wasUpdateSuccessful
protected boolean wasUpdateSuccessful()
- Specified by:
wasUpdateSuccessful
in class Updater
doCleanup
protected boolean doCleanup(java.util.Hashtable a_newEntries)
- Does some cleanup operations of the database. All old entries that were not updated by
the new entries are removed. Subclasses may overwrite this method to suppress or alter this
behavior. This method is called by updateInternal().
- Parameters:
a_newEntries
- the list of new entries
- Returns:
- boolean
isFirstUpdateDone
public final boolean isFirstUpdateDone()
- Specified by:
isFirstUpdateDone
in class Updater
protectFromCleanup
protected boolean protectFromCleanup(AbstractDatabaseEntry a_currentEntry)
getPreferredEntry
protected AbstractDatabaseEntry getPreferredEntry()
setPreferredEntry
protected void setPreferredEntry(AbstractDatabaseEntry a_preferredEntry)
getEntrySerials
protected abstract java.util.Hashtable getEntrySerials()
getUpdatedEntries
protected abstract java.util.Hashtable getUpdatedEntries(java.util.Hashtable a_entriesToUpdate)