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"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </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"> <classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
@ -18,13 +13,7 @@
<attribute name="test" value="true"/> <attribute name="test" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> <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"/>
<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">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>

View File

@ -1,8 +1,8 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled 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> <parent>
<artifactId>maven-parent</artifactId> <artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId> <groupId>org.gcube.tools</groupId>
<version>1.1.0</version> <version>1.2.0</version>
<relativePath /> <relativePath />
</parent> </parent>
@ -16,8 +16,8 @@
<name>gCube Health API</name> <name>gCube Health API</name>
<properties> <properties>
<maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.source>11</maven.compiler.source>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
@ -25,7 +25,7 @@
<dependency> <dependency>
<groupId>org.gcube.distribution</groupId> <groupId>org.gcube.distribution</groupId>
<artifactId>gcube-bom</artifactId> <artifactId>gcube-bom</artifactId>
<version>3.0.0-SNAPSHOT</version> <version>3.0.0</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>

View File

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

View File

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