updaed dependency at helidon-microprofile-health v2.2.2

This commit is contained in:
Francesco Mangiacrapa 2024-10-18 14:51:43 +02:00
parent 536c96e09f
commit 903a48923a
2 changed files with 11 additions and 100 deletions

View File

@ -161,12 +161,18 @@
<!-- <version>2.2</version> -->
<!-- </dependency> -->
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-health</artifactId>
<version>2.1.0</version>
</dependency>
<!-- <dependency> -->
<!-- <groupId>io.smallrye</groupId> -->
<!-- <artifactId>smallrye-health</artifactId> -->
<!-- <version>2.1.0</version> -->
<!-- </dependency> -->
<dependency>
<groupId>io.helidon.microprofile.health</groupId>
<artifactId>helidon-microprofile-health</artifactId>
<version>2.2.2</version>
</dependency>
<!-- Plugins related tests -->
<dependency>

View File

@ -1,95 +0,0 @@
package org.gcube.application.geoportal.service.rest.check;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import org.eclipse.microprofile.health.HealthCheckResponse;
import org.eclipse.microprofile.health.HealthCheckResponse.State;
import lombok.extern.slf4j.Slf4j;
/**
* The Class HealthCheckResponseGeoportalProvider.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Oct 16, 2024
*/
@Slf4j
public class HealthCheckResponseGeoportalProvider {
private String name;
private Optional<Map<String, Object>> data;
private Map<String, Object> myMap;
private State state;
/**
* Instantiates a new health check response geoportal provider.
*/
public HealthCheckResponseGeoportalProvider() {
}
/**
* Instantiates a new health check response geoportal provider.
*
* @param name the name
* @param status the status
* @param data the data
*/
public HealthCheckResponseGeoportalProvider(String name, State state, Optional<Map<String, Object>> data) {
this.name = name;
this.state = state;
this.data = data;
}
public String getName() {
return name;
}
public Optional<Map<String, Object>> getData() {
return data;
}
public State getState() {
return state;
}
public void setName(String name) {
this.name = name;
}
public void setState(State state) {
this.state = state;
}
/**
* With data.
*
* @param key the key
* @param value the value
*/
public void withData(String key, String value) {
if (myMap == null) {
myMap = new HashMap<>();
}
myMap.put(key, value);
}
/**
* Builds the health check response.
*
* @return the health check response
*/
public HealthCheckResponse buildHealthCheckResponse() {
if (myMap != null)
data = Optional.of(myMap);
log.info("data are: " + data);
return new HealthCheckResponse(name, state, data);
}
}