public class ExtensionAlert extends ExtensionAdaptor implements SessionChangedListener, XmlReporterExtension, OptionsChangedListener
Constructor and Description |
---|
ExtensionAlert() |
Modifier and Type | Method and Description |
---|---|
void |
alertFound(Alert alert,
HistoryReference ref) |
protected void |
applyOverrides(Alert alert) |
void |
deleteAlert(Alert alert) |
void |
deleteAllAlerts() |
void |
deleteHistoryReferenceAlerts(HistoryReference hRef) |
void |
displayAlert(Alert alert) |
List<Alert> |
getAllAlerts() |
String |
getAuthor()
Gets the author of the extension.
|
String |
getDescription()
Returns the description of the extension, to be shown in UI components.
|
String |
getUIName()
By default returns the name returned by
getName() . |
String |
getXml(SiteNode site) |
void |
hook(ExtensionHook extensionHook)
Called during extension's initialisation to allow to add new functionality to core
components.
|
boolean |
isNewAlert(Alert alertToCheck)
Check if an alert already exists in the alerts tree.
|
void |
optionsChanged(OptionsParam optionsParam) |
void |
optionsLoaded()
Called after the options for this extension have been loaded, so that the extension can make
use of them.
|
boolean |
reloadOverridesFile() |
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.
|
protected void |
setAlertOverrideProperty(String key,
String value) |
void |
setAlertTabFocus() |
void |
setLinkWithSitesTreeSelection(boolean enabled)
Sets whether the "Alerts" tree is filtered, or not based on a selected "Sites" tree node.
|
void |
setShowJustInScope(boolean inScope)
Sets whether the "Alerts" tree is filtered, or not based on current session scope.
|
void |
showAlertAddDialog(HistoryReference ref)
Shows the Add Alert dialogue, to add a new alert for the given
HistoryReference . |
void |
showAlertAddDialog(HttpMessage httpMessage,
int historyType)
Shows the Add Alert dialogue, using the given
HttpMessage and history type for the
HistoryReference that will be created if the user creates the alert. |
void |
showAlertEditDialog(Alert alert)
Shows the "Edit Alert" dialogue, with the given alert.
|
boolean |
supportsDb(String type)
Part of the core set of features that should be supported by all db types
|
boolean |
supportsLowMemory()
Return true it the extension can run with the 'low memory' option.
|
void |
updateAlert(Alert alert) |
void |
updateAlertInTree(Alert originalAlert,
Alert alert) |
canUnload, databaseOpen, destroy, getActiveActions, getAddOn, getDependencies, getExtensionMenu, getExtensionView, getI18nPrefix, getMessages, getModel, getName, getOrder, getUnsavedResources, getView, hasView, init, initModel, initView, initXML, isCore, isDepreciated, isEnabled, postInit, postInstall, setAddOn, setDescription, setEnabled, setI18nPrefix, setMessages, setName, setOrder, start, stop, unload
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
sessionPropertiesChanged
getURL, getVersion
public static final String NAME
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 optionsLoaded()
Extension
optionsLoaded
in interface Extension
optionsLoaded
in class ExtensionAdaptor
Extension.postInit()
public void optionsChanged(OptionsParam optionsParam)
optionsChanged
in interface OptionsChangedListener
public boolean reloadOverridesFile()
public void alertFound(Alert alert, HistoryReference ref)
protected void applyOverrides(Alert alert)
public void updateAlert(Alert alert) throws HttpMalformedHeaderException, DatabaseException
public void displayAlert(Alert alert)
public void sessionChanged(Session session)
SessionChangedListener
sessionChanged
in interface SessionChangedListener
session
- the new sessionpublic void deleteAlert(Alert alert)
public void deleteAllAlerts()
public void deleteHistoryReferenceAlerts(HistoryReference hRef)
public String getXml(SiteNode site)
getXml
in interface XmlReporterExtension
public void sessionAboutToChange(Session session)
SessionChangedListener
sessionAboutToChange
in interface SessionChangedListener
session
- the session about to be closedpublic 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 sessionScopeChanged(Session session)
SessionChangedListener
sessionScopeChanged
in interface SessionChangedListener
session
- the current sessionpublic void sessionModeChanged(Control.Mode mode)
SessionChangedListener
sessionModeChanged
in interface SessionChangedListener
mode
- the new modepublic void setAlertTabFocus()
public void setShowJustInScope(boolean inScope)
If inScope
is true
only the alerts that are in the current session scope
will be shown.
Calling this method removes the filter "Link with Sites selection", if enabled, as they are mutually exclusive.
inScope
- true
if the "Alerts" tree should be filtered based on current session
scope, false
otherwise.setLinkWithSitesTreeSelection(boolean)
,
Session
public void setLinkWithSitesTreeSelection(boolean enabled)
If enabled
is true
only the alerts of the selected "Sites" tree node will
be shown.
Calling this method removes the filter "Just in Scope", if enabled, as they are mutually exclusive.
enabled
- true
if the "Alerts" tree should be filtered based on a selected
"Sites" tree node, false
otherwise.setShowJustInScope(boolean)
,
View.getSiteTreePanel()
public void showAlertAddDialog(HistoryReference ref)
HistoryReference
.ref
- the history reference for the alert.public void showAlertAddDialog(HttpMessage httpMessage, int historyType)
HttpMessage
and history type for the
HistoryReference
that will be created if the user creates the alert. The current
session will be used to create the HistoryReference
. The alert created will be added
to the newly created HistoryReference
.
Should be used when the alert is added to a temporary HistoryReference
as the
temporary HistoryReference
s are deleted when the session is closed.
httpMessage
- the HttpMessage
that will be used to create the HistoryReference
, must not be null
.historyType
- the type of the history reference that will be used to create the HistoryReference
.Model.getSession()
,
HistoryReference.HistoryReference(org.parosproxy.paros.model.Session, int, HttpMessage)
public void showAlertEditDialog(Alert alert)
alert
- the alert to be edited.public boolean supportsDb(String type)
supportsDb
in interface Extension
supportsDb
in class ExtensionAdaptor
type
- the db typeDatabase.getType()
public boolean supportsLowMemory()
Extension
supportsLowMemory
in interface Extension
supportsLowMemory
in class ExtensionAdaptor
true
if the extension support the 'low memory' option, false
otherwisepublic boolean isNewAlert(Alert alertToCheck)
alertToCheck
-