org.sonar.api.batch
Class SonarIndex

java.lang.Object
  extended by org.sonar.api.batch.SonarIndex
All Implemented Interfaces:
org.sonar.graph.DirectedGraphAccessor<Resource,Dependency>

Deprecated. since 4.5.2 should not be used by plugins.

@Deprecated
public abstract class SonarIndex
extends Object
implements org.sonar.graph.DirectedGraphAccessor<Resource,Dependency>


Constructor Summary
SonarIndex()
          Deprecated.  
 
Method Summary
abstract  Dependency addDependency(Dependency dependency)
          Deprecated.  
abstract  Event addEvent(Resource resource, String name, String description, String category, Date date)
          Deprecated.  
abstract  void addLink(ProjectLink link)
          Deprecated.  
abstract  Measure addMeasure(Resource resource, Measure measure)
          Deprecated. Warning: the resource is automatically indexed for backward-compatibility, but it should be explictly indexed before.
abstract  Resource addResource(Resource resource)
          Deprecated. since 2.6. Use methods index()
 void addViolation(Violation violation)
          Deprecated. in 3.6
abstract  void addViolation(Violation violation, boolean force)
          Deprecated. in 3.6
abstract  void deleteEvent(Event event)
          Deprecated.  
abstract  void deleteLink(String key)
          Deprecated.  
abstract  Collection<Resource> getChildren(Resource reference)
          Deprecated.  
abstract  Set<Dependency> getDependencies()
          Deprecated.  
abstract  List<Event> getEvents(Resource resource)
          Deprecated.  
 Collection<Dependency> getIncomingDependencies(Resource to)
          Deprecated.  
abstract  Measure getMeasure(Resource resource, Metric<?> metric)
          Deprecated.  
abstract
<M> M
getMeasures(Resource resource, MeasuresFilter<M> filter)
          Deprecated.  
 Collection<Dependency> getOutgoingDependencies(Resource from)
          Deprecated.  
abstract  Resource getParent(Resource reference)
          Deprecated.  
abstract  Project getProject()
          Deprecated.  
abstract
<R extends Resource>
R
getResource(R reference)
          Deprecated. Search for an indexed resource.
 Collection<Resource> getResources()
          Deprecated.  
abstract  String getSource(Resource resource)
          Deprecated.  
 List<Violation> getViolations(Resource resource)
          Deprecated. in 3.6
abstract  List<Violation> getViolations(ViolationQuery violationQuery)
          Deprecated. in 3.6
abstract  boolean index(Resource resource)
          Deprecated. Indexes a resource as a direct child of project.
abstract  boolean index(Resource resource, Resource parentReference)
          Deprecated. Indexes a resource.
abstract  boolean isExcluded(Resource reference)
          Deprecated. Returns true if the referenced resource is excluded.
abstract  boolean isIndexed(Resource reference, boolean acceptExcluded)
          Deprecated.  
abstract  void setSource(Resource reference, String source)
          Deprecated. since 4.2 should not be used by plugins
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sonar.graph.DirectedGraphAccessor
getEdge, getIncomingEdges, getOutgoingEdges, getVertices, hasEdge
 

Constructor Detail

SonarIndex

public SonarIndex()
Deprecated. 
Method Detail

index

public abstract boolean index(Resource resource)
Deprecated. 
Indexes a resource as a direct child of project. This method does nothing and returns true if the resource already indexed. If the method resource.getParent() does not return null, then this parent will be indexed too.

Returns:
false if the resource is excluded
Since:
2.6

index

public abstract boolean index(Resource resource,
                              Resource parentReference)
Deprecated. 
Indexes a resource. This method does nothing if the resource is already indexed.

Parameters:
resource - the resource to index. Not nullable
parentReference - a reference to the indexed parent. If null, the resource is indexed as a direct child of project.
Returns:
false if the parent is not indexed or if the resource is excluded
Since:
2.6

isExcluded

public abstract boolean isExcluded(Resource reference)
Deprecated. 
Returns true if the referenced resource is excluded. An excluded resource is not indexed.

Since:
2.6

isIndexed

public abstract boolean isIndexed(Resource reference,
                                  boolean acceptExcluded)
Deprecated. 
Since:
2.6

getResource

public abstract <R extends Resource> R getResource(R reference)
Deprecated. 
Search for an indexed resource.

Parameters:
reference - the resource reference
Returns:
the indexed resource, null if it's not indexed
Since:
1.10. Generic types since 2.6.

getParent

public abstract Resource getParent(Resource reference)
Deprecated. 
Since:
2.6

getChildren

public abstract Collection<Resource> getChildren(Resource reference)
Deprecated. 
Since:
2.6

setSource

@Deprecated
public abstract void setSource(Resource reference,
                                          String source)
Deprecated. since 4.2 should not be used by plugins

Save the source code of a file. The file must be have been indexed before. Note: the source stream is not closed.

Throws:
DuplicatedSourceException - if the source has already been set on this resource

getSource

@CheckForNull
public abstract String getSource(Resource resource)
Deprecated. 
Returns:
source code associated with a specified resource, null if not available (for example when sonar.importSources=false)
Since:
2.9

getProject

public abstract Project getProject()
Deprecated. 

getResources

public final Collection<Resource> getResources()
Deprecated. 

addResource

@Deprecated
public abstract Resource addResource(Resource resource)
Deprecated. since 2.6. Use methods index()

Indexes the resource.

Returns:
the indexed resource, even if it's excluded

getMeasure

@CheckForNull
public abstract Measure getMeasure(Resource resource,
                                                Metric<?> metric)
Deprecated. 

getMeasures

@CheckForNull
public abstract <M> M getMeasures(Resource resource,
                                               MeasuresFilter<M> filter)
Deprecated. 

getViolations

@Deprecated
public abstract List<Violation> getViolations(ViolationQuery violationQuery)
Deprecated. in 3.6

Returns the violations that match the ViolationQuery parameters.

Parameters:
violationQuery - the request parameters specified as a ViolationQuery
Returns:
the list of violations that match those parameters
Since:
2.8

getViolations

@Deprecated
public final List<Violation> getViolations(Resource resource)
Deprecated. in 3.6

Returns all the active (= non switched-off) violations found on the given resource. Equivalent to getViolations(ViolationQuery) called with ViolationQuery.create().forResource(resource).ignoreSwitchedOff(true) as a parameter.

Returns:
the list of violations
Since:
2.7

addViolation

@Deprecated
public abstract void addViolation(Violation violation,
                                             boolean force)
Deprecated. in 3.6

Since:
2.5

addViolation

@Deprecated
public final void addViolation(Violation violation)
Deprecated. in 3.6


addMeasure

public abstract Measure addMeasure(Resource resource,
                                   Measure measure)
Deprecated. 
Warning: the resource is automatically indexed for backward-compatibility, but it should be explictly indexed before. Next versions will deactivate this automatic indexation.


addDependency

public abstract Dependency addDependency(Dependency dependency)
Deprecated. 

getDependencies

public abstract Set<Dependency> getDependencies()
Deprecated. 

addLink

public abstract void addLink(ProjectLink link)
Deprecated. 

deleteLink

public abstract void deleteLink(String key)
Deprecated. 

getEvents

public abstract List<Event> getEvents(Resource resource)
Deprecated. 

deleteEvent

public abstract void deleteEvent(Event event)
Deprecated. 

addEvent

public abstract Event addEvent(Resource resource,
                               String name,
                               String description,
                               String category,
                               Date date)
Deprecated. 

getOutgoingDependencies

public final Collection<Dependency> getOutgoingDependencies(Resource from)
Deprecated. 

getIncomingDependencies

public final Collection<Dependency> getIncomingDependencies(Resource to)
Deprecated. 


Copyright © 2009–2015 SonarSource. All rights reserved.