public class ExtensionParams extends ExtensionAdaptor implements SessionChangedListener, SiteMapListener
Constructor and Description |
---|
ExtensionParams() |
Modifier and Type | Method and Description |
---|---|
void |
addAntiCsrfToken() |
void |
addSessionToken()
Adds a new session token from the selected parameter.
|
Collection<SiteParameters> |
getAllSiteParameters() |
String |
getAuthor()
Gets the author of the extension.
|
String |
getDescription()
Returns the description of the extension, to be shown in UI components.
|
protected ExtensionHttpSessions |
getExtensionHttpSessions()
Gets the ExtensionHttpSessions, if it's enabled
|
protected ParamsPanel |
getParamsPanel() |
HtmlParameterStats |
getSelectedParam() |
SiteParameters |
getSiteParameters(String site) |
String |
getUIName()
By default returns the name returned by
getName() . |
boolean |
hasParameters(String site)
Tells whether or not the given
site has parameters. |
boolean |
hasSite(String site)
Tells whether or not the given
site was already seen. |
void |
hook(ExtensionHook extensionHook)
Called during extension's initialisation to allow to add new functionality to core
components.
|
void |
nodeSelected(SiteNode node) |
boolean |
onHttpRequestSend(HttpMessage msg) |
boolean |
onHttpResponseReceive(HttpMessage msg) |
void |
onReturnNodeRendererComponent(SiteMapTreeCellRenderer component,
boolean leaf,
SiteNode value) |
void |
removeAntiCsrfToken() |
void |
removeSessionToken()
Removes the currently selected parameter as a session token.
|
protected void |
searchForSelectedParam() |
void |
sessionAboutToChange(Session session)
Called just prior to the session changing.
|
void |
sessionChanged(Session session)
Called just after the session has changed.
|
void |
sessionModeChanged(Control.Mode mode)
Called when the user changes the mode.
|
void |
sessionScopeChanged(Session session)
Called when the user has changes the session scope.
|
boolean |
supportsDb(String type)
Return true if the specified db type is supported by the extension (or if it doesn't use any
db) If this method returns false (meaning the db in use is not supported) then the extension
will not be loaded.
|
void |
unload()
Unloads any component manually added to ZAP or other extensions (that is, a component that
was not added through the
ExtensionHook ). |
canUnload, databaseOpen, destroy, getActiveActions, getAddOn, getDependencies, getExtensionMenu, getExtensionView, getI18nPrefix, getMessages, getModel, getName, getOrder, getUnsavedResources, getView, hasView, init, initModel, initView, initXML, isCore, isDepreciated, isEnabled, optionsLoaded, postInit, postInstall, setAddOn, setDescription, setEnabled, setI18nPrefix, setMessages, setName, setOrder, start, stop, supportsLowMemory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
sessionPropertiesChanged
getURL, getVersion
public static final String NAME
public boolean supportsDb(String type)
Extension
supportsDb
in interface Extension
supportsDb
in class ExtensionAdaptor
type
- the db typeDatabase.getType()
public String getUIName()
ExtensionAdaptor
getName()
.getUIName
in interface Extension
getUIName
in class ExtensionAdaptor
null
ExtensionAdaptor.getName()
public void hook(ExtensionHook extensionHook)
Extension
hook
in interface Extension
hook
in class ExtensionAdaptor
extensionHook
- the hook to add the components.public void unload()
ExtensionAdaptor
ExtensionHook
).
Should be called only by core functionality (e.g. during uninstallation of the extension).
Does nothing by default.
unload
in interface Extension
unload
in class ExtensionAdaptor
Extension.hook(ExtensionHook)
protected ParamsPanel getParamsPanel()
public void sessionChanged(Session session)
SessionChangedListener
sessionChanged
in interface SessionChangedListener
session
- the new sessionprotected ExtensionHttpSessions getExtensionHttpSessions()
public boolean onHttpRequestSend(HttpMessage msg)
public boolean onHttpResponseReceive(HttpMessage msg)
public void nodeSelected(SiteNode node)
nodeSelected
in interface SiteMapListener
public void onReturnNodeRendererComponent(SiteMapTreeCellRenderer component, boolean leaf, SiteNode value)
onReturnNodeRendererComponent
in interface SiteMapListener
protected void searchForSelectedParam()
public void addAntiCsrfToken()
public void removeAntiCsrfToken()
public boolean hasSite(String site)
site
was already seen.site
- the site that will be checkedtrue
if the given site
was already seen, false
otherwise.hasParameters(String)
public boolean hasParameters(String site)
site
has parameters.site
- the site that will be checkedtrue
if the given site
has parameters, false
if not, or was
not yet seen.hasSite(String)
public SiteParameters getSiteParameters(String site)
public Collection<SiteParameters> getAllSiteParameters()
public void addSessionToken()
ExtensionHttpSessions
if it's active.public void removeSessionToken()
ExtensionHttpSessions
if it's active.public HtmlParameterStats getSelectedParam()
public void sessionAboutToChange(Session session)
SessionChangedListener
sessionAboutToChange
in interface SessionChangedListener
session
- the session about to be closedpublic void sessionScopeChanged(Session session)
SessionChangedListener
sessionScopeChanged
in interface SessionChangedListener
session
- the current sessionpublic String getAuthor()
Extension
Since 2.9.0 defaults to the author of the add-on, if set, otherwise an empty string.
public String getDescription()
Extension
getDescription
in interface Extension
getDescription
in class ExtensionAdaptor
null
public void sessionModeChanged(Control.Mode mode)
SessionChangedListener
sessionModeChanged
in interface SessionChangedListener
mode
- the new mode