com.experoinc.dropwizard.tinkerpop.serializers.GraphSONMessageSerializerGremlinV1d0Factory 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!
package com.experoinc.dropwizard.tinkerpop.serializers;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
import org.apache.tinkerpop.gremlin.driver.ser.AbstractGraphSONMessageSerializerV1d0;
import org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0;
import javax.validation.constraints.NotNull;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author Ted Wilmes
*/
@JsonTypeName("graphSONMessageSerializerGremlinV1d0")
public class GraphSONMessageSerializerGremlinV1d0Factory implements MessageSerializerFactory {
@NotNull
private List ioRegistries = Collections.emptyList();
@JsonProperty
public List getIoRegistries() {
return ioRegistries;
}
@JsonProperty
public void setIoRegistries(List ioRegistries) {
this.ioRegistries = ioRegistries;
}
@Override
public MessageSerializer build() {
Map config = new HashMap<>();
config.put(AbstractGraphSONMessageSerializerV1d0.TOKEN_IO_REGISTRIES, ioRegistries);
GraphSONMessageSerializerGremlinV1d0 serializer = new GraphSONMessageSerializerGremlinV1d0();
serializer.configure(config, null);
return serializer;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy