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 intprivate static final intprivate static final intprivate static final intprivate AsyncDispatcherprivate LinkedList<BuddyPluginBeta.ChatInstance> private static final intprivate static final intprivate AsyncDispatcherprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate AtomicBooleanprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate Coreprivate static final intprivate DHTPluginInterfaceprivate Patternprivate Map<String, AtomicInteger> private booleanprivate SubscriptionImplprivate static final AtomicIntegerprivate static final Objectprivate static AsyncDispatcherprivate AEDiagnosticsLoggerprivate static final Stringprivate booleanprivate booleanprivate Map<HashWrapper, Object[]> private Map<HashWrapper, Object[]> private static booleanprivate intprivate static final intprivate static final intprivate intprivate booleanprivate booleanprivate static final intprivate Map<SubscriptionImpl, Object[]> private static AsyncDispatcherprivate SubscriptionRSSFeedprivate SubscriptionSchedulerImplprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static SubscriptionManagerImplprivate static final Objectprivate static final Objectprivate booleanprivate static final Objectprivate CopyOnWriteMap<String, SubscriptionImpl> private TorrentAttributeprivate TorrentAttributeprivate TorrentAttributeprivate TorrentAttributeprivate TorrentAttributeprivate static final intprivate static final intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(SubscriptionManagerListener listener) protected voidprotected voidaddPotentialAssociation(SubscriptionImpl subs, String result_id, String key) protected voidaddPrepareTrigger(byte[] hash, Subscription[] subs, SubscriptionResult[] results) protected SubscriptionImplprotected booleanaskIfCanUpgrade(SubscriptionImpl subs, int new_version) protected voidassociationAdded(SubscriptionImpl subscription, byte[] association_hash) protected voidprivate voidassocOK(SubscriptionImpl subs, SubscriptionImpl.association assoc) protected voidchangeSubscription(SubscriptionImpl subs, int reason) private voidcheckGloballyMarkedRead(SubscriptionImpl subs, Collection<SubscriptionResultImpl> results) protected voidprotected voidcheckMaxResults(int max) protected voidcheckPotentialAssociations(byte[] hash, String key) protected voidcheckServerPublications(List subs) protected voidprotected voidcheckStuff(int ticks) protected voidprotected voidprotected voidprotected voidconfigDirty(SubscriptionImpl subs, int reason) createFromURI(String uri) createSingletonRSS(String name, URL url, int check_interval_mins, boolean is_anon) protected SubscriptionImplcreateSingletonRSSSupport(String name, URL url, boolean is_public, int check_interval_mins, boolean is_anon, int add_type, boolean subscribe) protected SubscriptionImplcreateSingletonSubscription(Map singleton_details, int add_type, boolean subscribe) protected MapdecodeSubscriptionDetails(byte[] data) private booleandownloadIsIgnored(Download download) private voiddownloadSubscription(String description, byte[] association_hash, byte[] torrent_hash, byte[] sid, int version, int size, SubscriptionManagerImpl.subsLookupListener listener) private voiddownloadSubscription(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 voidevalScript(SubscriptionImpl subs, String script, List<SubscriptionResultImpl> subs_results, String intent_key) voidgenerate(IndentWriter writer) booleanbooleanintbooleanintintintprotected EnginegetEngine(SubscriptionImpl subs, Map json_map, boolean local_only) private SubscriptionImplgetGMAR(boolean create_if_missing) private byte[]getKeyBytes(String key) intgetKnownSubscriptions(byte[] hash) Cached view of hash's subsgetLinkedSubscriptions(byte[] hash) private AEDiagnosticsLoggerprotected MagnetPluginbooleanintprotected voidgetPopularity(SubscriptionImpl subs, SubscriptionPopularityListener listener) protected voidgetPopularityFromDHT(SubscriptionImpl subs, SubscriptionPopularityListener listener, boolean sync) protected voidgetPopularitySupport(DHTPluginInterface dht_plugin, SubscriptionImpl subs, SubscriptionPopularityListener _listener, boolean sync) private intprotected Fileprotected Object[]static SubscriptionManagergetSingleton(boolean stand_alone) protected MapgetSingletonMap(String name, URL url, boolean is_public, int check_interval_mins, boolean is_anon) intgetSubscriptionCount(boolean subscribed_only) protected intprotected SubscriptionImplprotected SubscriptionImplgetSubscriptionFromPlatform(byte[] sid, boolean is_anon, int add_type) protected SubscriptionImplgetSubscriptionFromSID(byte[] sid) protected SubscriptionImplgetSubscriptionFromVuzeFile(byte[] sid, int add_type, VuzeFile vf) protected SubscriptionImplgetSubscriptionFromVuzeFile(byte[] sid, int add_type, File file) protected SubscriptionImplgetSubscriptionFromVuzeFileContent(byte[] sid, int add_type, String content) getSubscriptions(boolean subscribed_only) protected Fileprotected StringgetUniqueName(String name) protected FilegetVuzeFile(SubscriptionImpl subs) booleanimportDataSource(Map<String, Object> map) importSubscription(int type, Map map, boolean warn_user) protected voidprotected voidinitWithCore(Core _core) protected booleanbooleanbooleanbooleanbooleanprotected booleanisVisible(SubscriptionImpl subs) private voidprivate voidprotected LinkedHashMap<String, SubscriptionResultImpl> loadResults(SubscriptionImpl subs) voidvoidprotected voidlookupAssociations(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 SubscriptionAssociationLookuplookupAssociations(DHTPluginInterface dht_plugin, byte[] hash, String description, SubscriptionLookupListener listener) protected SubscriptionAssociationLookuplookupAssociationsSupport(DHTPluginInterface dht_plugin, byte[] hash, String description, SubscriptionLookupListener _listener) protected SubscriptionImpllookupSingletonRSS(String name, URL url, boolean is_public, int check_interval_mins, boolean is_anon) private voidlookupSubscription(String description, byte[] association_hash, byte[] sid, int version, boolean is_anon, SubscriptionManagerImpl.subsLookupListener listener) voidmarkReadInAllSubscriptions(SearchSubsResultBase[] results) private List<SubscriptionResult> matchSubscriptionResults(SearchMatcher matcher) static voidprotected voidprepareDownload(Download download, Subscription[] subscriptions, SubscriptionResult[] results) private voidprocessResults(SubscriptionImpl subs, Collection<SubscriptionResultImpl> results, boolean has_new_results) private voidprivate booleanprivate voidprotected voidprotected voidprotected voidrecordAssociations(byte[] association_hash, SubscriptionImpl[] subscriptions, boolean full_lookup) protected booleanrecordAssociationsSupport(byte[] association_hash, SubscriptionImpl[] subscriptions, boolean full_lookup) protected booleanrecoverSubscriptionUpdate(Download download, Map rd) protected voidremoveDownload(Download download, boolean remove_data) voidremoveListener(SubscriptionManagerListener listener) protected voidremovePrepareTrigger(byte[] hash) protected voidvoidrequestSubscription(SearchProvider sp, Map<String, Object> search_parameters) voidrequestSubscription(URL url, Map<String, Object> options) protected voidprotected voidsaveResults(SubscriptionImpl subs, SubscriptionResultImpl[] results, List<SubscriptionResultImpl> new_unread_results) searchSubscriptions(Map<String, Object> search_parameters, SearchObserver observer) private voidsearchTemplateOK(SubscriptionImpl subs, Download download) private DHTPluginInterfaceprivate DHTPluginInterfaceselectDHTPlugin(Download download) private DHTPluginInterfaceselectDHTPlugin(String[] networks) protected voidvoidsetActivateSubscriptionOnChange(boolean b) voidsetAddHashDirs(boolean b) voidsetAutoDownloadMarkReadAfterDays(int days) voidsetAutoStartDownloads(boolean auto_start) voidsetAutoStartMaxMB(int mb) voidsetAutoStartMinMB(int mb) protected voidsetCategoryOnExisting(SubscriptionImpl subscription, String old_category, String new_category) voidsetDefaultCheckFrequencyMins(int def) voidsetMarkResultsInLibraryRead(boolean b) voidsetMaxNonDeletedResults(int max) voidsetRateLimits(String limits) voidsetRSSPublishEnabled(boolean enabled) voidsetSearchEnabled(boolean enabled) protected voidprotected voidsetSelected(List subs) voidsetSubsDownloadEnabled(boolean enabled) protected booleanshouldAutoStart(Torrent torrent) subscribeToRSS(String name, URL url, int interval, boolean is_public, String creator_ref) protected booleansubscriptionExists(Download download, SubscriptionImpl subs) protected voidprotected voidprotected voidupdatePopularityFromDHT(SubscriptionImpl subs, boolean sync) protected voidprotected voidupdateSubscription(SubscriptionImpl subs, int new_version) protected voidupdateSubscription(SubscriptionImpl subs, int update_version, byte[] update_hash, int update_size) protected voidupdateSubscription(SubscriptionImpl subs, int new_version, TOTorrent torrent, InetSocketAddress peer) protected voidupdateSubscription(SubscriptionImpl subs, Download download, File torrent_file, File data_file) protected voidupdateSubscription(SubscriptionImpl subs, File data_location) private voidwaitForChat(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
-
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:
getSchedulerin interfaceSubscriptionManager
-
isRSSPublishEnabled
public boolean isRSSPublishEnabled()- Specified by:
isRSSPublishEnabledin interfaceSubscriptionManager
-
setRSSPublishEnabled
public void setRSSPublishEnabled(boolean enabled) - Specified by:
setRSSPublishEnabledin interfaceSubscriptionManager
-
isSearchEnabled
public boolean isSearchEnabled()- Specified by:
isSearchEnabledin interfaceSubscriptionManager
-
setSearchEnabled
public void setSearchEnabled(boolean enabled) - Specified by:
setSearchEnabledin interfaceSubscriptionManager
-
hideSearchTemplates
public boolean hideSearchTemplates()- Specified by:
hideSearchTemplatesin interfaceSubscriptionManager
-
isSubsDownloadEnabled
public boolean isSubsDownloadEnabled()- Specified by:
isSubsDownloadEnabledin interfaceSubscriptionManager
-
setSubsDownloadEnabled
public void setSubsDownloadEnabled(boolean enabled) - Specified by:
setSubsDownloadEnabledin interfaceSubscriptionManager
-
setRateLimits
- Specified by:
setRateLimitsin interfaceSubscriptionManager
-
getRateLimits
- Specified by:
getRateLimitsin interfaceSubscriptionManager
-
setActivateSubscriptionOnChange
public void setActivateSubscriptionOnChange(boolean b) - Specified by:
setActivateSubscriptionOnChangein interfaceSubscriptionManager
-
getActivateSubscriptionOnChange
public boolean getActivateSubscriptionOnChange()- Specified by:
getActivateSubscriptionOnChangein interfaceSubscriptionManager
-
setMarkResultsInLibraryRead
public void setMarkResultsInLibraryRead(boolean b) - Specified by:
setMarkResultsInLibraryReadin interfaceSubscriptionManager
-
getMarkResultsInLibraryRead
public boolean getMarkResultsInLibraryRead()- Specified by:
getMarkResultsInLibraryReadin interfaceSubscriptionManager
-
getRSSLink
- Specified by:
getRSSLinkin interfaceSubscriptionManager
-
create
public Subscription create(String name, boolean public_subs, String json) throws SubscriptionException - Specified by:
createin interfaceSubscriptionManager- Throws:
SubscriptionException
-
createSingletonRSS
public SubscriptionImpl createSingletonRSS(String name, URL url, int check_interval_mins, boolean is_anon) throws SubscriptionException - Specified by:
createSingletonRSSin interfaceSubscriptionManager- Throws:
SubscriptionException
-
createFromURI
- Specified by:
createFromURIin 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:
requestSubscriptionin interfaceUtilitiesImpl.PluginSubscriptionManager
-
requestSubscription
public void requestSubscription(SearchProvider sp, Map<String, Object> search_parameters) throws SubscriptionException- Specified by:
requestSubscriptionin interfaceUtilitiesImpl.PluginSubscriptionManager- Throws:
SubscriptionException
-
createRSS
public Subscription createRSS(String name, URL url, int check_interval_mins, Map user_data) throws SubscriptionException - Specified by:
createRSSin 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:
createRSSin interfaceSubscriptionManager- Throws:
SubscriptionException
-
createSubscriptionTemplate
- Specified by:
createSubscriptionTemplatein 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:
getSubscriptionsin interfaceSubscriptionManager
-
getSubscriptions
- Specified by:
getSubscriptionsin interfaceSubscriptionManager- Specified by:
getSubscriptionsin interfaceUtilitiesImpl.PluginSubscriptionManager
-
getSubscriptionCount
public int getSubscriptionCount(boolean subscribed_only) - Specified by:
getSubscriptionCountin interfaceSubscriptionManager
-
getSubscriptionFromName
-
getSubscriptionByID
- Specified by:
getSubscriptionByIDin interfaceSubscriptionManager
-
importDataSource
- Specified by:
importDataSourcein interfaceDataSourceResolver.DataSourceImporter
-
getSubscriptionFromSID
-
getSubsDir
- Throws:
IOException
-
getVuzeFile
- Throws:
IOException
-
getResultsFile
- Throws:
IOException
-
getKnownSubscriptionCount
public int getKnownSubscriptionCount()- Specified by:
getKnownSubscriptionCountin interfaceSubscriptionManager
-
getKnownSubscriptions
Description copied from interface:SubscriptionManagerCached view of hash's subs- Specified by:
getKnownSubscriptionsin interfaceSubscriptionManager- Parameters:
hash-- Returns:
-
subscriptionExists
-
downloadIsIgnored
-
isVisible
-
getLinkedSubscriptions
- Specified by:
getLinkedSubscriptionsin 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:
lookupAssociationsin interfaceSubscriptionManager- Throws:
SubscriptionException
-
lookupAssociations
public SubscriptionAssociationLookup lookupAssociations(byte[] hash, SubscriptionLookupListener listener) throws SubscriptionException - Specified by:
lookupAssociationsin interfaceSubscriptionManager- Parameters:
hash-listener-- Returns:
- Throws:
SubscriptionException
-
lookupAssociations
public SubscriptionAssociationLookup lookupAssociations(byte[] hash, String description, SubscriptionLookupListener listener) throws SubscriptionException Description copied from interface:SubscriptionManagerFull lookup- Specified by:
lookupAssociationsin interfaceSubscriptionManager- Parameters:
hash-listener-- 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:
getDefaultCheckFrequencyMinsin interfaceSubscriptionManager
-
setDefaultCheckFrequencyMins
public void setDefaultCheckFrequencyMins(int def) - Specified by:
setDefaultCheckFrequencyMinsin interfaceSubscriptionManager
-
getMaxNonDeletedResults
public int getMaxNonDeletedResults()- Specified by:
getMaxNonDeletedResultsin interfaceSubscriptionManager
-
setMaxNonDeletedResults
public void setMaxNonDeletedResults(int max) - Specified by:
setMaxNonDeletedResultsin interfaceSubscriptionManager
-
getAutoStartDownloads
public boolean getAutoStartDownloads()- Specified by:
getAutoStartDownloadsin interfaceSubscriptionManager
-
setAutoStartDownloads
public void setAutoStartDownloads(boolean auto_start) - Specified by:
setAutoStartDownloadsin interfaceSubscriptionManager
-
getAutoStartMinMB
public int getAutoStartMinMB()- Specified by:
getAutoStartMinMBin interfaceSubscriptionManager
-
setAutoStartMinMB
public void setAutoStartMinMB(int mb) - Specified by:
setAutoStartMinMBin interfaceSubscriptionManager
-
getAutoStartMaxMB
public int getAutoStartMaxMB()- Specified by:
getAutoStartMaxMBin interfaceSubscriptionManager
-
setAutoStartMaxMB
public void setAutoStartMaxMB(int mb) - Specified by:
setAutoStartMaxMBin interfaceSubscriptionManager
-
getAutoDownloadMarkReadAfterDays
public int getAutoDownloadMarkReadAfterDays()- Specified by:
getAutoDownloadMarkReadAfterDaysin interfaceSubscriptionManager
-
setAutoDownloadMarkReadAfterDays
public void setAutoDownloadMarkReadAfterDays(int days) - Specified by:
setAutoDownloadMarkReadAfterDaysin interfaceSubscriptionManager
-
getAddHashDirs
public boolean getAddHashDirs()- Specified by:
getAddHashDirsin interfaceSubscriptionManager
-
setAddHashDirs
public void setAddHashDirs(boolean b) - Specified by:
setAddHashDirsin 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
private void checkGloballyMarkedRead(SubscriptionImpl subs, Collection<SubscriptionResultImpl> results) -
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:
addListenerin interfaceSubscriptionManager
-
removeListener
- Specified by:
removeListenerin interfaceSubscriptionManager
-
generate
- Specified by:
generatein interfaceAEDiagnosticsEvidenceGenerator
-
selectDHTPlugin
-
selectDHTPlugin
-
selectDHTPlugin
-
subscribeToSubscription
- Specified by:
subscribeToSubscriptionin interfaceSubscriptionManager- Throws:
Exception
-
subscribeToRSS
public Subscription subscribeToRSS(String name, URL url, int interval, boolean is_public, String creator_ref) throws Exception - Specified by:
subscribeToRSSin interfaceSubscriptionManager- Throws:
Exception
-
getGMAR
-
markReadInAllSubscriptions
- Specified by:
markReadInAllSubscriptionsin interfaceSubscriptionManager
-