|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.1.0) E17493-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.jdeveloper.audit.service.Auditor oracle.jdevimpl.audit.core.DefaultAuditor
public final class DefaultAuditor
The default Auditor
implementation.
Constructor Summary | |
---|---|
DefaultAuditor(ModelTypeFactory factory,
java.lang.Class<? extends Analyzer>... analyzers)
|
Method Summary | |
---|---|
void |
addAuditListener(AuditListener listener)
Adds an audit listener to this auditor. |
boolean |
addConstruct(java.lang.Object construct,
java.net.URL file,
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 |
addElements(Element[] elements,
Node node,
Project project,
Workspace workspace)
Adds the locations corresponding to an array of Element s
in a Node 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 document,
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 |
cancelReport()
|
void |
clear()
Clears the results and locations from this auditor. |
void |
endReport()
|
ModelFactory |
getFactory()
Gets the factory used for this audit. |
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. |
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. |
ViolationReport |
report(AuditContext context,
Rule rule,
Location location,
java.lang.Object construct)
|
void |
report(Metric metric,
Location location,
java.lang.Object measurement)
|
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 |
setIgnoreAssists(boolean ignore)
Sets whether to ignore issues corresponding to assists (severity ASSIST ). |
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. |
void |
setWriteLockRequestListener(WriteLockRequestListener listener)
Sets the listener to notify if a thread waits to acquire the write lock. |
void |
throwIfCancelled()
Throw CancellationException if the last audit to execute was cancelled. |
void |
tryAudit()
Audits the locations of this auditor in the current thread if the models for those locations are available without blocking. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultAuditor(ModelTypeFactory factory, java.lang.Class<? extends Analyzer>... analyzers)
Method Detail |
---|
public void addAuditListener(AuditListener listener)
Auditor
addAuditListener
in class Auditor
public void removeAuditListener(AuditListener listener)
Auditor
removeAuditListener
in class Auditor
public boolean isAuditable(Element element, Node node, Project project, Workspace workspace)
Auditor
Element
is auditable. An element is auditable if
is of an auditable type, and if the context represented by the node,
project, workspace is adequate.
If the workspace is not null, it must be open; if the project is not null, it must be open; if the node is not null, it must be open. Since this is a new stipulation, only a warning is logged currently.
isAuditable
in class Auditor
element
- 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
.public boolean addElement(Element element, Node node, Project project, Workspace workspace)
Auditor
Element
to the set of
locations to be audited. The location will not be added if the element is
not auditable.
If the workspace is not null, it must be open; if the project is not null, it must be open; if the node is not null, it must be open. Since this is a new stipulation, only a warning is logged currently.
addElement
in class Auditor
element
- 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 addElements(Element[] elements, Node node, Project project, Workspace workspace)
Auditor
Element
s
in a Node
to the set of locations to be audited. Locations for
elements which are not auditable will not be added.
If the workspace is not null, it must be open; if the project is not null, it must be open; if the node is not null, it must be open. Since this is a new stipulation, only a warning is logged currently.
addElements
in class Auditor
elements
- An array of Element
s each corresponding to a
construct in the Audit object model.node
- The Node
containing the elements.project
- The project containing the elements. Ignored for any
element
which is a Workspace
or
Project
.workspace
- The workspace containing the elements. Ignored for any
element
which 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)
Auditor
Node
to the set of
locations to be audited. The location will not be added if the project is
null, unless the node is a project or workspace; or if the workspace
is null, unless the node is a workspace.
If the workspace is not null, it must be open; if the project is not null, it must be open. Since this is a new stipulation, only a warning is logged currently.
addNode
in class Auditor
node
- A Node
in the Audit object model.project
- The project containing the node. Ignored if node
is a Workspace
or Project
.workspace
- The workspace containing the node. Ignored if node
is a Workspace
.
public boolean addConstruct(java.lang.Object construct, java.net.URL file, Project project, Workspace workspace)
Auditor
The workspace and project must be open. Since this is a new stipulation, only a warning is logged currently.
addConstruct
in class Auditor
construct
- A construct in the Audit object model (e.g., a Java object).file
- The URL of the file containing the construct.project
- The project containing the file.workspace
- The workspace containing the file.
public boolean addUrl(java.net.URL document, Project project, Workspace workspace)
Auditor
addUrl
in class Auditor
document
- The URL of a file or directory in the Audit object model.project
- The project containing the file.workspace
- The workspace containing the file.
public boolean cancel()
Auditor
cancel
in class Auditor
public void throwIfCancelled()
Auditor
throwIfCancelled
in class Auditor
public void clear()
Auditor
clear
in class Auditor
public boolean isAuditableType(java.net.URL url)
Auditor
URL
is of an auditable type.
isAuditableType
in class Auditor
public ModelFactory getFactory()
getFactory
in class Auditor
public Profile getProfile()
Auditor
getProfile
in class Auditor
public void setProfile(Profile profile)
Auditor
setProfile
in class Auditor
public void setAttribute(java.lang.Object key, java.lang.Object value)
Auditor
ModelFactory.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 Auditor
key
- 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()
Auditor
isAuditing
in class Auditor
public boolean isCancelled()
Auditor
isCancelled
in class Auditor
public long getMaximumFileSize()
Auditor
getMaximumFileSize
in class Auditor
public void setMaximumFileSize(long size)
Auditor
setMaximumFileSize
in class Auditor
size
- The size, in Mb, of the largest file that can be audited.public void setWorkingSet(WorkingSet workingSet)
Auditor
setWorkingSet
in class Auditor
public WorkingSet getWorkingSet()
Auditor
getWorkingSet
in class Auditor
public void setIgnoreAssists(boolean ignore)
Auditor
ASSIST
).
setIgnoreAssists
in class Auditor
public boolean isIgnoreAssists()
Auditor
ASSIST
).
isIgnoreAssists
in class Auditor
public void setWriteLockRequestListener(WriteLockRequestListener listener)
Auditor
setWriteLockRequestListener
in class Auditor
listener
- The listener to notify if a thread waits to acquire the
write lock, or null if none.public void setDependencyCollector(CompositeDependency collector)
Auditor
setDependencyCollector
in class Auditor
public void setVisitDescendants(boolean shallow)
Auditor
visitAncestors
is true.
setVisitDescendants
in class Auditor
Auditor.setVisitAncestors(boolean)
public boolean isVisitDescendants()
Auditor
isVisitDescendants
in class Auditor
Auditor.setVisitDescendants(boolean)
public void setVisitAncestors(boolean shallow)
Auditor
visitAncestors
is true.
setVisitAncestors
in class Auditor
Auditor.setVisitAncestors(boolean)
public boolean isVisitAncestors()
Auditor
isVisitAncestors
in class Auditor
Auditor.setVisitAncestors(boolean)
public void run()
Auditor
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)
.
run
in interface java.lang.Runnable
run
in class Auditor
public void runAsynchronously()
Auditor
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)
.
runAsynchronously
in class Auditor
public void runAsynchronously(java.lang.Thread.UncaughtExceptionHandler handler)
Auditor
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)
.
runAsynchronously
in class Auditor
public void audit()
Auditor
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)
.
audit
in class Auditor
public void tryAudit()
Auditor
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)
.
tryAudit
in class Auditor
public java.lang.Throwable applyDefaultTransforms(java.lang.String label)
Auditor
Transformer.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 Auditor
public void addDependency(Dependency dependency)
public ViolationReport report(AuditContext context, Rule rule, Location location, java.lang.Object construct)
public void endReport()
public void cancelReport()
public void report(Metric metric, Location location, java.lang.Object measurement)
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.1.0) E17493-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |