Package com.biglybt.plugin.magnet
Class MagnetPlugin
java.lang.Object
com.biglybt.plugin.magnet.MagnetPlugin
- All Implemented Interfaces:
Plugin
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static interface
private static class
private static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static DistributedDatabase[]
private static AESemaphore
protected static final Object
protected static final Object
protected static final Object
private static ByteArrayHashMap<MagnetPlugin.DownloadActivity>
private boolean
static final int
static final int
static final int
static final int
private CopyOnWriteList
private BooleanParameter
private IntParameter
private StringParameter
private static final String[]
private BooleanParameter
private IntParameter
private static final int
private Map<String,
BooleanParameter> private static final String
private static final int
private PluginInterface
private static final String
static final String[]
static final String[]
static final String[]
private IntParameter
private StringListParameter
private IntParameter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
_downloadSupport
(MagnetPluginProgressListener listener, byte[] hash, String args, InetSocketAddress[] sources, List<String> tags, Map<String, Object> initial_metadata, long _timeout, int flags, MagnetPlugin.DownloadResultListener result_listener) void
addListener
(MagnetPluginListener listener) addSource
(Download download, String magnet, InetSocketAddress address) private byte[]
addTrackersAndWebSeedsEtc
(byte[] torrent_data, String args, Set<String> networks, List<String> initial_tags, Map<String, Object> other_metadata) private byte[]
addTrackersAndWebSeedsEtc
(MagnetPlugin.DownloadResult result, String args, List<String> tags, Map<String, Object> other_metadata) byte[]
badge()
byte[]
download
(MagnetPluginProgressListener listener, byte[] hash, String args, InetSocketAddress[] sources, List<String> tags, Map<String, Object> other_metadata, long timeout, int flags) void
downloadAsync
(MagnetPluginProgressListener listener, byte[] hash, String args, InetSocketAddress[] sources, List<String> tags, Map<String, Object> other_metadata, long timeout, int flags, MagnetPlugin.DownloadAsyncListener dl_listener) private void
downloadSupport
(MagnetPluginProgressListener listener, byte[] hash, String args, InetSocketAddress[] sources, List<String> tags, Map<String, Object> initial_metadata, long timeout, int flags, MagnetPlugin.DownloadResultListener _result_listener) getInitialMetadata
(DownloadManager dm, Map<String, Object> existing_md) getInitialTags
(DownloadManager from_dm) getMagnetURL
(byte[] hash) getMagnetURL
(TOTorrent torrent) protected String
getMessageText
(String resource, String... params) void
initialize
(PluginInterface _plugin_interface) This method is called when the Plugin is loaded by the clientboolean
isNetworkEnabled
(String net) static void
load
(PluginInterface plugin_interface) private void
recoverableDownload
(MagnetURIHandlerProgressListener muh_listener, byte[] hash, String args, InetSocketAddress[] sources, List<String> tags, Map<String, Object> other_metadata, long timeout, Long added_time, boolean is_recovering, MagnetPlugin.DownloadAsyncListener _dl_listener) private void
void
removeListener
(MagnetPluginListener listener) protected void
protected void
setInitialMetadata
(DownloadManager to_dm, List<String> tags, Map<String, Object> other_metadata) private boolean
protected boolean
updateInitialMetadata
(Map map, DownloadManager from_dm) protected void
private void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.pif.Plugin
getInitialProperties
-
Field Details
-
FL_NONE
public static final int FL_NONE- See Also:
-
FL_DISABLE_MD_LOOKUP
public static final int FL_DISABLE_MD_LOOKUP- See Also:
-
FL_NO_MD_LOOKUP_DELAY
public static final int FL_NO_MD_LOOKUP_DELAY- See Also:
-
FL_RECOVERING
public static final int FL_RECOVERING- See Also:
-
MD_LOOKUP_DELAY_SECS_DEFAULT
private static final int MD_LOOKUP_DELAY_SECS_DEFAULT- See Also:
-
MD_EXTRA_TRACKERS
-
PLUGIN_NAME
- See Also:
-
PLUGIN_CONFIGSECTION_ID
- See Also:
-
SOURCE_VALUES
-
SOURCE_KEYS
-
SOURCE_STRINGS
-
DM_TAG_CACHE
-
DM_CATEGORY_CACHE
-
DM_DN_CHANGED
-
db_holder
-
db_waiter
-
plugin_interface
-
listeners
-
first_download
private boolean first_download -
PLUGIN_DOWNLOAD_TIMEOUT_SECS_DEFAULT
private static final int PLUGIN_DOWNLOAD_TIMEOUT_SECS_DEFAULT- See Also:
-
md_lookup
-
md_lookup_delay
-
md_extra_trackers
-
timeout_param
-
sources_param
-
sources_extra_param
-
magnet_recovery
-
magnet_recovery_concurrency
-
net_params
-
download_activities
-
-
Constructor Details
-
MagnetPlugin
public MagnetPlugin()
-
-
Method Details
-
load
-
initialize
Description copied from interface:Plugin
This method is called when the Plugin is loaded by the client- Specified by:
initialize
in interfacePlugin
- Parameters:
_plugin_interface
- the interface that the plugin must use to communicate with the client
-
addSource
-
updateLocale
-
recoverDownloads
private void recoverDownloads() -
updateRecoverableDownloads
private void updateRecoverableDownloads() -
recoverableDownload
private void recoverableDownload(MagnetURIHandlerProgressListener muh_listener, byte[] hash, String args, InetSocketAddress[] sources, List<String> tags, Map<String, Object> other_metadata, long timeout, Long added_time, boolean is_recovering, MagnetPlugin.DownloadAsyncListener _dl_listener) -
isNetworkEnabled
-
getMagnetURL
-
getMagnetURL
- Throws:
TOTorrentException
-
getExtraTrackers
-
badge
public byte[] badge() -
download
public byte[] download(MagnetPluginProgressListener listener, byte[] hash, String args, InetSocketAddress[] sources, List<String> tags, Map<String, Object> other_metadata, long timeout, int flags) throws MagnetURIHandlerException- Throws:
MagnetURIHandlerException
-
downloadAsync
public void downloadAsync(MagnetPluginProgressListener listener, byte[] hash, String args, InetSocketAddress[] sources, List<String> tags, Map<String, Object> other_metadata, long timeout, int flags, MagnetPlugin.DownloadAsyncListener dl_listener) -
addTrackersAndWebSeedsEtc
-
addTrackersAndWebSeedsEtc
-
getInitialTags
-
updateInitialMetadata
-
setDNChanged
-
getInitialMetadata
-
setInitialMetadata
-
setInitialMetadata
-
downloadSupport
private void downloadSupport(MagnetPluginProgressListener listener, byte[] hash, String args, InetSocketAddress[] sources, List<String> tags, Map<String, Object> initial_metadata, long timeout, int flags, MagnetPlugin.DownloadResultListener _result_listener) -
_downloadSupport
private void _downloadSupport(MagnetPluginProgressListener listener, byte[] hash, String args, InetSocketAddress[] sources, List<String> tags, Map<String, Object> initial_metadata, long _timeout, int flags, MagnetPlugin.DownloadResultListener result_listener) -
getMessageText
-
addListener
-
removeListener
-