Class WebPlugin
java.lang.Object
com.biglybt.ui.webplugin.WebPlugin
- All Implemented Interfaces:
Plugin, TrackerWebPageGenerator
- Direct Known Subclasses:
ManagerUtils.UnloadableWebPlugin, RSSGeneratorPlugin, SimpleAPIPlugin
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringbooleanstatic final Stringstatic final Stringbooleanstatic final Stringstatic final Stringstatic final Stringprivate BasicPluginConfigModelstatic final Stringstatic final Stringstatic final Stringstatic final booleanstatic final Stringstatic final booleanstatic final Stringstatic final byte[]static final Stringstatic final booleanstatic final Stringintstatic final Stringstatic final Stringstatic final Stringstatic final Stringbooleanstatic final Stringstatic final Stringstatic final Stringbooleanstatic final Stringbooleanstatic final Stringstatic final Stringprivate Fileprivate static final Stringprivate Stringprivate booleanprivate LoggerChannelprivate static final intprivate booleanprivate static final AsyncDispatcherprotected static final Stringprivate StringParameterprivate PasswordParameterprivate BooleanParameterprivate Stringprivate BooleanParameterprivate StringParameterprivate Stringprivate PairingManagerListenerstatic final Stringprivate Stringstatic final Stringprivate StringParameterprivate BooleanParameterprivate StringParameterprivate StringParameterprivate InfoParameterprivate BooleanParameterprivate IntParameterprivate IntParameterprivate StringListParameterprivate StringParameterprivate StringParameterprivate InfoParameterprivate BooleanParameterprivate PluginConfigprivate booleanprotected PluginInterfacestatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprivate Propertiesstatic final Stringprivate BooleanParameterprivate Stringprivate Stringprivate booleanprivate static ThreadLocal<String> private TrackerWebContextprivate booleanprivate UPnPMappingprivate BasicPluginViewModelprotected static File[]protected static final String[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangenerate(TrackerWebPageRequest request, TrackerWebPageResponse response) private booleangenerate2(TrackerWebPageRequest request, TrackerWebPageResponse response, boolean is_tunnel) booleangenerateSupport(TrackerWebPageRequest request, TrackerWebPageResponse response) private StringgetArgumentFromURL(URL url, String argument) protected BasicPluginConfigModelprivate StringintgetPort()intprotected Stringprotected BasicPluginViewModelprivate byte[]handleTunnelRequest(InetAddress originator, String endpoint_url, byte[] request_bytes) private booleanhasOurCookie(String cookies) voidinitialize(PluginInterface _plugin_interface) This method is called when the Plugin is loaded by the clientprotected voidinitStage(int num) protected booleanprotected voidprotected voidprivate voidrecordAuthRequest(String client_ip, boolean good) private voidrecordRequest(TrackerWebPageRequest request, boolean good, boolean is_tunnel) private booleanreturnJSON(TrackerWebPageResponse response, String str) private booleanreturnStuff(TrackerWebPageResponse response, String content_type, String str) private booleanreturnTextPlain(TrackerWebPageResponse response, String str) private booleansameAddress(InetAddress a1, InetAddress a2) private voidprotected voidprotected voidsetupPairing(String sid, boolean pairing_enabled) private voidprotected voidprivate voidsetupSessionCode(String key) protected voidvoidsetUserAndPassword(String user, String password) protected voidvoidprotected voidprotected voidupdatePairing(String sid, String reason) protected booleanuseFile(TrackerWebPageRequest request, TrackerWebPageResponse response, File root, String relative_url) this method can be over-ridden to handle custom file deliveryprotected booleanMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Plugin
getInitialProperties
-
Field Details
-
PR_ENABLE
- See Also:
-
PR_DISABLABLE
- See Also:
-
PR_PORT
- See Also:
-
PR_BIND_IP
- See Also:
-
PR_ROOT_RESOURCE
- See Also:
-
PR_HOME_PAGE
- See Also:
-
PR_ROOT_DIR
- See Also:
-
PR_ACCESS
- See Also:
-
PR_LOG
- See Also:
-
PR_CONFIG_MODEL_PARAMS
- See Also:
-
PR_CONFIG_MODEL
- See Also:
-
PR_VIEW_MODEL
- See Also:
-
PR_HIDE_RESOURCE_CONFIG
- See Also:
-
PR_ENABLE_KEEP_ALIVE
- See Also:
-
PR_PAIRING_SID
- See Also:
-
PR_NON_BLOCKING
- See Also:
-
PR_ENABLE_PAIRING
- See Also:
-
PR_ENABLE_I2P
- See Also:
-
PR_ENABLE_TOR
- See Also:
-
PR_ENABLE_UPNP
- See Also:
-
PR_REVERSE_PROXY
- See Also:
-
PROPERTIES_MIGRATED
- See Also:
-
PAIRING_MIGRATED
- See Also:
-
PAIRING_SESSION_KEY
- See Also:
-
CONFIG_PASSWORD_ENABLE
- See Also:
-
CONFIG_PASSWORD_ENABLE_DEFAULT
public static final boolean CONFIG_PASSWORD_ENABLE_DEFAULT- See Also:
-
CONFIG_NO_PW_WHITELIST
- See Also:
-
CONFIG_NO_PW_WHITELIST_DEFAULT
- See Also:
-
CONFIG_PAIRING_ENABLE
- See Also:
-
CONFIG_PAIRING_ENABLE_DEFAULT
public static final boolean CONFIG_PAIRING_ENABLE_DEFAULT- See Also:
-
CONFIG_PORT_OVERRIDE
- See Also:
-
CONFIG_PAIRING_AUTO_AUTH
- See Also:
-
CONFIG_PAIRING_AUTO_AUTH_DEFAULT
public static final boolean CONFIG_PAIRING_AUTO_AUTH_DEFAULT- See Also:
-
CONFIG_ENABLE
- See Also:
-
CONFIG_ENABLE_DEFAULT
public boolean CONFIG_ENABLE_DEFAULT -
CONFIG_USER
- See Also:
-
CONFIG_USER_DEFAULT
- See Also:
-
CONFIG_PASSWORD
- See Also:
-
CONFIG_PASSWORD_DEFAULT
public static final byte[] CONFIG_PASSWORD_DEFAULT -
CONFIG_PORT
- See Also:
-
CONFIG_PORT_DEFAULT
public int CONFIG_PORT_DEFAULT -
CONFIG_BIND_IP
- See Also:
-
CONFIG_BIND_IP_DEFAULT
-
CONFIG_PROTOCOL
- See Also:
-
CONFIG_PROTOCOL_DEFAULT
- See Also:
-
CONFIG_UPNP_ENABLE
- See Also:
-
CONFIG_UPNP_ENABLE_DEFAULT
public boolean CONFIG_UPNP_ENABLE_DEFAULT -
CONFIG_REVERSE_PROXY
- See Also:
-
CONFIG_REVERSE_PROXY_DEFAULT
public boolean CONFIG_REVERSE_PROXY_DEFAULT -
CONFIG_I2P_ENABLE
- See Also:
-
CONFIG_I2P_ENABLE_DEFAULT
public boolean CONFIG_I2P_ENABLE_DEFAULT -
CONFIG_TOR_ENABLE
- See Also:
-
CONFIG_TOR_ENABLE_DEFAULT
public boolean CONFIG_TOR_ENABLE_DEFAULT -
CONFIG_HOME_PAGE
- See Also:
-
CONFIG_HOME_PAGE_DEFAULT
-
CONFIG_ROOT_DIR
- See Also:
-
CONFIG_ROOT_DIR_DEFAULT
-
CONFIG_ROOT_RESOURCE
- See Also:
-
CONFIG_ROOT_RESOURCE_DEFAULT
-
CONFIG_MODE
- See Also:
-
CONFIG_MODE_FULL
- See Also:
-
CONFIG_MODE_DEFAULT
- See Also:
-
CONFIG_ACCESS
- See Also:
-
CONFIG_ACCESS_DEFAULT
-
NL
- See Also:
-
welcome_pages
-
welcome_files
-
network_dispatcher
-
plugin_interface
-
log
-
plugin_config
-
view_model
-
config_model
-
p_sid
-
param_home
-
param_rootdir
-
param_rootres
-
param_port
-
param_protocol
-
param_bind
-
param_access
-
param_i2p_enable
-
param_i2p_dest
-
param_tor_enable
-
param_tor_dest
-
p_upnp_enable
-
p_reverse_proxy
-
pw_enable
-
p_user_name
-
p_password
-
p_no_pw_whitelist
-
param_auto_auth
-
param_port_or
-
setting_auto_auth
private boolean setting_auto_auth -
pairing_access_code
-
pairing_session_code
-
plugin_enabled
private boolean plugin_enabled -
na_intf_listener_added
private boolean na_intf_listener_added -
home_page
-
file_root
-
resource_root
-
root_dir
-
ip_range_all
private boolean ip_range_all -
ip_ranges
-
tracker_context
-
upnp_mapping
-
pairing_listener
-
properties
-
tls
-
LOGOUT_GRACE_MILLIS
private static final int LOGOUT_GRACE_MILLIS- See Also:
-
GRACE_PERIOD_MARKER
- See Also:
-
logout_timer
-
unloaded
private boolean unloaded
-
-
Constructor Details
-
WebPlugin
public WebPlugin() -
WebPlugin
-
-
Method Details
-
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- Throws:
PluginException
-
initStage
protected void initStage(int num) -
getConnectionTestURL
-
isPluginEnabled
protected boolean isPluginEnabled() -
unloadPlugin
protected void unloadPlugin() -
setupResources
private void setupResources() -
setupAccess
private void setupAccess() -
verifyReferrer
protected boolean verifyReferrer() -
setupServer
protected void setupServer() -
hasOurCookie
-
sameAddress
-
setupUPnP
protected void setupUPnP() -
setupPairing
-
setupSessionCode
-
setupAutoAuth
protected void setupAutoAuth() -
updatePairing
-
updatePairing
-
getServerBindIP
-
getServerPort
public int getServerPort() -
getServerURL
-
getPort
public int getPort() -
getProtocol
-
setUserAndPassword
-
unsetUserAndPassword
public void unsetUserAndPassword() -
recordAuthRequest
-
recordRequest
-
generateSupport
public boolean generateSupport(TrackerWebPageRequest request, TrackerWebPageResponse response) throws IOException - Throws:
IOException
-
handleTunnelRequest
private byte[] handleTunnelRequest(InetAddress originator, String endpoint_url, byte[] request_bytes) throws IOException - Throws:
IOException
-
generate
public boolean generate(TrackerWebPageRequest request, TrackerWebPageResponse response) throws IOException - Specified by:
generatein interfaceTrackerWebPageGenerator- Parameters:
request-response-- Returns:
- true if the request was handled
- Throws:
IOException
-
generate2
private boolean generate2(TrackerWebPageRequest request, TrackerWebPageResponse response, boolean is_tunnel) throws IOException - Throws:
IOException
-
useFile
protected boolean useFile(TrackerWebPageRequest request, TrackerWebPageResponse response, File root, String relative_url) throws IOException this method can be over-ridden to handle custom file delivery- Parameters:
request-response-root-relative_url-- Returns:
- Throws:
IOException
-
getArgumentFromURL
-
returnTextPlain
-
returnJSON
- Throws:
IOException
-
returnStuff
-
getConfigModel
-
getViewModel
-
log
-
log
-