001/*
002 * Stallion Core: A Modern Web Framework
003 *
004 * Copyright (C) 2015 - 2016 Stallion Software LLC.
005 *
006 * This program is free software: you can redistribute it and/or modify it under the terms of the
007 * GNU General Public License as published by the Free Software Foundation, either version 2 of
008 * the License, or (at your option) any later version. This program is distributed in the hope that
009 * it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
011 * License for more details. You should have received a copy of the GNU General Public License
012 * along with this program.  If not, see <http://www.gnu.org/licenses/gpl-2.0.html>.
013 *
014 *
015 *
016 */
017
018package io.stallion.settings.childSections;
019
020import io.stallion.settings.SettingMeta;
021
022import java.util.ArrayList;
023import java.util.List;
024
025import static io.stallion.utils.Literals.list;
026
027
028public class DeploymentsConfig implements SettingsSection {
029    @SettingMeta
030    private String env = "prod";
031    @SettingMeta
032    List<String> hosts;
033    @SettingMeta
034    private String user = "";
035    @SettingMeta
036    private String rootFolder;
037    @SettingMeta
038    private int basePort = 12500;
039    @SettingMeta(cls= ArrayList.class)
040    private List<String> checkUrls = list("/");
041    @SettingMeta
042    private String domain;
043    @SettingMeta(cls=ArrayList.class)
044    private List<String> aliasDomains = list();
045
046    @SettingMeta(cls=ArrayList.class)
047    private List<String> redirectDomains = list();
048
049    @SettingMeta
050    private String sslCertChain = "";
051    @SettingMeta
052    private String sslPrivateKey = "";
053
054    @SettingMeta(valBoolean = false)
055    private Boolean redirectToSsl = false;
056
057
058    public String getEnv() {
059        return env;
060    }
061
062    public DeploymentsConfig setEnv(String env) {
063        this.env = env;
064        return this;
065    }
066
067    public List<String> getHosts() {
068        return hosts;
069    }
070
071    public DeploymentsConfig setHosts(List<String> hosts) {
072        this.hosts = hosts;
073        return this;
074    }
075
076    public String getUser() {
077        return user;
078    }
079
080    public void setUser(String user) {
081        this.user = user;
082    }
083
084    public String getRootFolder() {
085        return rootFolder;
086    }
087
088    public void setRootFolder(String rootFolder) {
089        this.rootFolder = rootFolder;
090    }
091
092    public int getBasePort() {
093        return basePort;
094    }
095
096    public void setBasePort(int basePort) {
097        this.basePort = basePort;
098    }
099
100    public List<String> getCheckUrls() {
101        return checkUrls;
102    }
103
104    public void setCheckUrls(List<String> checkUrls) {
105        this.checkUrls = checkUrls;
106    }
107
108    public String getDomain() {
109        return domain;
110    }
111
112    public void setDomain(String domain) {
113        this.domain = domain;
114    }
115
116    public List<String> getAliasDomains() {
117        return aliasDomains;
118    }
119
120    public void setAliasDomains(List<String> aliasDomains) {
121        this.aliasDomains = aliasDomains;
122    }
123
124    @Deprecated
125    public String getSslCrt() {
126        return sslCertChain;
127    }
128
129    @Deprecated
130    public void setSslCrt(String sslCrt) {
131        this.sslCertChain = sslCrt;
132    }
133
134    @Deprecated
135    public String getSslKey() {
136        return sslPrivateKey;
137    }
138
139    @Deprecated
140    public void setSslKey(String sslKey) {
141        this.sslPrivateKey = sslKey;
142    }
143
144    public String getSslCertChain() {
145        return sslCertChain;
146    }
147
148    public void setSslCertChain(String sslCrt) {
149        this.sslCertChain = sslCrt;
150    }
151
152    public String getSslPrivateKey() {
153        return sslPrivateKey;
154    }
155
156    public void setSslPrivateKey(String sslKey) {
157        this.sslPrivateKey = sslKey;
158    }
159
160    public Boolean getRedirectToSsl() {
161        return redirectToSsl;
162    }
163
164    public DeploymentsConfig setRedirectToSsl(Boolean redirectToSsl) {
165        this.redirectToSsl = redirectToSsl;
166        return this;
167    }
168
169
170    public List<String> getRedirectDomains() {
171        return redirectDomains;
172    }
173
174    public DeploymentsConfig setRedirectDomains(List<String> redirectDomains) {
175        this.redirectDomains = redirectDomains;
176        return this;
177    }
178}