org.sonar.api.database.model
Class Snapshot

java.lang.Object
  extended by org.sonar.api.database.BaseIdentifiable
      extended by org.sonar.api.database.model.Snapshot
All Implemented Interfaces:
Serializable

public class Snapshot
extends BaseIdentifiable
implements Serializable

A class to map a snapshot with its hibernate model

See Also:
Serialized Form

Field Summary
static String STATUS_PROCESSED
          This status is set on the snapshot at the end of the batch
static String STATUS_UNPROCESSED
          This status is set on the snapshot at the beginning of the batch
 
Constructor Summary
Snapshot()
           
Snapshot(ResourceModel resource, boolean last, String status, Date date)
           
Snapshot(ResourceModel resource, Snapshot parent)
           
 
Method Summary
 boolean equals(Object obj)
           
 Date getBuildDate()
          Insertion date (technical)
 Date getCreatedAt()
           
 Integer getDepth()
           
 Boolean getLast()
           
 Integer getParentId()
           
 String getPath()
           
 Date getPeriod1Date()
           
 String getPeriod1Mode()
           
 String getPeriod1Param()
           
 Date getPeriod2Date()
           
 String getPeriod2Mode()
           
 String getPeriod2Param()
           
 Date getPeriod3Date()
           
 String getPeriod3Mode()
           
 String getPeriod3Param()
           
 Date getPeriod4Date()
           
 String getPeriod4Mode()
           
 String getPeriod4Param()
           
 Date getPeriod5Date()
           
 String getPeriod5Mode()
           
 String getPeriod5Param()
           
 Date getPeriodDate(int periodIndex)
           
 String getPeriodMode(int index)
           
 String getPeriodModeParameter(int periodIndex)
           
 Integer getPurgeStatus()
           
 String getQualifier()
           
 Integer getResourceId()
           
 Integer getRootId()
           
 Integer getRootProjectId()
           
 String getScope()
           
 String getStatus()
           
 String getVersion()
           
 int hashCode()
           
 Snapshot save(DatabaseSession session)
           
 Snapshot setBuildDate(Date d)
          Insertion date (technical)
 Snapshot setCreatedAt(Date createdAt)
           
 void setDepth(Integer depth)
          Sets the depth of the snapshot
 Snapshot setLast(Boolean last)
           
 Snapshot setParentId(Integer i)
           
 Snapshot setPath(String path)
           
 Snapshot setPeriod1Date(Date period1Date)
          For internal use.
 Snapshot setPeriod1Mode(String s)
          For internal use.
 Snapshot setPeriod1Param(String s)
          For internal use.
 Snapshot setPeriod2Date(Date period2Date)
          For internal use.
 Snapshot setPeriod2Mode(String s)
          For internal use.
 Snapshot setPeriod2Param(String s)
          For internal use.
 Snapshot setPeriod3Date(Date period3Date)
          For internal use.
 Snapshot setPeriod3Mode(String s)
          For internal use.
 Snapshot setPeriod3Param(String s)
          For internal use.
 Snapshot setPeriod4Date(Date period4Date)
          For internal use.
 Snapshot setPeriod4Mode(String s)
          For internal use.
 Snapshot setPeriod4Param(String s)
          For internal use.
 Snapshot setPeriod5Date(Date period5Date)
          For internal use.
 Snapshot setPeriod5Mode(String s)
          For internal use.
 Snapshot setPeriod5Param(String s)
          For internal use.
 Snapshot setPeriodDate(int periodIndex, Date d)
          For internal use.
 Snapshot setPeriodMode(int periodIndex, String s)
          For internal use.
 Snapshot setPeriodModeParameter(int periodIndex, String s)
          For internal use.
 Snapshot setPurgeStatus(Integer i)
           
 Snapshot setQualifier(String qualifier)
           
 Snapshot setResource(ResourceModel resource)
           
 Snapshot setResourceId(Integer resourceId)
           
 Snapshot setRootId(Integer i)
           
 Snapshot setRootProjectId(Integer rootProjectId)
           
 Snapshot setScope(String scope)
           
 Snapshot setStatus(String status)
           
 Snapshot setVersion(String version)
           
 String toString()
           
 
Methods inherited from class org.sonar.api.database.BaseIdentifiable
getId, setId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

STATUS_UNPROCESSED

public static final String STATUS_UNPROCESSED
This status is set on the snapshot at the beginning of the batch

See Also:
Constant Field Values

STATUS_PROCESSED

public static final String STATUS_PROCESSED
This status is set on the snapshot at the end of the batch

See Also:
Constant Field Values
Constructor Detail

Snapshot

public Snapshot()

Snapshot

public Snapshot(ResourceModel resource,
                Snapshot parent)

Snapshot

public Snapshot(ResourceModel resource,
                boolean last,
                String status,
                Date date)
Method Detail

save

public Snapshot save(DatabaseSession session)

getBuildDate

public Date getBuildDate()
Insertion date (technical)

Since:
2.14

setBuildDate

public Snapshot setBuildDate(Date d)
Insertion date (technical)

Since:
2.14

getCreatedAt

public Date getCreatedAt()

setCreatedAt

public Snapshot setCreatedAt(Date createdAt)

getResourceId

public Integer getResourceId()

setResourceId

public Snapshot setResourceId(Integer resourceId)

setResource

public final Snapshot setResource(ResourceModel resource)

getVersion

public String getVersion()

setVersion

public Snapshot setVersion(String version)

getParentId

public Integer getParentId()

setParentId

public Snapshot setParentId(Integer i)

getLast

public Boolean getLast()

setLast

public Snapshot setLast(Boolean last)

getStatus

public String getStatus()

setStatus

public Snapshot setStatus(String status)

getPurgeStatus

public Integer getPurgeStatus()
Since:
2.14

setPurgeStatus

public Snapshot setPurgeStatus(Integer i)
Since:
2.14

getScope

public String getScope()

setScope

public Snapshot setScope(String scope)

getQualifier

public String getQualifier()

setQualifier

public Snapshot setQualifier(String qualifier)

getRootId

public Integer getRootId()

setRootId

public Snapshot setRootId(Integer i)

getPath

public String getPath()

setPath

public Snapshot setPath(String path)

getDepth

public Integer getDepth()

getRootProjectId

public Integer getRootProjectId()

setRootProjectId

public Snapshot setRootProjectId(Integer rootProjectId)

setDepth

public void setDepth(Integer depth)
Sets the depth of the snapshot

Throws:
IllegalArgumentException - when depth is negative

getPeriod1Mode

public String getPeriod1Mode()

setPeriod1Mode

public Snapshot setPeriod1Mode(String s)
For internal use.

Since:
2.5

getPeriod2Mode

public String getPeriod2Mode()

setPeriod2Mode

public Snapshot setPeriod2Mode(String s)
For internal use.

Since:
2.5

getPeriod3Mode

public String getPeriod3Mode()

setPeriod3Mode

public Snapshot setPeriod3Mode(String s)
For internal use.

Since:
2.5

getPeriod4Mode

public String getPeriod4Mode()

setPeriod4Mode

public Snapshot setPeriod4Mode(String s)
For internal use.

Since:
2.5

getPeriod5Mode

public String getPeriod5Mode()

setPeriod5Mode

public Snapshot setPeriod5Mode(String s)
For internal use.

Since:
2.5

getPeriod1Param

public String getPeriod1Param()

setPeriod1Param

public Snapshot setPeriod1Param(String s)
For internal use.

Since:
2.5

getPeriod2Param

public String getPeriod2Param()

setPeriod2Param

public Snapshot setPeriod2Param(String s)
For internal use.

Since:
2.5

getPeriod3Param

public String getPeriod3Param()

setPeriod3Param

public Snapshot setPeriod3Param(String s)
For internal use.

Since:
2.5

getPeriod4Param

public String getPeriod4Param()

setPeriod4Param

public Snapshot setPeriod4Param(String s)
For internal use.

Since:
2.5

getPeriod5Param

public String getPeriod5Param()

setPeriod5Param

public Snapshot setPeriod5Param(String s)
For internal use.

Since:
2.5

getPeriod1Date

public Date getPeriod1Date()

setPeriod1Date

public Snapshot setPeriod1Date(Date period1Date)
For internal use.

Since:
2.5

getPeriod2Date

public Date getPeriod2Date()

setPeriod2Date

public Snapshot setPeriod2Date(Date period2Date)
For internal use.

Since:
2.5

getPeriod3Date

public Date getPeriod3Date()

setPeriod3Date

public Snapshot setPeriod3Date(Date period3Date)
For internal use.

Since:
2.5

getPeriod4Date

public Date getPeriod4Date()

setPeriod4Date

public Snapshot setPeriod4Date(Date period4Date)
For internal use.

Since:
2.5

getPeriod5Date

public Date getPeriod5Date()

setPeriod5Date

public Snapshot setPeriod5Date(Date period5Date)
For internal use.

Since:
2.5

setPeriodMode

public Snapshot setPeriodMode(int periodIndex,
                              String s)
For internal use.

Since:
2.5

getPeriodMode

public String getPeriodMode(int index)

setPeriodModeParameter

public Snapshot setPeriodModeParameter(int periodIndex,
                                       String s)
For internal use.

Since:
2.5

getPeriodModeParameter

public String getPeriodModeParameter(int periodIndex)

setPeriodDate

public Snapshot setPeriodDate(int periodIndex,
                              Date d)
For internal use.

Since:
2.5

getPeriodDate

public Date getPeriodDate(int periodIndex)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2014 SonarSource. All Rights Reserved.