Skip to content

Commit

Permalink
Use DataverseHealthCheck from dans-java-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
janvanmansum committed Jun 18, 2024
1 parent 604fae1 commit 2686495
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import io.dropwizard.core.setup.Environment;
import io.dropwizard.forms.MultiPartBundle;
import nl.knaw.dans.lib.util.ClientProxyBuilder;
import nl.knaw.dans.lib.util.DataverseHealthCheck;
import nl.knaw.dans.validatedansbag.client.VaultCatalogClientImpl;
import nl.knaw.dans.validatedansbag.config.DdValidateDansBagConfiguration;
import nl.knaw.dans.validatedansbag.core.engine.RuleEngineImpl;
Expand All @@ -39,7 +40,6 @@
import nl.knaw.dans.validatedansbag.core.validator.LicenseValidatorImpl;
import nl.knaw.dans.validatedansbag.core.validator.OrganizationIdentifierPrefixValidatorImpl;
import nl.knaw.dans.validatedansbag.core.validator.PolygonListValidatorImpl;
import nl.knaw.dans.validatedansbag.health.DataverseHealthCheck;
import nl.knaw.dans.validatedansbag.health.XmlSchemaHealthCheck;
import nl.knaw.dans.validatedansbag.resources.IllegalArgumentExceptionMapper;
import nl.knaw.dans.validatedansbag.resources.ValidateOkYamlMessageBodyWriter;
Expand Down Expand Up @@ -69,8 +69,9 @@ public void run(final DdValidateDansBagConfiguration configuration, final Enviro

DataverseService dataverseService = null;

var dataverseClient = configuration.getDataverse().build(environment, "dd-validate-dans-bag/dataverse");
if (configuration.getDataverse() != null) {
dataverseService = new DataverseServiceImpl(configuration.getDataverse().build(environment, "dd-validate-dans-bag/dataverse"));
dataverseService = new DataverseServiceImpl(dataverseClient);
}

var vaultCatalogClient = getVaultCatalogClient(configuration);
Expand Down Expand Up @@ -110,7 +111,7 @@ public void run(final DdValidateDansBagConfiguration configuration, final Enviro
environment.jersey().register(new ValidateOkYamlMessageBodyWriter());

environment.healthChecks().register("xml-schemas", new XmlSchemaHealthCheck(xmlSchemaValidator));
environment.healthChecks().register("dataverse", new DataverseHealthCheck(dataverseService));
environment.healthChecks().register("dataverse", new DataverseHealthCheck(dataverseClient));
}

private void validateContextConfiguration(DdValidateDansBagConfiguration configuration) {
Expand Down

This file was deleted.

0 comments on commit 2686495

Please sign in to comment.