Project

General

Profile

1
package eu.dnetlib.parthenos.registry;
2

    
3
import eu.dnetlib.parthenos.publisher.ParthenosPublisherException;
4
import eu.dnetlib.parthenos.publisher.SaxonHelper;
5
import org.apache.commons.logging.Log;
6
import org.apache.commons.logging.LogFactory;
7
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.beans.factory.annotation.Value;
9
import org.springframework.stereotype.Component;
10

    
11
/**
12
 * Created by Alessia Bardi on 26/09/2017.
13
 *
14
 * @author Alessia Bardi
15
 */
16
@Component
17
public class RegistryClientFactory {
18

    
19
	private static final Log log = LogFactory.getLog(RegistryClientFactory.class);
20

    
21
	@Value("${gcube.registry.uri.base.default}")
22
	private String defaultBaseURI;
23

    
24
	@Autowired
25
	private SaxonHelper saxonHelper;
26
	@Autowired
27
	private GCubeResourceRegistrator gCubeResourceRegistrator;
28

    
29
	public RegistryClient getRegistryClient() throws ParthenosPublisherException {
30
		log.debug("Creating RegistryClient");
31
		return new RegistryClient(getSaxonHelper(), defaultBaseURI, getgCubeResourceRegistrator());
32
	}
33

    
34
	public SaxonHelper getSaxonHelper() {
35
		return saxonHelper;
36
	}
37

    
38
	public void setSaxonHelper(final SaxonHelper saxonHelper) {
39
		this.saxonHelper = saxonHelper;
40
	}
41

    
42
	public String getDefaultBaseURI() {
43
		return defaultBaseURI;
44
	}
45

    
46
	public void setDefaultBaseURI(final String defaultBaseURI) {
47
		this.defaultBaseURI = defaultBaseURI;
48
	}
49

    
50
	public GCubeResourceRegistrator getgCubeResourceRegistrator() {
51
		return gCubeResourceRegistrator;
52
	}
53

    
54
	public void setgCubeResourceRegistrator(final GCubeResourceRegistrator gCubeResourceRegistrator) {
55
		this.gCubeResourceRegistrator = gCubeResourceRegistrator;
56
	}
57
}
(5-5/6)