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

systems.composable.dropwizard.cassandra.loadbalancing.WhiteListPolicyFactory Maven / Gradle / Ivy

There is a newer version: 4.1.0
Show newest version
package systems.composable.dropwizard.cassandra.loadbalancing;

import com.datastax.driver.core.policies.LoadBalancingPolicy;
import com.datastax.driver.core.policies.WhiteListPolicy;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.net.InetSocketAddress;
import java.util.Collection;

/**
 * A factory for configuring and building {@link com.datastax.driver.core.policies.WhiteListPolicy} instances.
 * 

* Configuration Parameters: *

* * * * * * * * * * * * * * * *
NameDefaultDescription
subPolicyNo default. You must provide a child policy.The wrapped policy.
whiteListNo default.The white listed hosts.
*/ @JsonTypeName("whiteList") public class WhiteListPolicyFactory implements LoadBalancingPolicyFactory { @Valid @NotNull private LoadBalancingPolicyFactory subPolicy; @NotNull private Collection whiteList; @JsonProperty public LoadBalancingPolicyFactory getSubPolicy() { return subPolicy; } @JsonProperty public void setSubPolicy(LoadBalancingPolicyFactory subPolicy) { this.subPolicy = subPolicy; } @JsonProperty public Collection getWhiteList() { return whiteList; } @JsonProperty public void setWhiteList(Collection whiteList) { this.whiteList = whiteList; } @Override public LoadBalancingPolicy build() { return new WhiteListPolicy(subPolicy.build(), whiteList); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy