| Constructor and Description |
|---|
DefaultAuditor(ModelTypeFactory factory,
java.lang.Class<? extends Analyzer>... analyzers) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAuditListener(AuditListener listener)
Adds an audit listener to this auditor.
|
boolean |
addConstruct(java.lang.Object construct,
java.net.URL url,
Project project,
Workspace workspace)
Adds the location corresponding to a construct to the set of locations to
be audited.
|
void |
addDependency(Dependency dependency) |
boolean |
addElement(Element element,
Node node,
Project project,
Workspace workspace)
Adds the location corresponding to an
Element to the set of
locations to be audited. |
boolean |
addNode(Node node,
Project project,
Workspace workspace)
Adds the location corresponding to a
Node to the set of
locations to be audited. |
boolean |
addUrl(java.net.URL url,
Project project,
Workspace workspace)
Adds the location corresponding to a URL to the set of locations to
be audited.
|
java.lang.Throwable |
applyDefaultTransforms(java.lang.String label)
Audits the locations of this auditor in the current thread and applies
all default transforms (see
Transformer.applyDefaultTransforms(java.lang.String, java.util.Collection<? extends oracle.jdeveloper.audit.service.Violation>, oracle.jdeveloper.audit.service.TransformerListener, oracle.jdeveloper.audit.service.AuditModel). |
void |
audit()
Audits the locations of this auditor in the current thread.
|
boolean |
cancel()
Cancel an executing audit.
|
void |
clear()
Clears the results and locations from this auditor.
|
ModelFactory |
getFactory()
Gets the factory used for this audit.
|
IntersectedFilters |
getFileFilters()
Gets the supplemental filters to use when filtering application content,
projects, and project content.
|
long |
getMaximumFileSize()
Gets the size of the largest file that can be audited, in Mb.
|
Profile |
getProfile()
Gets the profile for this audit.
|
WorkingSet |
getWorkingSet()
Gets the working set to use when filtering projects and project content.
|
boolean |
isAuditable(Element element,
Node node,
Project project,
Workspace workspace)
Gets whether an
Element is auditable. |
boolean |
isAuditableType(java.net.URL url)
Gets whether the element at an
URL is of an auditable type. |
boolean |
isAuditing()
Gets whether an audit is in progress.
|
boolean |
isCancelled()
Gets whether an audit in progress has been cancelled.
|
boolean |
isIgnoreAssists()
Gets whether to ignore issues corresponding to assists (severity
ASSIST). |
boolean |
isVisitAncestors()
Gets whether to visit ancestors of the locations to be audited.
|
boolean |
isVisitDescendants()
Gets whether to visit descendants of the locations to be audited.
|
void |
removeAuditListener(AuditListener listener)
Removes an audit listener from this auditor.
|
void |
run()
Audits the locations of this auditor in the current thread.
|
void |
runAsynchronously()
Audits the locations of this auditor in a background thread.
|
void |
runAsynchronously(java.lang.Thread.UncaughtExceptionHandler handler)
Audits the locations of this auditor in a background thread.
|
void |
setAttribute(java.lang.Object key,
java.lang.Object value)
Sets a configuration attribute for this auditor.
|
void |
setDependencyCollector(CompositeDependency collector)
Sets the collector of dependencies discovered when the audit is run, or
null.
|
void |
setFileFilters(IntersectedFilters filters)
Sets the supplemental filters to use when filtering application content,
projects, and project content.
|
void |
setIgnoreAssists(boolean ignore)
Sets whether to ignore issues corresponding to assists (severity
ASSIST). |
void |
setLockPolicy(LockPolicy policy)
Sets the lock policy to use when loking models.
|
void |
setMaximumFileSize(long size)
Sets the size of the largest auditable file.
|
void |
setProfile(Profile profile)
Sets the profile for this audit.
|
void |
setVisitAncestors(boolean shallow)
Sets whether to visit ancestors of the locations to be audited.
|
void |
setVisitDescendants(boolean shallow)
Sets whether to visit descendants of the locations to be audited.
|
void |
setWorkingSet(WorkingSet workingSet)
Sets the working set to use when filtering projects and project content.
|
void |
throwIfCancelled()
Throw CancellationException if the last audit to execute was cancelled.
|
public DefaultAuditor(ModelTypeFactory factory, java.lang.Class<? extends Analyzer>... analyzers)
public void addAuditListener(AuditListener listener)
AuditoraddAuditListener in class Auditorpublic void removeAuditListener(AuditListener listener)
AuditorremoveAuditListener in class Auditorpublic boolean isAuditable(Element element, Node node, Project project, Workspace workspace)
AuditorElement is auditable. An element is auditable if
an Audit model for it has been registered with Audit, and if the context
represented by the node, project, and workspace
is sufficient: an element contained by a node requires node, project, and
workspace; an element that is a node or directory requires project and
workspace or, for application content, just workspace; a element that is a
project requires just workspace, and an element that is a workspace
requires nothing.
If the node is not a Workspace, or Project, then if the
workspace is not null and not open, it will be opened and if the project is
not null and not open, it will be scanned for technologies and the
associated extensions will be loaded.
isAuditable in class Auditorelement - An Element corresponding to a construct in the
Audit object model.node - The Node containing the element. Ignored if
element is a node or directory.project - The project containing the element. Ignored if
element is a Workspace or
Project.workspace - The workspace containing the element. Ignored if
element is a Workspace.public boolean addElement(Element element, Node node, Project project, Workspace workspace)
AuditorElement to the set of
locations to be audited.
The location will not be added if the node is null, unless the element is
a Node or directory; if the project is null, unless the element is a project or
workspace; or if the workspace is null, unless the element is a workspace.
The location will not be added if the workspace is not null, and is not
cached by the NodeFactory or not contained by the
IDE; or if the project is not null, and is not cached by the NodeFactory or is not contained by the workspace.
If the node is not a Workspace, or Project, then if the
workspace is not null and not open, it will be opened; and if the project
is not null and not open, it will be scanned for technologies and the
associated extensions will be loaded.addElement in class Auditorelement - An Element corresponding to a construct in the
Audit object model.node - The Node containing the element. Ignored if
element is a node.project - The project containing the element. Ignored if
element is a Workspace or
Project.workspace - The workspace containing the element. Ignored if
element is a Workspace.Auditor.isAuditable(oracle.ide.model.Element, oracle.ide.model.Node, oracle.ide.model.Project, oracle.ide.model.Workspace)public boolean addNode(Node node, Project project, Workspace workspace)
AuditorNode to the set of
locations to be audited.
The location will not be added if the project is null, unless the url
node is a project or workspace; or if the workspace is null, unless the
node is a workspace. The location will not be added if the workspace is not
null, and is not cached by the NodeFactory or not
contained by the IDE; or if the project is not null, and is not cached by
the NodeFactory or is not contained by the workspace.
If the node is not a Workspace, or Project, then if the
workspace is not null and not open, it will be opened; and if the project
is not null and not open, it will be scanned for technologies and the
associated extensions will be loaded.public boolean addUrl(java.net.URL url,
Project project,
Workspace workspace)
AuditorNodeFactory or not contained by the IDE; or if the
project is not null, and is not cached by the NodeFactory or is
not contained by the workspace.
If the workspace is not null and not open, it will be opened. If the
project is not null and not open, it will be scanned for technologies and
the associated extensions will be loaded.public boolean addConstruct(java.lang.Object construct,
java.net.URL url,
Project project,
Workspace workspace)
AuditorNodeFactory or not contained by the IDE; or if the
project is not null, and is not cached by the NodeFactory or is
not contained by the workspace.
If the workspace is not null and not open, it will be opened. If the
project is not null and not open, it will be scanned for technologies and
the associated extensions will be loaded.addConstruct in class Auditorconstruct - A construct in the Audit object model (e.g., a Java object).url - The URL of the file containing the construct.project - The project containing the file.workspace - The workspace containing the file.public boolean cancel()
This method is typically called from a thread other than the auditing thread, often from the UI thread in response to a user action.
public void throwIfCancelled()
AuditorthrowIfCancelled in class Auditorpublic void clear()
Auditorpublic boolean isAuditableType(java.net.URL url)
AuditorURL is of an auditable type.isAuditableType in class Auditorpublic ModelFactory getFactory()
getFactory in class Auditorpublic Profile getProfile()
AuditorgetProfile in class Auditorpublic void setProfile(Profile profile)
AuditorsetProfile in class Auditorpublic void setAttribute(java.lang.Object key,
java.lang.Object value)
AuditorModelFactory.getAttribute method and to analyzers through the
AuditContext.getAttribute(oracle.jdeveloper.audit.analyzer.AuditContext.Key) method with a AuditContext.sharedKey(java.lang.Object)
Typically, configuration attributes are used to allow an IDE command that is implemented using Audit to provide command-specific attributes to a model adapter or analyzer.
setAttribute in class Auditorkey - An object, typically a java.lang.Class, which
uniquely identifies the attribute, used to create the
shared key.value - The possibly null value of the attribute.AuditContext.sharedKey(java.lang.Object),
AuditContext.getAttribute(oracle.jdeveloper.audit.analyzer.AuditContext.Key),
ModelFactory.getAttribute(java.lang.Object)public boolean isAuditing()
AuditorisAuditing in class Auditorpublic boolean isCancelled()
AuditorisCancelled in class Auditorpublic void setLockPolicy(LockPolicy policy)
AuditorsetLockPolicy in class Auditorpublic long getMaximumFileSize()
AuditorgetMaximumFileSize in class Auditorpublic void setMaximumFileSize(long size)
AuditorsetMaximumFileSize in class Auditorsize - The size, in Mb, of the largest file that can be audited.public void setWorkingSet(WorkingSet workingSet)
AuditorsetWorkingSet in class Auditorpublic WorkingSet getWorkingSet()
AuditorgetWorkingSet in class Auditorpublic IntersectedFilters getFileFilters()
AuditorgetFileFilters in class Auditorpublic void setFileFilters(IntersectedFilters filters)
AuditorsetFileFilters in class Auditorpublic void setIgnoreAssists(boolean ignore)
AuditorASSIST).setIgnoreAssists in class Auditorpublic boolean isIgnoreAssists()
AuditorASSIST).isIgnoreAssists in class Auditorpublic void setDependencyCollector(CompositeDependency collector)
AuditorsetDependencyCollector in class Auditorpublic void setVisitDescendants(boolean shallow)
AuditorvisitAncestors is true.setVisitDescendants in class AuditorAuditor.setVisitAncestors(boolean)public boolean isVisitDescendants()
AuditorisVisitDescendants in class AuditorAuditor.setVisitDescendants(boolean)public void setVisitAncestors(boolean shallow)
AuditorvisitAncestors is true.setVisitAncestors in class AuditorAuditor.setVisitAncestors(boolean)public boolean isVisitAncestors()
AuditorisVisitAncestors in class AuditorAuditor.setVisitAncestors(boolean)public void run()
AuditorAuditor.addElement(oracle.ide.model.Element, oracle.ide.model.Node, oracle.ide.model.Project, oracle.ide.model.Workspace), and
Auditor.addConstruct(java.lang.Object, java.net.URL, oracle.ide.model.Project, oracle.ide.model.Workspace). The results of the audit are passed to the audit
listeners added by Auditor.addAuditListener(oracle.jdeveloper.audit.service.AuditListener).public void runAsynchronously()
AuditorAuditor.addElement(oracle.ide.model.Element, oracle.ide.model.Node, oracle.ide.model.Project, oracle.ide.model.Workspace), and
Auditor.addConstruct(java.lang.Object, java.net.URL, oracle.ide.model.Project, oracle.ide.model.Workspace). The results of the audit are passed to the audit
listeners added by Auditor.addAuditListener(oracle.jdeveloper.audit.service.AuditListener).runAsynchronously in class Auditorpublic void runAsynchronously(java.lang.Thread.UncaughtExceptionHandler handler)
AuditorAuditor.addElement(oracle.ide.model.Element, oracle.ide.model.Node, oracle.ide.model.Project, oracle.ide.model.Workspace), and
Auditor.addConstruct(java.lang.Object, java.net.URL, oracle.ide.model.Project, oracle.ide.model.Workspace). The results of the audit are passed to the audit
listeners added by Auditor.addAuditListener(oracle.jdeveloper.audit.service.AuditListener).runAsynchronously in class Auditorpublic void audit()
AuditorAuditor.addElement(oracle.ide.model.Element, oracle.ide.model.Node, oracle.ide.model.Project, oracle.ide.model.Workspace), and
Auditor.addConstruct(java.lang.Object, java.net.URL, oracle.ide.model.Project, oracle.ide.model.Workspace). The results of the audit are passed to the audit
listeners added by Auditor.addAuditListener(oracle.jdeveloper.audit.service.AuditListener).public java.lang.Throwable applyDefaultTransforms(java.lang.String label)
AuditorTransformer.applyDefaultTransforms(java.lang.String, java.util.Collection<? extends oracle.jdeveloper.audit.service.Violation>, oracle.jdeveloper.audit.service.TransformerListener, oracle.jdeveloper.audit.service.AuditModel).
The locations audited are those added to this auditor by
Auditor.addElement(oracle.ide.model.Element, oracle.ide.model.Node, oracle.ide.model.Project, oracle.ide.model.Workspace), and Auditor.addConstruct(java.lang.Object, java.net.URL, oracle.ide.model.Project, oracle.ide.model.Workspace). The results of the audit
are passed to the audit listeners added by Auditor.addAuditListener(oracle.jdeveloper.audit.service.AuditListener).applyDefaultTransforms in class Auditorpublic void addDependency(Dependency dependency)