Package com.biglybt.core.subs.impl
Class SubscriptionManagerImpl
java.lang.Object
com.biglybt.core.subs.impl.SubscriptionManagerImpl
- All Implemented Interfaces:
SubscriptionManager
,AEDiagnosticsEvidenceGenerator
,DataSourceResolver.DataSourceImporter
,UtilitiesImpl.PluginSubscriptionManager
public class SubscriptionManagerImpl
extends Object
implements SubscriptionManager, DataSourceResolver.DataSourceImporter, AEDiagnosticsEvidenceGenerator
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interface
(package private) static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
private static final int
private static final int
private AsyncDispatcher
private LinkedList<BuddyPluginBeta.ChatInstance>
private static final int
private static final int
private AsyncDispatcher
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private boolean
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private Core
private static final int
private DHTPluginInterface
private Pattern
private Map<String,
AtomicInteger> private boolean
private SubscriptionImpl
private static final AtomicInteger
private static final Object
private static AsyncDispatcher
private AEDiagnosticsLogger
private static final String
private boolean
private boolean
private Map<HashWrapper,
Object[]> private Map<HashWrapper,
Object[]> private static boolean
private int
private static final int
private static final int
private int
private boolean
private boolean
private static final int
private Map<SubscriptionImpl,
Object[]> private static AsyncDispatcher
private SubscriptionRSSFeed
private SubscriptionSchedulerImpl
private static final int
private static final int
private static final int
private static final int
private static final int
private static SubscriptionManagerImpl
private static final Object
private static final Object
private boolean
private static final Object
private CopyOnWriteMap<String,
SubscriptionImpl> private TorrentAttribute
private TorrentAttribute
private TorrentAttribute
private TorrentAttribute
private TorrentAttribute
private static final int
private static final int
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(SubscriptionManagerListener listener) protected void
protected void
addPotentialAssociation
(SubscriptionImpl subs, String result_id, String key) protected void
addPrepareTrigger
(byte[] hash, Subscription[] subs, SubscriptionResult[] results) protected SubscriptionImpl
protected boolean
askIfCanUpgrade
(SubscriptionImpl subs, int new_version) protected void
associationAdded
(SubscriptionImpl subscription, byte[] association_hash) protected void
private void
assocOK
(SubscriptionImpl subs, SubscriptionImpl.association assoc) protected void
changeSubscription
(SubscriptionImpl subs, int reason) private void
protected void
protected void
checkMaxResults
(int max) protected void
checkPotentialAssociations
(byte[] hash, String key) protected void
checkServerPublications
(List subs) protected void
protected void
checkStuff
(int ticks) protected void
protected void
protected void
protected void
configDirty
(SubscriptionImpl subs, int reason) createFromURI
(String uri) createSingletonRSS
(String name, URL url, int check_interval_mins, boolean is_anon) protected SubscriptionImpl
createSingletonRSSSupport
(String name, URL url, boolean is_public, int check_interval_mins, boolean is_anon, int add_type, boolean subscribe) protected SubscriptionImpl
createSingletonSubscription
(Map singleton_details, int add_type, boolean subscribe) protected Map
decodeSubscriptionDetails
(byte[] data) private boolean
downloadIsIgnored
(Download download) private void
downloadSubscription
(String description, byte[] association_hash, byte[] torrent_hash, byte[] sid, int version, int size, SubscriptionManagerImpl.subsLookupListener listener) private void
downloadSubscription
(String description, TOTorrent torrent, InetSocketAddress peer, byte[] subs_id, int version, String name, SubscriptionManagerImpl.downloadListener listener) protected Object[]
downloadTorrent
(byte[] hash, int update_size) protected byte[]
protected void
evalScript
(SubscriptionImpl subs, String script, List<SubscriptionResultImpl> subs_results, String intent_key) void
generate
(IndentWriter writer) boolean
boolean
int
boolean
int
int
int
protected Engine
getEngine
(SubscriptionImpl subs, Map json_map, boolean local_only) private SubscriptionImpl
getGMAR
(boolean create_if_missing) private byte[]
getKeyBytes
(String key) int
getKnownSubscriptions
(byte[] hash) Cached view of hash's subsgetLinkedSubscriptions
(byte[] hash) private AEDiagnosticsLogger
protected MagnetPlugin
boolean
int
protected void
getPopularity
(SubscriptionImpl subs, SubscriptionPopularityListener listener) protected void
getPopularityFromDHT
(SubscriptionImpl subs, SubscriptionPopularityListener listener, boolean sync) protected void
getPopularitySupport
(DHTPluginInterface dht_plugin, SubscriptionImpl subs, SubscriptionPopularityListener _listener, boolean sync) private int
protected File
protected Object[]
static SubscriptionManager
getSingleton
(boolean stand_alone) protected Map
getSingletonMap
(String name, URL url, boolean is_public, int check_interval_mins, boolean is_anon) int
getSubscriptionCount
(boolean subscribed_only) protected int
protected SubscriptionImpl
protected SubscriptionImpl
getSubscriptionFromPlatform
(byte[] sid, boolean is_anon, int add_type) protected SubscriptionImpl
getSubscriptionFromSID
(byte[] sid) protected SubscriptionImpl
getSubscriptionFromVuzeFile
(byte[] sid, int add_type, VuzeFile vf) protected SubscriptionImpl
getSubscriptionFromVuzeFile
(byte[] sid, int add_type, File file) protected SubscriptionImpl
getSubscriptionFromVuzeFileContent
(byte[] sid, int add_type, String content) getSubscriptions
(boolean subscribed_only) protected File
protected String
getUniqueName
(String name) protected File
getVuzeFile
(SubscriptionImpl subs) boolean
importDataSource
(Map<String, Object> map) importSubscription
(int type, Map map, boolean warn_user) protected void
protected void
initWithCore
(Core _core) protected boolean
boolean
boolean
boolean
boolean
protected boolean
isVisible
(SubscriptionImpl subs) private void
private void
protected LinkedHashMap<String,
SubscriptionResultImpl> loadResults
(SubscriptionImpl subs) void
void
protected void
lookupAssociations
(boolean high_priority) lookupAssociations
(byte[] hash, SubscriptionLookupListener listener) lookupAssociations
(byte[] hash, String description, SubscriptionLookupListener listener) Full lookuplookupAssociations
(byte[] hash, String description, String[] networks, SubscriptionLookupListener listener) private SubscriptionAssociationLookup
lookupAssociations
(DHTPluginInterface dht_plugin, byte[] hash, String description, SubscriptionLookupListener listener) protected SubscriptionAssociationLookup
lookupAssociationsSupport
(DHTPluginInterface dht_plugin, byte[] hash, String description, SubscriptionLookupListener _listener) protected SubscriptionImpl
lookupSingletonRSS
(String name, URL url, boolean is_public, int check_interval_mins, boolean is_anon) private void
lookupSubscription
(String description, byte[] association_hash, byte[] sid, int version, boolean is_anon, SubscriptionManagerImpl.subsLookupListener listener) void
markReadInAllSubscriptions
(SearchSubsResultBase[] results) private List<SubscriptionResult>
matchSubscriptionResults
(SearchMatcher matcher) static void
protected void
prepareDownload
(Download download, Subscription[] subscriptions, SubscriptionResult[] results) private void
processResults
(SubscriptionImpl subs, Collection<SubscriptionResultImpl> results, boolean has_new_results) private void
private boolean
private void
protected void
protected void
protected void
recordAssociations
(byte[] association_hash, SubscriptionImpl[] subscriptions, boolean full_lookup) protected boolean
recordAssociationsSupport
(byte[] association_hash, SubscriptionImpl[] subscriptions, boolean full_lookup) protected boolean
recoverSubscriptionUpdate
(Download download, Map rd) protected void
removeDownload
(Download download, boolean remove_data) void
removeListener
(SubscriptionManagerListener listener) protected void
removePrepareTrigger
(byte[] hash) protected void
void
requestSubscription
(SearchProvider sp, Map<String, Object> search_parameters) void
requestSubscription
(URL url, Map<String, Object> options) protected void
protected void
saveResults
(SubscriptionImpl subs, SubscriptionResultImpl[] results, List<SubscriptionResultImpl> new_unread_results) searchSubscriptions
(Map<String, Object> search_parameters, SearchObserver observer) private void
searchTemplateOK
(SubscriptionImpl subs, Download download) private DHTPluginInterface
private DHTPluginInterface
selectDHTPlugin
(Download download) private DHTPluginInterface
selectDHTPlugin
(String[] networks) protected void
void
setActivateSubscriptionOnChange
(boolean b) void
setAddHashDirs
(boolean b) void
setAutoDownloadMarkReadAfterDays
(int days) void
setAutoStartDownloads
(boolean auto_start) void
setAutoStartMaxMB
(int mb) void
setAutoStartMinMB
(int mb) protected void
setCategoryOnExisting
(SubscriptionImpl subscription, String old_category, String new_category) void
setDefaultCheckFrequencyMins
(int def) void
setMarkResultsInLibraryRead
(boolean b) void
setMaxNonDeletedResults
(int max) void
setRateLimits
(String limits) void
setRSSPublishEnabled
(boolean enabled) void
setSearchEnabled
(boolean enabled) protected void
protected void
setSelected
(List subs) void
setSubsDownloadEnabled
(boolean enabled) protected boolean
shouldAutoStart
(Torrent torrent) subscribeToRSS
(String name, URL url, int interval, boolean is_public, String creator_ref) protected boolean
subscriptionExists
(Download download, SubscriptionImpl subs) protected void
protected void
protected void
updatePopularityFromDHT
(SubscriptionImpl subs, boolean sync) protected void
protected void
updateSubscription
(SubscriptionImpl subs, int new_version) protected void
updateSubscription
(SubscriptionImpl subs, int update_version, byte[] update_hash, int update_size) protected void
updateSubscription
(SubscriptionImpl subs, int new_version, TOTorrent torrent, InetSocketAddress peer) protected void
updateSubscription
(SubscriptionImpl subs, Download download, File torrent_file, File data_file) protected void
updateSubscription
(SubscriptionImpl subs, File data_location) private void
waitForChat
(BuddyPluginBeta.ChatInstance chat, AERunnable runnable)
-
Field Details
-
CONFIG_FILE
- See Also:
-
LOGGER_NAME
- See Also:
-
CONFIG_DEF_CHECK_MINS
- See Also:
-
CONFIG_MAX_RESULTS
- See Also:
-
CONFIG_AUTO_START_DLS
- See Also:
-
CONFIG_AUTO_START_MIN_MB
- See Also:
-
CONFIG_AUTO_START_MAX_MB
- See Also:
-
CONFIG_AUTO_MARK_READ
- See Also:
-
CONFIG_ADD_HASHES
- See Also:
-
CONFIG_RSS_ENABLE
- See Also:
-
CONFIG_ENABLE_SEARCH
- See Also:
-
CONFIG_HIDE_SEARCH_TEMPLATES
- See Also:
-
CONFIG_DL_SUBS_ENABLE
- See Also:
-
CONFIG_DL_RATE_LIMITS
- See Also:
-
CONFIG_ACTIVATE_ON_CHANGE
- See Also:
-
CONFIG_MARK_LIB_RESULTS_READ
- See Also:
-
DELETE_UNUSED_AFTER_MILLIS
private static final int DELETE_UNUSED_AFTER_MILLIS- See Also:
-
PUB_ASSOC_CONC_MAX
private static final int PUB_ASSOC_CONC_MAX -
PUB_SLEEPING_ASSOC_CONC_MAX
private static final int PUB_SLEEPING_ASSOC_CONC_MAX- See Also:
-
singleton
-
pre_initialised
private static boolean pre_initialised -
random_seed
private static final int random_seed -
started
private boolean started -
TIMER_PERIOD
private static final int TIMER_PERIOD- See Also:
-
ASSOC_CHECK_PERIOD
private static final int ASSOC_CHECK_PERIOD- See Also:
-
ASSOC_CHECK_TICKS
private static final int ASSOC_CHECK_TICKS- See Also:
-
ASSOC_PUBLISH_PERIOD
private static final int ASSOC_PUBLISH_PERIOD- See Also:
-
ASSOC_PUBLISH_TICKS
private static final int ASSOC_PUBLISH_TICKS- See Also:
-
CHAT_CHECK_PERIOD
private static final int CHAT_CHECK_PERIOD- See Also:
-
CHAT_CHECK_TICKS
private static final int CHAT_CHECK_TICKS- See Also:
-
SERVER_PUB_CHECK_PERIOD
private static final int SERVER_PUB_CHECK_PERIOD- See Also:
-
SERVER_PUB_CHECK_TICKS
private static final int SERVER_PUB_CHECK_TICKS- See Also:
-
TIDY_POT_ASSOC_PERIOD
private static final int TIDY_POT_ASSOC_PERIOD- See Also:
-
TIDY_POT_ASSOC_TICKS
private static final int TIDY_POT_ASSOC_TICKS- See Also:
-
SET_SELECTED_PERIOD
private static final int SET_SELECTED_PERIOD- See Also:
-
SET_SELECTED_FIRST_TICK
private static final int SET_SELECTED_FIRST_TICK- See Also:
-
SET_SELECTED_TICKS
private static final int SET_SELECTED_TICKS- See Also:
-
SP_LAST_ATTEMPTED
-
SP_CONSEC_FAIL
-
core
-
dht_plugin_public
-
subscription_map
-
config_dirty
private boolean config_dirty -
publish_associations_active
private int publish_associations_active -
publish_next_asyc_pending
private boolean publish_next_asyc_pending -
publish_subscription_active
private boolean publish_subscription_active -
ta_subs_download
-
ta_subs_download_rd
-
ta_subscription_info
-
ta_category
-
ta_networks
-
periodic_lookup_in_progress
private boolean periodic_lookup_in_progress -
priority_lookup_pending
private int priority_lookup_pending -
listeners
-
scheduler
-
potential_associations
-
potential_associations2
-
potential_associations3
-
meta_search_listener_added
private boolean meta_search_listener_added -
exclusion_pattern
-
rss_publisher
-
logger
-
result_cache
-
async_dispatcher
-
SUBS_CHAT_KEY
-
imported_sids
-
chat_write_dispatcher
-
chat_st_done
-
chat_assoc_done
-
LIB_MUTATION_KEY
-
lib_mutation_count
-
library_checker
-
result_exec
-
js_plugin_install_tried
private boolean js_plugin_install_tried -
last_gmar
-
gmar_cache
-
-
Constructor Details
-
SubscriptionManagerImpl
protected SubscriptionManagerImpl(boolean stand_alone)
-
-
Method Details
-
preInitialise
public static void preInitialise() -
getSingleton
-
initialise
protected void initialise() -
initWithCore
-
isClosing
protected boolean isClosing() -
getSearchTemplateVuzeFile
-
isSearchTemplateImportable
-
searchSubscriptions
public SearchInstance searchSubscriptions(Map<String, Object> search_parameters, SearchObserver observer) throws SearchException- Throws:
SearchException
-
matchSubscriptionResults
-
checkMaxResults
protected void checkMaxResults(int max) -
getScheduler
- Specified by:
getScheduler
in interfaceSubscriptionManager
-
isRSSPublishEnabled
public boolean isRSSPublishEnabled()- Specified by:
isRSSPublishEnabled
in interfaceSubscriptionManager
-
setRSSPublishEnabled
public void setRSSPublishEnabled(boolean enabled) - Specified by:
setRSSPublishEnabled
in interfaceSubscriptionManager
-
isSearchEnabled
public boolean isSearchEnabled()- Specified by:
isSearchEnabled
in interfaceSubscriptionManager
-
setSearchEnabled
public void setSearchEnabled(boolean enabled) - Specified by:
setSearchEnabled
in interfaceSubscriptionManager
-
hideSearchTemplates
public boolean hideSearchTemplates()- Specified by:
hideSearchTemplates
in interfaceSubscriptionManager
-
isSubsDownloadEnabled
public boolean isSubsDownloadEnabled()- Specified by:
isSubsDownloadEnabled
in interfaceSubscriptionManager
-
setSubsDownloadEnabled
public void setSubsDownloadEnabled(boolean enabled) - Specified by:
setSubsDownloadEnabled
in interfaceSubscriptionManager
-
setRateLimits
- Specified by:
setRateLimits
in interfaceSubscriptionManager
-
getRateLimits
- Specified by:
getRateLimits
in interfaceSubscriptionManager
-
setActivateSubscriptionOnChange
public void setActivateSubscriptionOnChange(boolean b) - Specified by:
setActivateSubscriptionOnChange
in interfaceSubscriptionManager
-
getActivateSubscriptionOnChange
public boolean getActivateSubscriptionOnChange()- Specified by:
getActivateSubscriptionOnChange
in interfaceSubscriptionManager
-
setMarkResultsInLibraryRead
public void setMarkResultsInLibraryRead(boolean b) - Specified by:
setMarkResultsInLibraryRead
in interfaceSubscriptionManager
-
getMarkResultsInLibraryRead
public boolean getMarkResultsInLibraryRead()- Specified by:
getMarkResultsInLibraryRead
in interfaceSubscriptionManager
-
getRSSLink
- Specified by:
getRSSLink
in interfaceSubscriptionManager
-
create
public Subscription create(String name, boolean public_subs, String json) throws SubscriptionException - Specified by:
create
in interfaceSubscriptionManager
- Throws:
SubscriptionException
-
createSingletonRSS
public SubscriptionImpl createSingletonRSS(String name, URL url, int check_interval_mins, boolean is_anon) throws SubscriptionException - Specified by:
createSingletonRSS
in interfaceSubscriptionManager
- Throws:
SubscriptionException
-
createFromURI
- Specified by:
createFromURI
in interfaceSubscriptionManager
- Throws:
SubscriptionException
-
lookupSingletonRSS
protected SubscriptionImpl lookupSingletonRSS(String name, URL url, boolean is_public, int check_interval_mins, boolean is_anon) throws SubscriptionException - Throws:
SubscriptionException
-
createSingletonRSSSupport
protected SubscriptionImpl createSingletonRSSSupport(String name, URL url, boolean is_public, int check_interval_mins, boolean is_anon, int add_type, boolean subscribe) throws SubscriptionException - Throws:
SubscriptionException
-
getUniqueName
-
getSingletonMap
protected Map getSingletonMap(String name, URL url, boolean is_public, int check_interval_mins, boolean is_anon) throws SubscriptionException - Throws:
SubscriptionException
-
createSingletonSubscription
protected SubscriptionImpl createSingletonSubscription(Map singleton_details, int add_type, boolean subscribe) throws SubscriptionException - Throws:
SubscriptionException
-
requestSubscription
- Specified by:
requestSubscription
in interfaceUtilitiesImpl.PluginSubscriptionManager
-
requestSubscription
public void requestSubscription(SearchProvider sp, Map<String, Object> search_parameters) throws SubscriptionException- Specified by:
requestSubscription
in interfaceUtilitiesImpl.PluginSubscriptionManager
- Throws:
SubscriptionException
-
createRSS
public Subscription createRSS(String name, URL url, int check_interval_mins, Map user_data) throws SubscriptionException - Specified by:
createRSS
in interfaceSubscriptionManager
- Throws:
SubscriptionException
-
createRSS
public Subscription createRSS(String name, URL url, int check_interval_mins, boolean is_anonymous, Map user_data) throws SubscriptionException - Specified by:
createRSS
in interfaceSubscriptionManager
- Throws:
SubscriptionException
-
createSubscriptionTemplate
- Specified by:
createSubscriptionTemplate
in interfaceSubscriptionManager
- Throws:
SubscriptionException
-
checkURL
- Throws:
SubscriptionException
-
addSubscription
-
addMetaSearchListener
protected void addMetaSearchListener() -
changeSubscription
-
selectSubscription
-
removeSubscription
-
updatePublicSubscription
-
checkSingletonPublish
- Throws:
SubscriptionException
-
checkServerPublications
-
checkStuff
protected void checkStuff(int ticks) -
importSubscription
public Subscription importSubscription(int type, Map map, boolean warn_user) throws SubscriptionException - Throws:
SubscriptionException
-
getSubscriptions
- Specified by:
getSubscriptions
in interfaceSubscriptionManager
-
getSubscriptions
- Specified by:
getSubscriptions
in interfaceSubscriptionManager
- Specified by:
getSubscriptions
in interfaceUtilitiesImpl.PluginSubscriptionManager
-
getSubscriptionCount
public int getSubscriptionCount(boolean subscribed_only) - Specified by:
getSubscriptionCount
in interfaceSubscriptionManager
-
getSubscriptionFromName
-
getSubscriptionByID
- Specified by:
getSubscriptionByID
in interfaceSubscriptionManager
-
importDataSource
- Specified by:
importDataSource
in interfaceDataSourceResolver.DataSourceImporter
-
getSubscriptionFromSID
-
getSubsDir
- Throws:
IOException
-
getVuzeFile
- Throws:
IOException
-
getResultsFile
- Throws:
IOException
-
getKnownSubscriptionCount
public int getKnownSubscriptionCount()- Specified by:
getKnownSubscriptionCount
in interfaceSubscriptionManager
-
getKnownSubscriptions
Description copied from interface:SubscriptionManager
Cached view of hash's subs- Specified by:
getKnownSubscriptions
in interfaceSubscriptionManager
- Returns:
-
subscriptionExists
-
downloadIsIgnored
-
isVisible
-
getLinkedSubscriptions
- Specified by:
getLinkedSubscriptions
in interfaceSubscriptionManager
-
lookupAssociations
protected void lookupAssociations(boolean high_priority) -
associationLookupComplete
protected void associationLookupComplete() -
setSelected
-
checkUpgrade
-
setSelected
-
checkInitialDownload
-
lookupAssociations
public SubscriptionAssociationLookup lookupAssociations(byte[] hash, String description, String[] networks, SubscriptionLookupListener listener) throws SubscriptionException - Specified by:
lookupAssociations
in interfaceSubscriptionManager
- Throws:
SubscriptionException
-
lookupAssociations
public SubscriptionAssociationLookup lookupAssociations(byte[] hash, SubscriptionLookupListener listener) throws SubscriptionException - Specified by:
lookupAssociations
in interfaceSubscriptionManager
- Returns:
- Throws:
SubscriptionException
-
lookupAssociations
public SubscriptionAssociationLookup lookupAssociations(byte[] hash, String description, SubscriptionLookupListener listener) throws SubscriptionException Description copied from interface:SubscriptionManager
Full lookup- Specified by:
lookupAssociations
in interfaceSubscriptionManager
- Returns:
- Throws:
SubscriptionException
-
lookupAssociations
private SubscriptionAssociationLookup lookupAssociations(DHTPluginInterface dht_plugin, byte[] hash, String description, SubscriptionLookupListener listener) throws SubscriptionException - Throws:
SubscriptionException
-
lookupAssociationsSupport
protected SubscriptionAssociationLookup lookupAssociationsSupport(DHTPluginInterface dht_plugin, byte[] hash, String description, SubscriptionLookupListener _listener) throws SubscriptionException - Throws:
SubscriptionException
-
getPopularity
protected void getPopularity(SubscriptionImpl subs, SubscriptionPopularityListener listener) throws SubscriptionException - Throws:
SubscriptionException
-
getPopularityFromDHT
protected void getPopularityFromDHT(SubscriptionImpl subs, SubscriptionPopularityListener listener, boolean sync) -
updatePopularityFromDHT
-
getPopularitySupport
protected void getPopularitySupport(DHTPluginInterface dht_plugin, SubscriptionImpl subs, SubscriptionPopularityListener _listener, boolean sync) -
lookupSubscription
private void lookupSubscription(String description, byte[] association_hash, byte[] sid, int version, boolean is_anon, SubscriptionManagerImpl.subsLookupListener listener) -
getSubscriptionFromPlatform
protected SubscriptionImpl getSubscriptionFromPlatform(byte[] sid, boolean is_anon, int add_type) throws SubscriptionException - Throws:
SubscriptionException
-
getSubscriptionFromVuzeFile
protected SubscriptionImpl getSubscriptionFromVuzeFile(byte[] sid, int add_type, File file) throws SubscriptionException - Throws:
SubscriptionException
-
getSubscriptionFromVuzeFileContent
protected SubscriptionImpl getSubscriptionFromVuzeFileContent(byte[] sid, int add_type, String content) throws SubscriptionException - Throws:
SubscriptionException
-
getSubscriptionFromVuzeFile
protected SubscriptionImpl getSubscriptionFromVuzeFile(byte[] sid, int add_type, VuzeFile vf) throws SubscriptionException - Throws:
SubscriptionException
-
downloadSubscription
private void downloadSubscription(String description, byte[] association_hash, byte[] torrent_hash, byte[] sid, int version, int size, SubscriptionManagerImpl.subsLookupListener listener) -
getSubscriptionDownloadCount
protected int getSubscriptionDownloadCount() -
associationAdded
-
addPotentialAssociation
-
checkPotentialAssociations
-
tidyPotentialAssociations
protected void tidyPotentialAssociations() -
recordAssociations
protected void recordAssociations(byte[] association_hash, SubscriptionImpl[] subscriptions, boolean full_lookup) -
addPrepareTrigger
-
removePrepareTrigger
protected void removePrepareTrigger(byte[] hash) -
prepareDownload
protected void prepareDownload(Download download, Subscription[] subscriptions, SubscriptionResult[] results) -
recordAssociationsSupport
protected boolean recordAssociationsSupport(byte[] association_hash, SubscriptionImpl[] subscriptions, boolean full_lookup) -
searchTemplateOK
-
assocOK
-
waitForChat
-
publishAssociations
private boolean publishAssociations() -
getPublishRemainingCount
private int getPublishRemainingCount() -
publishAssociation
-
publishNextAssociation
private void publishNextAssociation() -
subscriptionUpdated
protected void subscriptionUpdated() -
publishSubscriptions
protected void publishSubscriptions() -
publishSubscription
-
updateSubscription
-
encodeSubscriptionDetails
- Throws:
IOException
-
decodeSubscriptionDetails
- Throws:
IOException
-
updateSubscription
protected void updateSubscription(SubscriptionImpl subs, int update_version, byte[] update_hash, int update_size) -
downloadTorrent
-
downloadSubscription
private void downloadSubscription(String description, TOTorrent torrent, InetSocketAddress peer, byte[] subs_id, int version, String name, SubscriptionManagerImpl.downloadListener listener) -
updateSubscription
protected void updateSubscription(SubscriptionImpl subs, int new_version, TOTorrent torrent, InetSocketAddress peer) -
askIfCanUpgrade
-
recoverSubscriptionUpdate
-
updateSubscription
protected void updateSubscription(SubscriptionImpl subs, Download download, File torrent_file, File data_file) -
removeDownload
-
updateSubscription
-
getMagnetPlugin
-
getEngine
protected Engine getEngine(SubscriptionImpl subs, Map json_map, boolean local_only) throws SubscriptionException - Throws:
SubscriptionException
-
libraryMutated
private void libraryMutated() -
loadResults
-
setCategoryOnExisting
protected void setCategoryOnExisting(SubscriptionImpl subscription, String old_category, String new_category) -
getDefaultCheckFrequencyMins
public int getDefaultCheckFrequencyMins()- Specified by:
getDefaultCheckFrequencyMins
in interfaceSubscriptionManager
-
setDefaultCheckFrequencyMins
public void setDefaultCheckFrequencyMins(int def) - Specified by:
setDefaultCheckFrequencyMins
in interfaceSubscriptionManager
-
getMaxNonDeletedResults
public int getMaxNonDeletedResults()- Specified by:
getMaxNonDeletedResults
in interfaceSubscriptionManager
-
setMaxNonDeletedResults
public void setMaxNonDeletedResults(int max) - Specified by:
setMaxNonDeletedResults
in interfaceSubscriptionManager
-
getAutoStartDownloads
public boolean getAutoStartDownloads()- Specified by:
getAutoStartDownloads
in interfaceSubscriptionManager
-
setAutoStartDownloads
public void setAutoStartDownloads(boolean auto_start) - Specified by:
setAutoStartDownloads
in interfaceSubscriptionManager
-
getAutoStartMinMB
public int getAutoStartMinMB()- Specified by:
getAutoStartMinMB
in interfaceSubscriptionManager
-
setAutoStartMinMB
public void setAutoStartMinMB(int mb) - Specified by:
setAutoStartMinMB
in interfaceSubscriptionManager
-
getAutoStartMaxMB
public int getAutoStartMaxMB()- Specified by:
getAutoStartMaxMB
in interfaceSubscriptionManager
-
setAutoStartMaxMB
public void setAutoStartMaxMB(int mb) - Specified by:
setAutoStartMaxMB
in interfaceSubscriptionManager
-
getAutoDownloadMarkReadAfterDays
public int getAutoDownloadMarkReadAfterDays()- Specified by:
getAutoDownloadMarkReadAfterDays
in interfaceSubscriptionManager
-
setAutoDownloadMarkReadAfterDays
public void setAutoDownloadMarkReadAfterDays(int days) - Specified by:
setAutoDownloadMarkReadAfterDays
in interfaceSubscriptionManager
-
getAddHashDirs
public boolean getAddHashDirs()- Specified by:
getAddHashDirs
in interfaceSubscriptionManager
-
setAddHashDirs
public void setAddHashDirs(boolean b) - Specified by:
setAddHashDirs
in interfaceSubscriptionManager
-
shouldAutoStart
-
saveResults
protected void saveResults(SubscriptionImpl subs, SubscriptionResultImpl[] results, List<SubscriptionResultImpl> new_unread_results) -
processResults
private void processResults(SubscriptionImpl subs, Collection<SubscriptionResultImpl> results, boolean has_new_results) -
checkGloballyMarkedRead
-
evalScript
protected void evalScript(SubscriptionImpl subs, String script, List<SubscriptionResultImpl> subs_results, String intent_key) -
loadConfig
private void loadConfig() -
configDirty
-
configDirty
protected void configDirty() -
saveConfig
protected void saveConfig() -
getKeyBytes
-
getLogger
-
log
-
log
-
addListener
- Specified by:
addListener
in interfaceSubscriptionManager
-
removeListener
- Specified by:
removeListener
in interfaceSubscriptionManager
-
generate
- Specified by:
generate
in interfaceAEDiagnosticsEvidenceGenerator
-
selectDHTPlugin
-
selectDHTPlugin
-
selectDHTPlugin
-
subscribeToSubscription
- Specified by:
subscribeToSubscription
in interfaceSubscriptionManager
- Throws:
Exception
-
subscribeToRSS
public Subscription subscribeToRSS(String name, URL url, int interval, boolean is_public, String creator_ref) throws Exception - Specified by:
subscribeToRSS
in interfaceSubscriptionManager
- Throws:
Exception
-
getGMAR
-
markReadInAllSubscriptions
- Specified by:
markReadInAllSubscriptions
in interfaceSubscriptionManager
-