systems.composable.dropwizard.cassandra.auth.PlainTextAuthProviderFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dropwizard-cassandra Show documentation
Show all versions of dropwizard-cassandra Show documentation
Cassandra library for Dropwizard
package systems.composable.dropwizard.cassandra.auth;
import com.datastax.driver.core.AuthProvider;
import com.datastax.driver.core.PlainTextAuthProvider;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import javax.validation.constraints.NotNull;
/**
* A factory for configuring and building {@link PlainTextAuthProvider} instances.
*
* Configuration Parameters:
*
*
* Name
* Default
* Description
*
*
* username
* No default. You must define a username.
* The username to authenticate with.
*
*
* password
* No default. You must define a password.
* The password to authenticate with.
*
*
*/
@JsonTypeName("plainText")
public class PlainTextAuthProviderFactory implements AuthProviderFactory {
@NotNull
private String username;
@NotNull
private String password;
@JsonProperty
public String getUsername() {
return username;
}
@JsonProperty
public void setUsername(String username) {
this.username = username;
}
@JsonProperty
public String getPassword() {
return password;
}
@JsonProperty
public void setPassword(String password) {
this.password = password;
}
@Override
public AuthProvider build() {
return new PlainTextAuthProvider(username, password);
}
}