Skip to content

Commit

Permalink
OPHYK-356 remove opintopolku-healthcheck-api
Browse files Browse the repository at this point in the history
  • Loading branch information
tokarls committed Nov 26, 2024
1 parent 806433d commit 1168f7c
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 41 deletions.
5 changes: 0 additions & 5 deletions legacy-caching-rest-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,6 @@

<dependencies>
<!-- Internal -->
<dependency>
<groupId>fi.vm.sade.java-utils</groupId>
<artifactId>opintopolku-healthcheck-api</artifactId>
<version>0.3.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>fi.vm.sade.java-utils</groupId>
<artifactId>java-legacy-cas</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import fi.vm.sade.javautils.cas.CasClient;
import fi.vm.sade.javautils.legacy_cxf_cas.PERA;
import fi.vm.sade.javautils.healthcheck.HealthChecker;
import fi.vm.sade.javautils.legacy_cxf_cas.ui.portlet.security.ProxyAuthenticator;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.io.IOUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package fi.vm.sade.javautils.legacy_caching_rest_client;

/**
* Healthcheckiin kuuluva tarkastaja, jonka roolina on tarkastaa yksi kohde healthcheckin yhteydessä.
* SpringAwareHealthCheckServlet kutsuu spring application contextista löytyviä tämän HealthChecker -interfacen toteuttavia beaneja.
* checkHealth -metodin palauttama objekti serialisoidaan JSON:ksi, ja liitetään healthcheckin checks -osioon kentäksi [beanName].
* Mikäli tarkastuksessa on virhe, checkHealth -metodin tulee heittää sitä poikkeus (jonka message kuvaa virhetilannetta).
* Tällöin poikkeuksen message liitetään healthcheck tulokseen, ja koko healthcheckin tila on ERREOR.
*
* Esim:
*
* @Component("solrIndexed")
* public class SolrIndexedCheck implements HealthChecker {
* Object checkHealth() throws Throwable {
* // tarkastetaan tässä onko solr indeksoitu
* return new LinkedHashMap(){{ put("status", "OK"); put("previouslyIndexed", timestamp); }}
* }
* }
*
* ...johtaa tällaiseen healthcheck tulokseen...
*
* {
* "status": "OK",
* "checks": {
* "solrIndexed": {"status": "OK", "timestamp": [timestamp]}
* }
* }
*
* @see SpringAwareHealthCheckServlet (in other module)
*/
public interface HealthChecker {
/**
* @return something json-serializable that describes the state of this checker
* @throws Throwable if there is health check error
*/
Object checkHealth() throws Throwable;
}
9 changes: 0 additions & 9 deletions legacy-cxf-cas/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
<dependencyManagement>
<dependencies>
<!-- Internal -->
<dependency>
<groupId>fi.vm.sade.java-utils</groupId>
<artifactId>opintopolku-healthcheck-api</artifactId>
<version>0.3.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>fi.vm.sade.java-utils</groupId>
<artifactId>java-legacy-cas</artifactId>
Expand Down Expand Up @@ -76,10 +71,6 @@

<dependencies>
<!-- Internal -->
<dependency>
<groupId>fi.vm.sade.java-utils</groupId>
<artifactId>opintopolku-healthcheck-api</artifactId>
</dependency>
<dependency>
<groupId>fi.vm.sade.java-utils</groupId>
<artifactId>java-legacy-cas</artifactId>
Expand Down
14 changes: 0 additions & 14 deletions opintopolku-healthcheck-api/pom.xml

This file was deleted.

1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<version>0.3.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>opintopolku-healthcheck-api</module>
<module>java-properties</module>
<module>oid-generator</module>
<module>tcp-utils</module>
Expand Down
11 changes: 1 addition & 10 deletions spring-aware-health-check-servlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<relativePath>..</relativePath>
</parent>
<artifactId>spring-aware-health-check-servlet</artifactId>
<version>0.5.0-SNAPSHOT</version>
<version>0.5.1-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencyManagement>
<dependencies>
Expand Down Expand Up @@ -73,11 +73,6 @@
<artifactId>legacy-caching-rest-client</artifactId>
<version>0.6.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>fi.vm.sade.java-utils</groupId>
<artifactId>opintopolku-healthcheck-api</artifactId>
<version>0.3.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>fi.vm.sade.java-utils</groupId>
<artifactId>java-cache</artifactId>
Expand Down Expand Up @@ -137,10 +132,6 @@
<groupId>fi.vm.sade.java-utils</groupId>
<artifactId>legacy-caching-rest-client</artifactId>
</dependency>
<dependency>
<groupId>fi.vm.sade.java-utils</groupId>
<artifactId>opintopolku-healthcheck-api</artifactId>
</dependency>
<dependency>
<groupId>fi.vm.sade.java-utils</groupId>
<artifactId>java-cache</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import fi.vm.sade.javautils.healthcheck.HealthChecker;
import fi.vm.sade.security.SimpleCache;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down

0 comments on commit 1168f7c

Please sign in to comment.