AriadnePlus/dnet-ariadneplus-graphdb-pu.../src/main/java/eu/dnetlib/ariadneplus/graphdb/GraphDBClientFactory.java

49 lines
1.2 KiB
Java

package eu.dnetlib.ariadneplus.graphdb;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import eu.dnetlib.ariadneplus.rdf.RecordParserHelper;
/**
* @author enrico.ottonello
*
*/
@Component
public class GraphDBClientFactory {
private static final Log log = LogFactory.getLog(GraphDBClientFactory.class);
@Value("${graphdb.serverUrl}")
private String graphDBServerUrl;
@Autowired
private RecordParserHelper recordParserHelper;
public GraphDBClient getGraphDBClient() {
log.debug("Creating GraphDBClient for "+graphDBServerUrl);
return new GraphDBClient(recordParserHelper, graphDBServerUrl);
}
public RecordParserHelper getRecordParserHelper() {
return recordParserHelper;
}
public void setRecordParserHelper(final RecordParserHelper recordParserHelper) {
this.recordParserHelper = recordParserHelper;
}
public String getGraphDBServerUrl() {
return graphDBServerUrl;
}
public void setGraphDBServerUrl(String graphDBServerUrl) {
this.graphDBServerUrl = graphDBServerUrl;
}
}