All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.dropwizard.health.conf.HealthConfiguration Maven / Gradle / Ivy

Go to download

Provides a health check implementation that performs ongoing monitoring of an application's dependencies and includes an endpoint that can be called by a load balancer to determine if the application is healthy and thus able to retrieve traffic.

The newest version!
package io.dropwizard.health.conf;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableList;
import io.dropwizard.health.conf.response.DefaultHealthServletFactory;
import io.dropwizard.health.conf.response.HealthServletFactory;
import io.dropwizard.util.Duration;

import java.util.Collections;
import java.util.List;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

public class HealthConfiguration {

    @Valid
    @NotNull
    @JsonProperty
    private List healthChecks = Collections.emptyList();

    @JsonProperty
    private boolean initialOverallState = true;

    @JsonProperty
    private boolean delayedShutdownHandlerEnabled = true;

    @NotNull
    @JsonProperty
    private Duration shutdownWaitPeriod = Duration.seconds(15);

    @NotNull
    @Size(min = 1)
    @JsonProperty
    private List healthCheckUrlPaths = ImmutableList.of("/health-check");

    @Valid
    @JsonProperty("servlet")
    private HealthServletFactory servletFactory = new DefaultHealthServletFactory();

    public List getHealthCheckConfigurations() {
        return healthChecks;
    }

    public void setHealthCheckConfigurations(final List healthChecks) {
        this.healthChecks = healthChecks;
    }

    public boolean isInitialOverallState() {
        return initialOverallState;
    }

    public void setInitialOverallState(boolean initialOverallState) {
        this.initialOverallState = initialOverallState;
    }

    public boolean isDelayedShutdownHandlerEnabled() {
        return delayedShutdownHandlerEnabled;
    }

    public void setDelayedShutdownHandlerEnabled(final boolean delayedShutdownHandlerEnabled) {
        this.delayedShutdownHandlerEnabled = delayedShutdownHandlerEnabled;
    }

    public Duration getShutdownWaitPeriod() {
        return shutdownWaitPeriod;
    }

    public void setShutdownWaitPeriod(final Duration shutdownWaitPeriod) {
        this.shutdownWaitPeriod = shutdownWaitPeriod;
    }

    public List getHealthCheckUrlPaths() {
        return healthCheckUrlPaths;
    }

    public void setHealthCheckUrlPaths(final List healthCheckUrlPaths) {
        this.healthCheckUrlPaths = healthCheckUrlPaths;
    }

    public HealthServletFactory getServletFactory() {
        return servletFactory;
    }

    public void setServletFactory(HealthServletFactory servletFactory) {
        this.servletFactory = servletFactory;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy