com.experoinc.dropwizard.tinkerpop.auth.PlainTextAuthFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dropwizard-tinkerpop Show documentation
Show all versions of dropwizard-tinkerpop Show documentation
A Dropwizard library to connect to Apache TinkerPop enabled graph servers
The newest version!
/*
* Copyright 2017 Expero, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.experoinc.dropwizard.tinkerpop.auth;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import org.apache.tinkerpop.gremlin.driver.AuthProperties;
import org.hibernate.validator.constraints.NotEmpty;
/**
* @author Chris Pounds
*/
@JsonTypeName("plainText")
public class PlainTextAuthFactory implements AuthFactory {
@NotEmpty
private String username;
@NotEmpty
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 AuthProperties build() {
return new AuthProperties()
.with(AuthProperties.Property.USERNAME, username)
.with(AuthProperties.Property.PASSWORD, password);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy