Package com.biglybt.core.subs.impl
Class SubscriptionHistoryImpl
- java.lang.Object
-
- com.biglybt.core.subs.impl.SubscriptionHistoryImpl
-
- All Implemented Interfaces:
SubscriptionHistory
public class SubscriptionHistoryImpl extends java.lang.Object implements SubscriptionHistory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SubscriptionHistoryImpl.ActivityCallback
-
Field Summary
Fields Modifier and Type Field Description private boolean
auth_failed
private boolean
auto_dl
private boolean
auto_dl_supported
private int
consec_fails
private static AsyncDispatcher
dispatcher
private boolean
dl_with_ref
private boolean
enabled
private int
interval_override
private java.lang.String
last_error
private long
last_new_result
private long
last_scan
private SubscriptionManagerImpl
manager
private long
max_age_secs
private long
max_results
private java.lang.String[]
networks
private int
num_read
private int
num_unread
private boolean
post_notifications
private SubscriptionImpl
subs
-
Fields inherited from interface com.biglybt.core.subs.SubscriptionHistory
DEFAULT_CHECK_INTERVAL_MINS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SubscriptionHistoryImpl(SubscriptionManagerImpl _manager, SubscriptionImpl _subs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkMaxResults(int max_results)
void
deleteAllResults()
void
deleteResults(java.lang.String[] result_ids)
protected void
downloadNow()
int
getCheckFrequencyMins()
int
getConsecFails()
java.lang.String[]
getDownloadNetworks()
boolean
getDownloadWithReferer()
java.lang.String
getLastError()
long
getLastNewResultTime()
long
getLastScanTime()
long
getMaxAgeSecs()
int
getMaxNonDeletedResults()
long
getNextScanTime()
boolean
getNotificationPostEnabled()
int
getNumRead()
int
getNumUnread()
SubscriptionResult
getResult(java.lang.String result_id)
SubscriptionResult[]
getResults(boolean include_deleted)
protected java.lang.String
getString()
boolean
isAuthFail()
boolean
isAutoDownload()
protected boolean
isAutoDownloadSupported()
boolean
isEnabled()
protected void
loadConfig()
protected void
log(java.lang.String str)
protected void
log(java.lang.String str, java.lang.Throwable e)
void
markAllResultsRead()
void
markAllResultsUnread()
void
markResults(java.lang.String[] result_ids, boolean[] reads)
protected SubscriptionResultImpl[]
reconcileResults(Engine engine, SubscriptionResultImpl[] latest_results)
void
reset()
protected void
saveConfig(int reason)
void
setAutoDownload(boolean _auto_dl)
void
setCheckFrequencyMins(int mins)
void
setDetails(boolean _enabled, boolean _auto_dl)
void
setDownloadNetworks(java.lang.String[] nets)
void
setDownloadWithReferer(boolean b)
void
setEnabled(boolean _enabled)
protected void
setFatalError(java.lang.String _error)
protected void
setLastError(java.lang.String _last_error, boolean _auth_failed)
void
setMaxAgeSecs(long max)
void
setMaxNonDeletedResults(int _max_results)
void
setNotificationPostEnabled(boolean enabled)
protected void
updateReadUnread(SubscriptionResultImpl[] results)
protected void
updateResult(SubscriptionResultImpl result)
-
-
-
Field Detail
-
dispatcher
private static AsyncDispatcher dispatcher
-
manager
private final SubscriptionManagerImpl manager
-
subs
private final SubscriptionImpl subs
-
enabled
private boolean enabled
-
auto_dl
private boolean auto_dl
-
post_notifications
private boolean post_notifications
-
last_scan
private long last_scan
-
last_new_result
private long last_new_result
-
num_unread
private int num_unread
-
num_read
private int num_read
-
max_results
private long max_results
-
networks
private java.lang.String[] networks
-
max_age_secs
private long max_age_secs
-
last_error
private java.lang.String last_error
-
auth_failed
private boolean auth_failed
-
consec_fails
private int consec_fails
-
auto_dl_supported
private boolean auto_dl_supported
-
dl_with_ref
private boolean dl_with_ref
-
interval_override
private int interval_override
-
-
Constructor Detail
-
SubscriptionHistoryImpl
protected SubscriptionHistoryImpl(SubscriptionManagerImpl _manager, SubscriptionImpl _subs)
-
-
Method Detail
-
reconcileResults
protected SubscriptionResultImpl[] reconcileResults(Engine engine, SubscriptionResultImpl[] latest_results)
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interfaceSubscriptionHistory
-
setEnabled
public void setEnabled(boolean _enabled)
- Specified by:
setEnabled
in interfaceSubscriptionHistory
-
isAutoDownload
public boolean isAutoDownload()
- Specified by:
isAutoDownload
in interfaceSubscriptionHistory
-
setAutoDownload
public void setAutoDownload(boolean _auto_dl)
- Specified by:
setAutoDownload
in interfaceSubscriptionHistory
-
getMaxNonDeletedResults
public int getMaxNonDeletedResults()
- Specified by:
getMaxNonDeletedResults
in interfaceSubscriptionHistory
-
setMaxNonDeletedResults
public void setMaxNonDeletedResults(int _max_results)
- Specified by:
setMaxNonDeletedResults
in interfaceSubscriptionHistory
-
getDownloadNetworks
public java.lang.String[] getDownloadNetworks()
- Specified by:
getDownloadNetworks
in interfaceSubscriptionHistory
-
setDownloadNetworks
public void setDownloadNetworks(java.lang.String[] nets)
- Specified by:
setDownloadNetworks
in interfaceSubscriptionHistory
-
getMaxAgeSecs
public long getMaxAgeSecs()
- Specified by:
getMaxAgeSecs
in interfaceSubscriptionHistory
-
setMaxAgeSecs
public void setMaxAgeSecs(long max)
- Specified by:
setMaxAgeSecs
in interfaceSubscriptionHistory
-
getNotificationPostEnabled
public boolean getNotificationPostEnabled()
- Specified by:
getNotificationPostEnabled
in interfaceSubscriptionHistory
-
setNotificationPostEnabled
public void setNotificationPostEnabled(boolean enabled)
- Specified by:
setNotificationPostEnabled
in interfaceSubscriptionHistory
-
setDetails
public void setDetails(boolean _enabled, boolean _auto_dl)
- Specified by:
setDetails
in interfaceSubscriptionHistory
-
downloadNow
protected void downloadNow()
-
getLastScanTime
public long getLastScanTime()
- Specified by:
getLastScanTime
in interfaceSubscriptionHistory
-
getLastNewResultTime
public long getLastNewResultTime()
- Specified by:
getLastNewResultTime
in interfaceSubscriptionHistory
-
getNextScanTime
public long getNextScanTime()
- Specified by:
getNextScanTime
in interfaceSubscriptionHistory
-
getCheckFrequencyMins
public int getCheckFrequencyMins()
- Specified by:
getCheckFrequencyMins
in interfaceSubscriptionHistory
-
setCheckFrequencyMins
public void setCheckFrequencyMins(int mins)
- Specified by:
setCheckFrequencyMins
in interfaceSubscriptionHistory
-
getNumUnread
public int getNumUnread()
- Specified by:
getNumUnread
in interfaceSubscriptionHistory
-
getNumRead
public int getNumRead()
- Specified by:
getNumRead
in interfaceSubscriptionHistory
-
getResults
public SubscriptionResult[] getResults(boolean include_deleted)
- Specified by:
getResults
in interfaceSubscriptionHistory
-
getResult
public SubscriptionResult getResult(java.lang.String result_id)
- Specified by:
getResult
in interfaceSubscriptionHistory
-
updateResult
protected void updateResult(SubscriptionResultImpl result)
-
deleteResults
public void deleteResults(java.lang.String[] result_ids)
- Specified by:
deleteResults
in interfaceSubscriptionHistory
-
deleteAllResults
public void deleteAllResults()
- Specified by:
deleteAllResults
in interfaceSubscriptionHistory
-
markAllResultsRead
public void markAllResultsRead()
- Specified by:
markAllResultsRead
in interfaceSubscriptionHistory
-
markAllResultsUnread
public void markAllResultsUnread()
- Specified by:
markAllResultsUnread
in interfaceSubscriptionHistory
-
markResults
public void markResults(java.lang.String[] result_ids, boolean[] reads)
- Specified by:
markResults
in interfaceSubscriptionHistory
-
reset
public void reset()
- Specified by:
reset
in interfaceSubscriptionHistory
-
checkMaxResults
protected void checkMaxResults(int max_results)
-
updateReadUnread
protected void updateReadUnread(SubscriptionResultImpl[] results)
-
isAutoDownloadSupported
protected boolean isAutoDownloadSupported()
-
setFatalError
protected void setFatalError(java.lang.String _error)
-
setLastError
protected void setLastError(java.lang.String _last_error, boolean _auth_failed)
-
getLastError
public java.lang.String getLastError()
- Specified by:
getLastError
in interfaceSubscriptionHistory
-
isAuthFail
public boolean isAuthFail()
- Specified by:
isAuthFail
in interfaceSubscriptionHistory
-
getConsecFails
public int getConsecFails()
- Specified by:
getConsecFails
in interfaceSubscriptionHistory
-
getDownloadWithReferer
public boolean getDownloadWithReferer()
- Specified by:
getDownloadWithReferer
in interfaceSubscriptionHistory
-
setDownloadWithReferer
public void setDownloadWithReferer(boolean b)
- Specified by:
setDownloadWithReferer
in interfaceSubscriptionHistory
-
loadConfig
protected void loadConfig()
-
saveConfig
protected void saveConfig(int reason)
-
log
protected void log(java.lang.String str)
-
log
protected void log(java.lang.String str, java.lang.Throwable e)
-
getString
protected java.lang.String getString()
-
-