added info to message

This commit is contained in:
lucio 2024-01-24 16:29:03 +01:00
parent 2384b66f2a
commit dee7f09173
5 changed files with 29 additions and 22 deletions

View File

@ -6,11 +6,6 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
@ -18,13 +13,7 @@
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>

View File

@ -1,8 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.source=11

View File

@ -4,7 +4,7 @@
<parent>
<artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId>
<version>1.1.0</version>
<version>1.2.0</version>
<relativePath />
</parent>
@ -16,8 +16,8 @@
<name>gCube Health API</name>
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
</properties>
<dependencyManagement>
@ -25,7 +25,7 @@
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>gcube-bom</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>

View File

@ -26,6 +26,8 @@ public class HealthCheckResponse {
//protected ErrorType errorType;
protected String errorMessage;
protected String info;
public Status getStatus() {
return status;
@ -39,5 +41,8 @@ public class HealthCheckResponse {
return errorMessage;
}
public String getInfo() {
return info;
}
}

View File

@ -16,11 +16,12 @@ public class HealthCheckResponseBuilder {
healthCheckResponse.name = name;
}
public BuildPart up() {
public SuccessPart up() {
healthCheckResponse.status = Status.UP;
return new BuildPart();
return new SuccessPart();
}
public ErrorPart down() {
healthCheckResponse.status = Status.DOWN;
return new ErrorPart();
@ -44,13 +45,25 @@ public class HealthCheckResponseBuilder {
private ErrorPart() {}
public BuildPart withMessage(String message) {
public BuildPart error(String message) {
healthCheckResponse.errorMessage = message;
return new BuildPart();
}
}
public class SuccessPart extends BuildPart{
private SuccessPart() {}
public BuildPart info(String info) {
healthCheckResponse.info = info;
return new BuildPart();
}
}
public class BuildPart{
private BuildPart() {};