org.sonar.batch.index
Class DefaultIndex
java.lang.Object
org.sonar.api.batch.SonarIndex
org.sonar.batch.index.DefaultIndex
- All Implemented Interfaces:
- org.sonar.graph.DirectedGraphAccessor<Resource,Dependency>
public class DefaultIndex
- extends SonarIndex
|
Method Summary |
Dependency |
addDependency(Dependency dependency)
|
Event |
addEvent(Resource resource,
String name,
String description,
String category,
Date date)
|
void |
addLink(ProjectLink link)
|
Measure |
addMeasure(Resource resource,
Measure measure)
the measure is updated if it's already registered. |
Resource |
addResource(Resource resource)
Does nothing if the resource is already registered. |
void |
addViolation(Violation violation,
boolean force)
|
void |
clear()
Keep only project stuff |
void |
deleteEvent(Event event)
|
void |
deleteLink(String key)
|
List<Resource> |
getChildren(Resource resource)
|
List<Resource> |
getChildren(Resource resource,
boolean acceptExcluded)
|
Set<Dependency> |
getDependencies()
|
Dependency |
getEdge(Resource from,
Resource to)
|
List<Event> |
getEvents(Resource resource)
|
Collection<Dependency> |
getIncomingEdges(Resource to)
|
Measure |
getMeasure(Resource resource,
Metric metric)
|
|
getMeasures(Resource resource,
MeasuresFilter<M> filter)
|
Collection<Dependency> |
getOutgoingEdges(Resource from)
|
Resource |
getParent(Resource resource)
|
Project |
getProject()
|
|
getResource(R reference)
|
String |
getSource(Resource resource)
|
Set<Resource> |
getVertices()
|
List<Violation> |
getViolations(ViolationQuery violationQuery)
|
boolean |
hasEdge(Resource from,
Resource to)
|
boolean |
index(Resource resource)
|
boolean |
index(Resource resource,
Resource parentReference)
|
boolean |
isExcluded(Resource reference)
|
boolean |
isIndexed(Resource reference,
boolean acceptExcluded)
|
void |
setCurrentProject(Project project,
ResourceFilters resourceFilters,
ViolationFilters violationFilters,
RulesProfile profile)
|
void |
setSource(Resource reference,
String source)
|
void |
start()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultIndex
public DefaultIndex(PersistenceManager persistence,
DefaultResourceCreationLock lock,
ProjectTree projectTree,
MetricFinder metricFinder)
start
public void start()
getProject
public Project getProject()
- Specified by:
getProject in class SonarIndex
setCurrentProject
public void setCurrentProject(Project project,
ResourceFilters resourceFilters,
ViolationFilters violationFilters,
RulesProfile profile)
clear
public void clear()
- Keep only project stuff
getMeasure
public Measure getMeasure(Resource resource,
Metric metric)
- Specified by:
getMeasure in class SonarIndex
getMeasures
public <M> M getMeasures(Resource resource,
MeasuresFilter<M> filter)
- Specified by:
getMeasures in class SonarIndex
addMeasure
public Measure addMeasure(Resource resource,
Measure measure)
- the measure is updated if it's already registered.
- Specified by:
addMeasure in class SonarIndex
addDependency
public Dependency addDependency(Dependency dependency)
- Specified by:
addDependency in class SonarIndex
getDependencies
public Set<Dependency> getDependencies()
- Specified by:
getDependencies in class SonarIndex
getEdge
public Dependency getEdge(Resource from,
Resource to)
hasEdge
public boolean hasEdge(Resource from,
Resource to)
getVertices
public Set<Resource> getVertices()
getOutgoingEdges
public Collection<Dependency> getOutgoingEdges(Resource from)
getIncomingEdges
public Collection<Dependency> getIncomingEdges(Resource to)
getViolations
public List<Violation> getViolations(ViolationQuery violationQuery)
-
- Specified by:
getViolations in class SonarIndex
addViolation
public void addViolation(Violation violation,
boolean force)
- Specified by:
addViolation in class SonarIndex
addLink
public void addLink(ProjectLink link)
- Specified by:
addLink in class SonarIndex
deleteLink
public void deleteLink(String key)
- Specified by:
deleteLink in class SonarIndex
getEvents
public List<Event> getEvents(Resource resource)
- Specified by:
getEvents in class SonarIndex
deleteEvent
public void deleteEvent(Event event)
- Specified by:
deleteEvent in class SonarIndex
addEvent
public Event addEvent(Resource resource,
String name,
String description,
String category,
Date date)
- Specified by:
addEvent in class SonarIndex
setSource
public void setSource(Resource reference,
String source)
- Specified by:
setSource in class SonarIndex
getSource
public String getSource(Resource resource)
- Specified by:
getSource in class SonarIndex
addResource
public Resource addResource(Resource resource)
- Does nothing if the resource is already registered.
- Specified by:
addResource in class SonarIndex
getResource
public <R extends Resource> R getResource(R reference)
- Specified by:
getResource in class SonarIndex
getChildren
public List<Resource> getChildren(Resource resource)
- Specified by:
getChildren in class SonarIndex
getChildren
public List<Resource> getChildren(Resource resource,
boolean acceptExcluded)
getParent
public Resource getParent(Resource resource)
- Specified by:
getParent in class SonarIndex
index
public boolean index(Resource resource)
- Specified by:
index in class SonarIndex
index
public boolean index(Resource resource,
Resource parentReference)
- Specified by:
index in class SonarIndex
isExcluded
public boolean isExcluded(Resource reference)
- Specified by:
isExcluded in class SonarIndex
isIndexed
public boolean isIndexed(Resource reference,
boolean acceptExcluded)
- Specified by:
isIndexed in class SonarIndex
Copyright © 2009-2012 SonarSource. All Rights Reserved.