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 StringParameter
static final String
static final int
private static final Properties
private static boolean
private static LoggerChannel
static final String
private static SimpleAPIPlugin
private HyperlinkParameter
Fields 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_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_ROOT_DIR, CONFIG_ROOT_DIR_DEFAULT, CONFIG_ROOT_RESOURCE, CONFIG_ROOT_RESOURCE_DEFAULT, CONFIG_UPNP_ENABLE, CONFIG_UPNP_ENABLE_DEFAULT, CONFIG_USER, CONFIG_USER_DEFAULT, NL, PAIRING_MIGRATED, PAIRING_SESSION_KEY, plugin_interface, 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_ROOT_DIR, PR_ROOT_RESOURCE, PR_VIEW_MODEL, PROPERTIES_MIGRATED, welcome_files, welcome_pages
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
evalScript
(Map<String, Object> eval_args) boolean
generateSupport
(TrackerWebPageRequest request, TrackerWebPageResponse response) private boolean
getBoolean
(String value) private DownloadManager
getDownloadFromHash
(Map<String, String> args) static SimpleAPIPlugin
void
This method is called when the Plugin is loaded by the clientprotected void
initStage
(int num) static void
load
(PluginInterface plugin_interface) private String
process
(TrackerWebPageResponse response, Map<String, String> args, Map<String, List<String>> multi_args) protected void
private void
protected boolean
Methods 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, useFile
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
-
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
-
api_key
-
test_param
-
-
Constructor Details
-
SimpleAPIPlugin
public SimpleAPIPlugin()
-
-
Method Details
-
load
-
getSingleton
-
initialize
Description copied from interface:Plugin
This method is called when the Plugin is loaded by the client- Specified by:
initialize
in interfacePlugin
- Overrides:
initialize
in 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:
verifyReferrer
in classWebPlugin
-
setupServer
protected void setupServer()- Overrides:
setupServer
in classWebPlugin
-
updateTestParam
private void updateTestParam() -
createAPIKey
-
generateSupport
public boolean generateSupport(TrackerWebPageRequest request, TrackerWebPageResponse response) throws IOException - Overrides:
generateSupport
in 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
-
getBoolean
- Throws:
Exception
-
evalScript
- Throws:
IPCException
-