Class MagnetPlugin
java.lang.Object
com.biglybt.plugin.magnet.MagnetPlugin
- All Implemented Interfaces:
Plugin
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static interfaceprivate static classprivate static interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static DistributedDatabase[]private static AESemaphoreprotected static final Objectprotected static final Objectprotected static final Objectprivate static ByteArrayHashMap<MagnetPlugin.DownloadActivity> private static ByteArrayHashMap<Integer> private booleanstatic final intstatic final intstatic final intstatic final intprivate CopyOnWriteListprivate BooleanParameterprivate BooleanParameterprivate StringParameterprivate static final String[]private BooleanParameterprivate IntParameterprivate static final intprivate BooleanParameterprivate Map<String, BooleanParameter> private static final Stringprivate static final intprivate PluginInterfaceprivate static final Stringstatic final String[]static final String[]static final String[]private IntParameterprivate StringListParameterprotected static final intprotected static final intprotected static final intprivate DirectoryParameterprivate 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) voidaddListener(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) voiddownloadAsync(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 voiddownloadSupport(MagnetPluginProgressListener listener, byte[] hash, String args, InetSocketAddress[] sources, List<String> tags, Map<String, Object> initial_metadata, long timeout, int flags, MagnetPlugin.DownloadResultListener _result_listener) protected FilegetInitialMetadata(DownloadManager dm, Map<String, Object> existing_md) getInitialTags(DownloadManager from_dm) getMagnetURL(byte[] hash) getMagnetURL(TOTorrent torrent) protected intprotected StringgetMessageText(String resource, String... params) protected booleanprotected Filevoidinitialize(PluginInterface _plugin_interface) This method is called when the Plugin is loaded by the clientbooleanisNetworkEnabled(String net) static voidload(PluginInterface plugin_interface) private voidrecoverableDownload(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 voidvoidremoveListener(MagnetPluginListener listener) protected voidprotected voidsetInitialMetadata(DownloadManager to_dm, List<String> tags, Map<String, Object> other_metadata) private booleanprotected booleanupdateInitialMetadata(Map map, DownloadManager from_dm) protected voidprivate voidMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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_start_stopped
-
md_extra_trackers
-
timeout_param
-
sources_param
-
sources_extra_param
-
magnet_recovery
-
magnet_rename
-
storage_folder
-
net_params
-
download_activities
-
SS_FORCE_START
protected static final int SS_FORCE_START- See Also:
-
SS_START
protected static final int SS_START- See Also:
-
SS_STOPPED
protected static final int SS_STOPPED- See Also:
-
download_start_states
-
-
Constructor Details
-
MagnetPlugin
public MagnetPlugin()
-
-
Method Details
-
load
-
initialize
Description copied from interface:PluginThis method is called when the Plugin is loaded by the client- Specified by:
initializein interfacePlugin- Parameters:
_plugin_interface- the interface that the plugin must use to communicate with the client
-
getRenameDisplayName
protected boolean getRenameDisplayName() -
addSource
-
updateLocale
-
recoverDownloads
private void recoverDownloads() -
getDefaultStorageDir
-
getStorageDir
-
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
-
getMDDownloadStartState
-
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
-