public class SonarQualityGateServiceImpl extends Object implements SonarQualityGateService
| Modifier and Type | Field and Description |
|---|---|
static String |
QUALITY_GATE_QUERY_URL |
DATE_TIME_FORMATTER| Constructor and Description |
|---|
SonarQualityGateServiceImpl(org.apache.maven.plugin.logging.Log logger) |
| Modifier and Type | Method and Description |
|---|---|
String |
composeSonarProjectKey(org.apache.maven.project.MavenProject project,
String projectKey,
String branchName)
Compose the project key used by SONAR based on the project key and an optional branch name.
|
java.time.LocalDateTime |
getLastRunTimeStamp(org.sonar.wsclient.SonarClient client,
String projectKey,
String qualityGateName)
Get the timestamp of the last sonar run.
|
void |
handleQualityGateState(org.sonar.wsclient.SonarClient client,
String projectKey) |
void |
linkQualityGateToProject(org.sonar.wsclient.SonarClient client,
String projectKey,
String qualityGateName)
Link the given the given quality gate (i.e.
|
boolean |
qualityGateDetailsExists(org.sonar.wsclient.SonarClient client,
String projectKey) |
void |
validateQualityGate(org.sonar.wsclient.SonarClient client,
String projectKey,
String qualityGateName,
java.time.LocalDateTime executionStart,
int secondsToWait)
Validate if the quality gate linked to the given project is passed.
|
protected void |
waitForNewPublishingOfSonarResults(org.sonar.wsclient.SonarClient client,
String projectKey,
String qualityGateName,
java.time.LocalDateTime executionStart,
int secondsToWait) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvalidateQualityGatepublic static final String QUALITY_GATE_QUERY_URL
public SonarQualityGateServiceImpl(org.apache.maven.plugin.logging.Log logger)
public void validateQualityGate(org.sonar.wsclient.SonarClient client,
String projectKey,
String qualityGateName,
java.time.LocalDateTime executionStart,
int secondsToWait)
throws SonarQualityException
SonarQualityGateServicevalidateQualityGate in interface SonarQualityGateServiceSonarQualityException - will be thrown when the given project doesn't pass the linked quality gate.public void handleQualityGateState(org.sonar.wsclient.SonarClient client,
String projectKey)
throws SonarQualityException
SonarQualityExceptionprotected final void waitForNewPublishingOfSonarResults(org.sonar.wsclient.SonarClient client,
String projectKey,
String qualityGateName,
java.time.LocalDateTime executionStart,
int secondsToWait)
throws SonarQualityException
SonarQualityExceptionpublic boolean qualityGateDetailsExists(org.sonar.wsclient.SonarClient client,
String projectKey)
public void linkQualityGateToProject(org.sonar.wsclient.SonarClient client,
String projectKey,
String qualityGateName)
throws SonarQualityException
SonarQualityGateServicelinkQualityGateToProject in interface SonarQualityGateServiceSonarQualityException - will be thrown when something goes wrong while linking the quality gate to the project.public java.time.LocalDateTime getLastRunTimeStamp(org.sonar.wsclient.SonarClient client,
String projectKey,
String qualityGateName)
throws SonarQualityException
SonarQualityGateServicegetLastRunTimeStamp in interface SonarQualityGateServiceSonarQualityException - will be thrown when something goes wrong while fetching the last run timestamp.public String composeSonarProjectKey(org.apache.maven.project.MavenProject project, String projectKey, String branchName)
SonarQualityGateServicecomposeSonarProjectKey in interface SonarQualityGateServiceCopyright © 2016. All rights reserved.