Package com.biglybt.ui.webplugin
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 String
static final String
static final String
boolean
static final String
static final String
static final String
static final String
private BasicPluginConfigModel
static final String
static final String
static final String
static final boolean
static final String
static final boolean
static final String
static final byte[]
static final String
static final boolean
static final String
int
static final String
static final String
static final String
static final String
boolean
static final String
static final String
static final String
boolean
static final String
static final String
private File
private static final String
private String
private boolean
private LoggerChannel
private static final int
private boolean
private static final AsyncDispatcher
protected static final String
private StringParameter
private PasswordParameter
private BooleanParameter
private String
private BooleanParameter
private StringParameter
private String
private PairingManagerListener
static final String
private String
static final String
private StringParameter
private BooleanParameter
private StringParameter
private StringParameter
private InfoParameter
private IntParameter
private IntParameter
private StringListParameter
private StringParameter
private StringParameter
private InfoParameter
private PluginConfig
private boolean
protected PluginInterface
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
private Properties
static final String
private BooleanParameter
private String
private String
private boolean
private static ThreadLocal
<String> private TrackerWebContext
private boolean
private UPnPMapping
private BasicPluginViewModel
protected static File[]
protected static final String[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
generate
(TrackerWebPageRequest request, TrackerWebPageResponse response) private boolean
generate2
(TrackerWebPageRequest request, TrackerWebPageResponse response, boolean is_tunnel) boolean
generateSupport
(TrackerWebPageRequest request, TrackerWebPageResponse response) private String
getArgumentFromURL
(URL url, String argument) protected BasicPluginConfigModel
private String
int
getPort()
int
protected String
protected BasicPluginViewModel
private byte[]
handleTunnelRequest
(InetAddress originator, String endpoint_url, byte[] request_bytes) private boolean
hasOurCookie
(String cookies) void
initialize
(PluginInterface _plugin_interface) This method is called when the Plugin is loaded by the clientprotected void
initStage
(int num) protected boolean
protected void
protected void
private void
recordAuthRequest
(String client_ip, boolean good) private void
recordRequest
(TrackerWebPageRequest request, boolean good, boolean is_tunnel) private boolean
returnJSON
(TrackerWebPageResponse response, String str) private boolean
returnStuff
(TrackerWebPageResponse response, String content_type, String str) private boolean
returnTextPlain
(TrackerWebPageResponse response, String str) private boolean
sameAddress
(InetAddress a1, InetAddress a2) private void
protected void
protected void
setupPairing
(String sid, boolean pairing_enabled) private void
protected void
private void
setupSessionCode
(String key) protected void
void
setUserAndPassword
(String user, String password) protected void
void
protected void
protected void
updatePairing
(String sid, String reason) protected boolean
useFile
(TrackerWebPageRequest request, TrackerWebPageResponse response, File root, String relative_url) this method can be over-ridden to handle custom file deliveryprotected boolean
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
-
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_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_dest
-
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: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- 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:
generate
in 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
-