org.sonar.batch.index
Class DefaultResourcePersister

java.lang.Object
  extended by org.sonar.batch.index.DefaultResourcePersister
All Implemented Interfaces:
ResourcePersister

public final class DefaultResourcePersister
extends Object
implements ResourcePersister


Constructor Summary
DefaultResourcePersister(DatabaseSession session)
           
 
Method Summary
 void clear()
           
 Snapshot getLastSnapshot(Snapshot snapshot, boolean onlyOlder)
          The current snapshot which is flagged as "last", different then the current analysis.
 Snapshot getSnapshot(Resource reference)
           
 Snapshot getSnapshotOrFail(Resource resource)
           
 Snapshot saveProject(Project project, Project parent)
           
 Snapshot saveResource(Project project, Resource resource)
          Persist a resource in database.
 Snapshot saveResource(Project project, Resource resource, Resource parent)
          Persist a resource in database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultResourcePersister

public DefaultResourcePersister(DatabaseSession session)
Method Detail

saveProject

public Snapshot saveProject(Project project,
                            Project parent)
Specified by:
saveProject in interface ResourcePersister

getSnapshot

public Snapshot getSnapshot(Resource reference)
Specified by:
getSnapshot in interface ResourcePersister

getSnapshotOrFail

public Snapshot getSnapshotOrFail(Resource resource)
                           throws ResourceNotPersistedException
Specified by:
getSnapshotOrFail in interface ResourcePersister
Throws:
ResourceNotPersistedException - if the resource is not persisted.

saveResource

public Snapshot saveResource(Project project,
                             Resource resource)
Description copied from interface: ResourcePersister
Persist a resource in database. Returns null if the resource must not be persisted (scope lower than file)

Specified by:
saveResource in interface ResourcePersister

saveResource

public Snapshot saveResource(Project project,
                             Resource resource,
                             Resource parent)
Description copied from interface: ResourcePersister
Persist a resource in database. Returns null if the resource must not be persisted (scope lower than file)

Specified by:
saveResource in interface ResourcePersister

getLastSnapshot

public Snapshot getLastSnapshot(Snapshot snapshot,
                                boolean onlyOlder)
Description copied from interface: ResourcePersister
The current snapshot which is flagged as "last", different then the current analysis.

Specified by:
getLastSnapshot in interface ResourcePersister
onlyOlder - true if the result must be anterior to the snapshot parameter

clear

public void clear()
Specified by:
clear in interface ResourcePersister


Copyright © 2009-2011 SonarSource. All Rights Reserved.