org.sonar.plugins.api.jobs
Class ResourceImpl

java.lang.Object
  extended by org.sonar.plugins.api.jobs.ResourceImpl
All Implemented Interfaces:
Resource

public class ResourceImpl
extends java.lang.Object
implements Resource


Constructor Summary
ResourceImpl(ch.hortis.sonar.model.Snapshot snapshot, DaoFacade dao)
           
 
Method Summary
 void addMeasure(ch.hortis.sonar.service.MeasureKey key, java.lang.Double value)
           
 void addMeasure(ch.hortis.sonar.service.MeasureKey key, java.lang.String value)
           
 void addMeasure(ch.hortis.sonar.model.Metric metric, java.lang.Double value)
           
 void addMeasure(ch.hortis.sonar.model.Metric metric, java.lang.String value)
           
 void clear()
           
 Event createEvent(java.lang.String name, java.lang.String description, java.lang.String category, java.util.Date date)
           
 Event createEventOnCurrentSnapshot(java.lang.String name, java.lang.String description, java.lang.String category)
           
 void deleteEvent(Event event)
           
 java.util.List<Resource> getChildren()
           
 java.util.List<Measure> getChildrenMeasures()
           
 java.util.List<Measure> getChildrenMeasures(ch.hortis.sonar.service.MeasureKey key)
           
 java.util.List<Measure> getChildrenMeasures(ch.hortis.sonar.model.Metric metric)
           
 java.util.Date getDate()
           
 java.util.List<Event> getEvents()
          All events, on projects only
 Measure getMeasure(ch.hortis.sonar.service.MeasureKey key)
           
 Measure getMeasure(ch.hortis.sonar.model.Metric metric)
           
 java.util.List<Measure> getMeasures()
           
 java.util.List<Measure> getMeasures(ch.hortis.sonar.service.MeasureKey key)
           
 java.util.List<Measure> getMeasures(ch.hortis.sonar.model.Metric metric)
           
 java.lang.Object getMeasureValue(ch.hortis.sonar.service.MeasureKey key, java.lang.Object defaultValue)
           
 java.lang.Object getMeasureValue(ch.hortis.sonar.model.Metric metric, java.lang.Object defaultValue)
           
 java.lang.String getName()
           
 java.lang.String getQualifier()
           
 java.util.List<ch.hortis.sonar.model.RuleFailure> getRuleFailures()
           
 java.lang.String getScope()
           
 ch.hortis.sonar.model.Snapshot getSnapshot()
           
 java.lang.String getVersion()
           
 boolean isClass()
           
 boolean isJavaTest()
           
 boolean isPackage()
           
 boolean isProject()
           
 boolean isRootProject()
           
 void keepChild(ResourceImpl node)
           
 java.util.List<ResourceImpl> loadChildren()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceImpl

public ResourceImpl(ch.hortis.sonar.model.Snapshot snapshot,
                    DaoFacade dao)
Method Detail

addMeasure

public void addMeasure(ch.hortis.sonar.service.MeasureKey key,
                       java.lang.Double value)
Specified by:
addMeasure in interface Resource

addMeasure

public void addMeasure(ch.hortis.sonar.service.MeasureKey key,
                       java.lang.String value)
Specified by:
addMeasure in interface Resource

addMeasure

public void addMeasure(ch.hortis.sonar.model.Metric metric,
                       java.lang.Double value)
Specified by:
addMeasure in interface Resource

addMeasure

public void addMeasure(ch.hortis.sonar.model.Metric metric,
                       java.lang.String value)
Specified by:
addMeasure in interface Resource

clear

public void clear()

createEvent

public Event createEvent(java.lang.String name,
                         java.lang.String description,
                         java.lang.String category,
                         java.util.Date date)
Specified by:
createEvent in interface Resource

createEventOnCurrentSnapshot

public Event createEventOnCurrentSnapshot(java.lang.String name,
                                          java.lang.String description,
                                          java.lang.String category)
Specified by:
createEventOnCurrentSnapshot in interface Resource

deleteEvent

public void deleteEvent(Event event)
Specified by:
deleteEvent in interface Resource

getChildren

public java.util.List<Resource> getChildren()
Specified by:
getChildren in interface Resource

getChildrenMeasures

public java.util.List<Measure> getChildrenMeasures()
Specified by:
getChildrenMeasures in interface Resource

getChildrenMeasures

public java.util.List<Measure> getChildrenMeasures(ch.hortis.sonar.service.MeasureKey key)
Specified by:
getChildrenMeasures in interface Resource

getChildrenMeasures

public java.util.List<Measure> getChildrenMeasures(ch.hortis.sonar.model.Metric metric)
Specified by:
getChildrenMeasures in interface Resource

getDate

public java.util.Date getDate()
Specified by:
getDate in interface Resource

getEvents

public java.util.List<Event> getEvents()
Description copied from interface: Resource
All events, on projects only

Specified by:
getEvents in interface Resource

getMeasure

public Measure getMeasure(ch.hortis.sonar.service.MeasureKey key)
Specified by:
getMeasure in interface Resource

getMeasure

public Measure getMeasure(ch.hortis.sonar.model.Metric metric)
Specified by:
getMeasure in interface Resource

getMeasures

public java.util.List<Measure> getMeasures()
Specified by:
getMeasures in interface Resource

getMeasures

public java.util.List<Measure> getMeasures(ch.hortis.sonar.service.MeasureKey key)
Specified by:
getMeasures in interface Resource

getMeasures

public java.util.List<Measure> getMeasures(ch.hortis.sonar.model.Metric metric)
Specified by:
getMeasures in interface Resource

getMeasureValue

public java.lang.Object getMeasureValue(ch.hortis.sonar.service.MeasureKey key,
                                        java.lang.Object defaultValue)
Specified by:
getMeasureValue in interface Resource

getMeasureValue

public java.lang.Object getMeasureValue(ch.hortis.sonar.model.Metric metric,
                                        java.lang.Object defaultValue)
Specified by:
getMeasureValue in interface Resource

getName

public java.lang.String getName()
Specified by:
getName in interface Resource

getQualifier

public java.lang.String getQualifier()
Specified by:
getQualifier in interface Resource

getRuleFailures

public java.util.List<ch.hortis.sonar.model.RuleFailure> getRuleFailures()
Specified by:
getRuleFailures in interface Resource

getScope

public java.lang.String getScope()
Specified by:
getScope in interface Resource

getSnapshot

public ch.hortis.sonar.model.Snapshot getSnapshot()

getVersion

public java.lang.String getVersion()
Specified by:
getVersion in interface Resource

isClass

public boolean isClass()
Specified by:
isClass in interface Resource

isJavaTest

public boolean isJavaTest()
Specified by:
isJavaTest in interface Resource

isPackage

public boolean isPackage()
Specified by:
isPackage in interface Resource

isProject

public boolean isProject()
Specified by:
isProject in interface Resource

isRootProject

public boolean isRootProject()
Specified by:
isRootProject in interface Resource

keepChild

public void keepChild(ResourceImpl node)

loadChildren

public java.util.List<ResourceImpl> loadChildren()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2008-2009 SonarSource SA. All Rights Reserved.