001/*
002 * The contents of this file are subject to the license and copyright
003 * detailed in the LICENSE and NOTICE files at the root of the source
004 * tree.
005 */
006package org.fcrepo.camel.indexing.triplestore;
007
008import org.apache.camel.builder.RouteBuilder;
009import org.apache.camel.component.http.HttpComponent;
010import org.fcrepo.camel.common.config.BasePropsConfig;
011import org.fcrepo.camel.common.config.ConditionOnPropertyTrue;
012import org.springframework.beans.factory.annotation.Value;
013import org.springframework.context.annotation.Bean;
014import org.springframework.context.annotation.Conditional;
015import org.springframework.context.annotation.Configuration;
016
017/**
018 * A configuration class for the triplestore Indexing service
019 *
020 * @author dbernstein
021 */
022@Configuration
023@Conditional(FcrepoTripleStoreIndexingConfig.TriplestoreIndexingEnabled.class)
024public class FcrepoTripleStoreIndexingConfig extends BasePropsConfig {
025
026    static final String TRIPLESTORE_INDEXING_ENABLED = "triplestore.indexing.enabled";
027
028    static class TriplestoreIndexingEnabled extends ConditionOnPropertyTrue {
029        TriplestoreIndexingEnabled() {
030            super(FcrepoTripleStoreIndexingConfig.TRIPLESTORE_INDEXING_ENABLED, false);
031        }
032    }
033
034    @Value("${triplestore.input.stream:broker:topic:fedora}")
035    private String inputStream;
036
037    @Value("${triplestore.reindex.stream:broker:queue:triplestore.reindex}")
038    private String reindexStream;
039
040    @Value("${triplestore.indexing.predicate:false}")
041    private boolean indexingPredicate;
042
043    @Value("${triplestore.namedGraph:}")
044    private String namedGraph;
045
046    @Value("${triplestore.filter.containers:http://localhost:8080/fcrepo/rest/audit}")
047    private String filterContainers;
048
049    @Value("${triplestore.prefer.include:}")
050    private String preferInclude;
051
052    @Value("${triplestore.prefer.omit:http://www.w3.org/ns/ldp#PreferContainment}")
053    private String preferOmit;
054
055    @Value("${triplestore.baseUrl:http://localhost:8080/fuseki/test/update}")
056    private String triplestoreBaseUrl;
057
058    @Value("${triplestore.authUsername:}")
059    private String triplestoreAuthUsername;
060
061    @Value("${triplestore.authPassword:}")
062    private String triplestoreAuthPassword;
063
064    public String getInputStream() {
065        return inputStream;
066    }
067
068    public String getReindexStream() {
069        return reindexStream;
070    }
071
072    public boolean isIndexingPredicate() {
073        return indexingPredicate;
074    }
075
076    public String getNamedGraph() {
077        return namedGraph;
078    }
079
080    public String getFilterContainers() {
081        return filterContainers;
082    }
083
084    public String getPreferInclude() {
085        return preferInclude;
086    }
087
088    public String getPreferOmit() {
089        return preferOmit;
090    }
091
092    public String getTriplestoreBaseUrl() {
093        return triplestoreBaseUrl;
094    }
095
096    public String getTriplestoreAuthUsername() {
097        return triplestoreAuthUsername;
098    }
099
100    public String getTriplestoreAuthPassword() {
101        return triplestoreAuthPassword;
102    }
103
104    @Bean(name = "http")
105    public HttpComponent http() {
106        return new HttpComponent();
107    }
108
109    @Bean(name = "https")
110    public HttpComponent https() {
111        return new HttpComponent();
112    }
113
114    @Bean
115    public RouteBuilder tripleStoreRoute() {
116        return new TriplestoreRouter();
117    }
118
119}