2019-12-12 12:58:30 +01:00
|
|
|
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;
|
2019-12-13 14:53:15 +01:00
|
|
|
@Value("${graphdb.baseURI}")
|
|
|
|
private String graphDBBaseURI;
|
|
|
|
@Value("${graphdb.writer.user}")
|
|
|
|
private String writerUser;
|
|
|
|
@Value("${graphdb.writer.pwd}")
|
|
|
|
private String writerPwd;
|
2019-12-12 12:58:30 +01:00
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private RecordParserHelper recordParserHelper;
|
|
|
|
|
|
|
|
public GraphDBClient getGraphDBClient() {
|
|
|
|
log.debug("Creating GraphDBClient for "+graphDBServerUrl);
|
2019-12-13 14:53:15 +01:00
|
|
|
return new GraphDBClient(recordParserHelper, graphDBServerUrl, graphDBBaseURI, writerUser, writerPwd);
|
2019-12-12 12:58:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2019-12-13 14:53:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
public String getGraphDBBaseURI() {
|
|
|
|
return graphDBBaseURI;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setGraphDBBaseURI(String graphDBBaseURI) {
|
|
|
|
this.graphDBBaseURI = graphDBBaseURI;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getWriterUser() {
|
|
|
|
return writerUser;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setWriterUser(String writerUser) {
|
|
|
|
this.writerUser = writerUser;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getWriterPwd() {
|
|
|
|
return writerPwd;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setWriterPwd(String writerPwd) {
|
|
|
|
this.writerPwd = writerPwd;
|
|
|
|
}
|
2019-12-12 12:58:30 +01:00
|
|
|
}
|