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 */
006
007package org.fcrepo.camel.common.config;
008
009import org.springframework.beans.factory.annotation.Value;
010import org.springframework.context.annotation.PropertySource;
011import org.springframework.context.annotation.PropertySources;
012
013
014/**
015 * A base class for property configs
016 *
017 * @author dbernstein
018 */
019@PropertySources({
020        @PropertySource(value = BasePropsConfig.DEFAULT_FCREPO_CAMEL_TOOLBOX_CONFIG_FILE_PROP_SOURCE,
021                ignoreResourceNotFound = true),
022        @PropertySource(value = BasePropsConfig.FCREPO_CAMEL_CONFIG_FILE_PROP_SOURCE, ignoreResourceNotFound = true)
023})
024public abstract class BasePropsConfig {
025
026    public static final String FCREPO_CAMEL_TOOLBOX_HOME_PROPERTY = "fcrepo-camel-toolbox.home";
027    public static final String DEFAULT_FCREPO_HOME_VALUE = "fcrepo-camel-toolbox-home";
028    public static final String DEFAULT_FCREPO_CAMEL_TOOLBOX_CONFIG_FILE_PROP_SOURCE =
029            "file:${" + FCREPO_CAMEL_TOOLBOX_HOME_PROPERTY + ":" + DEFAULT_FCREPO_HOME_VALUE +
030                    "}/config/fcrepo-camel-toolbox.properties";
031    public static final String FCREPO_CAMEL_CONFIG_FILE_PROPERTY = "fcrepo.camel.toolbox.config.file";
032    public static final String FCREPO_CAMEL_CONFIG_FILE_PROP_SOURCE =
033            "file:${" + FCREPO_CAMEL_CONFIG_FILE_PROPERTY + "}";
034
035    @Value("${error.maxRedeliveries:10}")
036    private int maxRedeliveries;
037
038    @Value("${fcrepo.baseUrl:http://localhost:8080/fcrepo/rest}")
039    private String fcrepoBaseUrl;
040
041    @Value("${fcrepo.authUsername:fedoraAdmin}")
042    private String fcrepoUsername;
043
044    @Value("${fcrepo.authPassword:fedoraAdmin}")
045    private String fcrepoPassword;
046
047    @Value("${fcrepo.authHost:localhost}")
048    private String fcrepoAuthHost;
049
050    public int getMaxRedeliveries() {
051        return maxRedeliveries;
052    }
053
054    public String getFcrepoBaseUrl() {
055        return fcrepoBaseUrl;
056    }
057
058    public String getFcrepoUsername() {
059        return fcrepoUsername;
060    }
061
062    public String getFcrepoPassword() {
063        return fcrepoPassword;
064    }
065
066    public String getFcrepoAuthHost() {
067        return fcrepoAuthHost;
068    }
069
070}