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

io.dropwizard.cassandra.protocolVersion.DefaultProtocolVersionFactory Maven / Gradle / Ivy

Go to download

Provides easy integration for Dropwizard applications with Apache Cassandra using the DataStax 4.x client

There is a newer version: 4.0.0
Show newest version
package io.dropwizard.cassandra.protocolVersion;

import com.datastax.oss.driver.api.core.DefaultProtocolVersion;
import com.datastax.oss.driver.api.core.config.DefaultDriverOption;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.dropwizard.cassandra.DropwizardProgrammaticDriverConfigLoaderBuilder;

@JsonTypeName("default")
public class DefaultProtocolVersionFactory implements ProtocolVersionFactory {
    private DefaultProtocolVersion version;

    public DefaultProtocolVersion getVersion() {
        return version;
    }

    public void setVersion(DefaultProtocolVersion version) {
        this.version = version;
    }

    @Override
    public void accept(DropwizardProgrammaticDriverConfigLoaderBuilder configLoaderBuilder) {
        configLoaderBuilder.withNullSafeString(DefaultDriverOption.PROTOCOL_VERSION, version.name());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy