Package com.biglybt.plugin.simpleapi
Class SimpleAPIPlugin
java.lang.Object
com.biglybt.ui.webplugin.WebPlugin
com.biglybt.plugin.simpleapi.SimpleAPIPlugin
- All Implemented Interfaces:
Plugin,TrackerWebPageGenerator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringParameterstatic final Stringstatic final intprivate static final Propertiesprivate static booleanprivate static LoggerChannelprivate PluginInterfacestatic final Stringprivate static SimpleAPIPluginprivate HyperlinkParameterFields inherited from class com.biglybt.ui.webplugin.WebPlugin
CONFIG_ACCESS, CONFIG_ACCESS_DEFAULT, CONFIG_BIND_IP, CONFIG_BIND_IP_DEFAULT, CONFIG_ENABLE, CONFIG_ENABLE_DEFAULT, CONFIG_HOME_PAGE, CONFIG_HOME_PAGE_DEFAULT, CONFIG_I2P_ENABLE, CONFIG_I2P_ENABLE_DEFAULT, CONFIG_MODE, CONFIG_MODE_DEFAULT, CONFIG_MODE_FULL, CONFIG_NO_PW_WHITELIST, CONFIG_NO_PW_WHITELIST_DEFAULT, CONFIG_PAIRING_AUTO_AUTH, CONFIG_PAIRING_AUTO_AUTH_DEFAULT, CONFIG_PAIRING_ENABLE, CONFIG_PAIRING_ENABLE_DEFAULT, CONFIG_PASSWORD, CONFIG_PASSWORD_DEFAULT, CONFIG_PASSWORD_ENABLE, CONFIG_PASSWORD_ENABLE_DEFAULT, CONFIG_PORT, CONFIG_PORT_DEFAULT, CONFIG_PORT_OVERRIDE, CONFIG_PROTOCOL, CONFIG_PROTOCOL_DEFAULT, CONFIG_REVERSE_PROXY, CONFIG_REVERSE_PROXY_DEFAULT, CONFIG_ROOT_DIR, CONFIG_ROOT_DIR_DEFAULT, CONFIG_ROOT_RESOURCE, CONFIG_ROOT_RESOURCE_DEFAULT, CONFIG_TOR_ENABLE, CONFIG_TOR_ENABLE_DEFAULT, CONFIG_UPNP_ENABLE, CONFIG_UPNP_ENABLE_DEFAULT, CONFIG_USER, CONFIG_USER_DEFAULT, NL, PAIRING_MIGRATED, PAIRING_SESSION_KEY, PR_ACCESS, PR_BIND_IP, PR_CONFIG_MODEL, PR_CONFIG_MODEL_PARAMS, PR_DISABLABLE, PR_ENABLE, PR_ENABLE_I2P, PR_ENABLE_KEEP_ALIVE, PR_ENABLE_PAIRING, PR_ENABLE_TOR, PR_ENABLE_UPNP, PR_HIDE_RESOURCE_CONFIG, PR_HOME_PAGE, PR_LOG, PR_NON_BLOCKING, PR_PAIRING_SID, PR_PORT, PR_REVERSE_PROXY, PR_ROOT_DIR, PR_ROOT_RESOURCE, PR_VIEW_MODEL, PROPERTIES_MIGRATED, welcome_files, welcome_pages -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddTorrent(TOTorrent torrent) private StringevalScript(Map<String, Object> eval_args) booleangenerateSupport(TrackerWebPageRequest request, TrackerWebPageResponse response) private booleangetBoolean(String value) private DownloadManagergetDownloadFromHash(Map<String, String> args) static SimpleAPIPluginvoidThis method is called when the Plugin is loaded by the clientprotected voidinitStage(int num) static voidload(PluginInterface plugin_interface) private Stringprocess(TrackerWebPageResponse response, Map<String, String> args, Map<String, List<String>> multi_args) protected voidprivate voidprotected booleanMethods inherited from class com.biglybt.ui.webplugin.WebPlugin
generate, getConfigModel, getPort, getProtocol, getServerBindIP, getServerPort, getServerURL, getViewModel, isPluginEnabled, log, log, setupAutoAuth, setupPairing, setupUPnP, setUserAndPassword, unloadPlugin, unsetUserAndPassword, updatePairing, updatePairing, useFileMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.biglybt.pif.Plugin
getInitialProperties
-
Field Details
-
PLUGIN_NAME
- See Also:
-
DEFAULT_PORT
public static final int DEFAULT_PORT- See Also:
-
DEFAULT_ACCESS
- See Also:
-
singleton
-
loaded
private static boolean loaded -
defaults
-
log_channel
-
plugin_interface
-
api_key
-
test_param
-
-
Constructor Details
-
SimpleAPIPlugin
public SimpleAPIPlugin()
-
-
Method Details
-
load
-
getSingleton
-
initialize
Description copied from interface:PluginThis method is called when the Plugin is loaded by the client- Specified by:
initializein interfacePlugin- Overrides:
initializein classWebPlugin- Parameters:
pi- the interface that the plugin must use to communicate with the client- Throws:
PluginException
-
initStage
protected void initStage(int num) -
verifyReferrer
protected boolean verifyReferrer()- Overrides:
verifyReferrerin classWebPlugin
-
setupServer
protected void setupServer()- Overrides:
setupServerin classWebPlugin
-
updateTestParam
private void updateTestParam() -
createAPIKey
-
generateSupport
public boolean generateSupport(TrackerWebPageRequest request, TrackerWebPageResponse response) throws IOException - Overrides:
generateSupportin classWebPlugin- Throws:
IOException
-
getDownloadFromHash
- Throws:
Exception
-
process
private String process(TrackerWebPageResponse response, Map<String, String> args, Map<String, throws ExceptionList<String>> multi_args) - Throws:
Exception
-
addTorrent
-
getBoolean
- Throws:
Exception
-
evalScript
- Throws:
IPCException
-