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

systems.composable.dropwizard.cassandra.reconnection.ConstantReconnectionPolicyFactory Maven / Gradle / Ivy

The newest version!
package systems.composable.dropwizard.cassandra.reconnection;

import com.datastax.driver.core.policies.ConstantReconnectionPolicy;
import com.datastax.driver.core.policies.ReconnectionPolicy;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.dropwizard.util.Duration;

import javax.validation.constraints.NotNull;

/**
 * A factory for configuring and building {@link ConstantReconnectionPolicy} instances.
 * 

* Configuration Parameters: *

* * * * * * * * * * *
NameDefaultDescription
delayNo default. You must specify a delay.The constant delay between reconnection attempts.
*/ @JsonTypeName("constant") public class ConstantReconnectionPolicyFactory implements ReconnectionPolicyFactory { @NotNull private Duration delay; @JsonProperty public Duration getDelay() { return delay; } @JsonProperty public void setDelay(Duration delay) { this.delay = delay; } @Override public ReconnectionPolicy build() { return new ConstantReconnectionPolicy(delay.toMilliseconds()); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy