Package com.biglybt.core.history.impl
Class DownloadHistoryManagerImpl
java.lang.Object
com.biglybt.core.history.impl.DownloadHistoryManagerImpl
- All Implemented Interfaces:
DownloadHistoryManager
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private class
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) int
private long
private static final String
private static final String
private static final String
private static final String
private static final String
private final Core
private ByteArrayHashMap
<long[]> private long
private int
(package private) int
private long
(package private) boolean
private boolean
private final ListenerManager
<DownloadHistoryListener> (package private) final Object
private AtomicInteger
private static String[]
private static final Object
private static final TagManager
private static final int
private static final int
private static final int
(package private) TimerEvent
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(DownloadHistoryListener listener, boolean fire_for_existing) (package private) void
private void
(package private) Map
<Long, DownloadHistoryManagerImpl.DownloadHistoryImpl> long[]
getDates
(byte[] hash, boolean with_redownload) private ByteArrayHashMap
<long[]> (package private) Map
<Long, DownloadHistoryManagerImpl.DownloadHistoryImpl> int
(package private) static long
(package private) void
historyUpdated
(DownloadHistory dh, int action, int type) private void
historyUpdated
(Collection<DownloadHistory> list, int action, int type) boolean
(package private) boolean
loadHistory
(String file) void
removeHistory
(List<DownloadHistory> to_remove) void
removeListener
(DownloadHistoryListener listener) void
private void
saveHistory
(String file, Map<Long, DownloadHistoryManagerImpl.DownloadHistoryImpl> records) searchHistory
(Map<String, Object> search_parameters, SearchObserver observer) void
setEnabled
(boolean enabled) (package private) void
setEnabledSupport
(boolean b, boolean startup) (package private) void
private void
syncFromExisting
(GlobalManager global_manager) (package private) void
-
Field Details
-
CONFIG_ENABLED
- See Also:
-
CONFIG_ACTIVE_FILE
- See Also:
-
CONFIG_DEAD_FILE
- See Also:
-
CONFIG_ACTIVE_SIZE
- See Also:
-
CONFIG_DEAD_SIZE
- See Also:
-
UPDATE_TYPE_ACTIVE
private static final int UPDATE_TYPE_ACTIVE- See Also:
-
UPDATE_TYPE_DEAD
private static final int UPDATE_TYPE_DEAD- See Also:
-
UPDATE_TYPE_BOTH
private static final int UPDATE_TYPE_BOTH- See Also:
-
TAG_CACHE_KEY
-
core
-
tag_manager
-
listeners
-
lock
-
mutation_count
-
history_active
-
history_dead
-
active_history_size
volatile int active_history_size -
dead_history_size
volatile int dead_history_size -
active_dirty
-
dead_dirty
-
write_pending_event
TimerEvent write_pending_event -
active_load_time
private long active_load_time -
dead_load_time
private long dead_load_time -
history_escaped
private boolean history_escaped -
redownload_cache
-
dates_cache
-
dates_cache_mutation_count
private volatile int dates_cache_mutation_count -
dates_cache_last_access
private volatile long dates_cache_last_access -
enabled
boolean enabled -
NO_TAGS
-
-
Constructor Details
-
DownloadHistoryManagerImpl
public DownloadHistoryManagerImpl()
-
-
Method Details
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceDownloadHistoryManager
-
setEnabled
public void setEnabled(boolean enabled) - Specified by:
setEnabled
in interfaceDownloadHistoryManager
-
setEnabledSupport
void setEnabledSupport(boolean b, boolean startup) -
isMonitored
-
syncFromExisting
-
getHistory
- Specified by:
getHistory
in interfaceDownloadHistoryManager
-
getHistoryCount
public int getHistoryCount()- Specified by:
getHistoryCount
in interfaceDownloadHistoryManager
-
removeHistory
- Specified by:
removeHistory
in interfaceDownloadHistoryManager
-
clearHistory
private void clearHistory() -
resetHistory
public void resetHistory()- Specified by:
resetHistory
in interfaceDownloadHistoryManager
-
getDates
public long[] getDates(byte[] hash, boolean with_redownload) - Specified by:
getDates
in interfaceDownloadHistoryManager
- Returns:
- [ added, completed, removed, redownloaded (transient)]
-
getDatesCache
-
setRedownloading
-
getUID
-
addListener
- Specified by:
addListener
in interfaceDownloadHistoryManager
-
removeListener
- Specified by:
removeListener
in interfaceDownloadHistoryManager
-
getActiveHistory
Map<Long,DownloadHistoryManagerImpl.DownloadHistoryImpl> getActiveHistory() -
getDeadHistory
Map<Long,DownloadHistoryManagerImpl.DownloadHistoryImpl> getDeadHistory() -
historyUpdated
-
historyUpdated
-
checkDiscard
void checkDiscard() -
writeHistory
void writeHistory() -
loadHistory
-
saveHistory
private void saveHistory(String file, Map<Long, DownloadHistoryManagerImpl.DownloadHistoryImpl> records) -
searchHistory
public SearchInstance searchHistory(Map<String, Object> search_parameters, SearchObserver observer) throws SearchException- Throws:
SearchException
-