This repository has been archived by the owner on Jan 31, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Conf.java
219 lines (148 loc) · 6.9 KB
/
Conf.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
/*
* Copyright (c) 2013 GigaSpaces Technologies Ltd. All rights reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package beans.config;
import beans.GsMailer;
import utils.Utils;
import java.io.File;
import java.util.LinkedList;
import java.util.List;
/**
* User: guym
* Date: 12/13/12
* Time: 1:32 PM
*/
public class Conf {
public ApplicationConfiguration application = new ApplicationConfiguration();
public SmtpConf smtp = new SmtpConf();
public Mails mails = new Mails();
public AsyncExecutionConf asyncExecution = new AsyncExecutionConf();
public ResourceConfig resources = new ResourceConfig();
// who is sending the mail?
public GsMailer.Mailer mailer = new GsMailer.Mailer();
@Config( ignoreNullValues = true )
public String demoUserEmailSuffix = "_demo@gigaspaces.com";
public ServerConfig server = new ServerConfig();
public FeaturesConfig features = new FeaturesConfig();
public MailChimpDetails mailChimpDetails = new MailChimpDetails();
public SettingsConfig settings = new SettingsConfig();
@Config(ignoreNullValues = true)
public boolean sendErrorEmails = false;
@Config( playKey = "spring.context")
public String springContext = null;
public CloudifyConfiguration cloudify = new CloudifyConfiguration();
public String mixpanelApiKey = null;
@Config(playKey = "application.secret")
public String applicationSecret;
public UiConf uiConf = new UiConf();
public static class SettingsConfig{
@Config( ignoreNullValues = true )
public boolean expireSession = false; // do not use the session expired mechanism.
public InitialData initialData = new InitialData();
public boolean isRecoverExecutions = true;
@Config(ignoreNullValues = true)
public long stopTimeout = Utils.parseTimeToMillis( "30s" );
public Boolean globalSecurityCheck = false; // todo : switch this on once feature is completed.
public TimeoutValues timeoutValues = new TimeoutValues();
public String applicationName = "Cloudify-Widget";
}
// conversion widget extensions for registered users.
public static class TimeoutValues{
@Config(ignoreNullValues = true)
public long registered = Utils.parseTimeToMillis("7d");
@Config(ignoreNullValues = true)
public long verified = Utils.parseTimeToMillis("30d");
}
public static class InitialData{
@Config( ignoreNullValues = true )
public boolean load = true ;
public String defaultPassword = "Initial4657"; // if we need to create users, we will use this password by default.
@Config( ignoreNullValues = true )
public boolean override = false; // true iff we want to write over existing objects
}
public static class FeaturesConfigItem {
public String users = ".*"; // all users by default
@Config( ignoreNullValues = true )
public boolean on = false ;
public FeaturesConfigItem setUsers(String users) {
this.users = users;
return this;
}
public FeaturesConfigItem setOn(boolean on) {
this.on = on;
return this;
}
}
public static class FeaturesConfig {
public FeaturesConfigItem socialLogin = new FeaturesConfigItem();
public FeaturesConfigItem signup = new FeaturesConfigItem().setOn(true);
public FeaturesConfigItem autoGeneratedRecipeName = new FeaturesConfigItem();
}
public static class CloudifyConfiguration{
public String version = "2.7.0-Cloudify-ga";
public long deployWatchDogProcessTimeoutMillis = Utils.parseTimeToMillis( "10mn" );
public long bootstrapCloudWatchDogProcessTimeoutMillis = Utils.parseTimeToMillis( "10mn" );
// time from "play" until we decide something is wrong and we send error
public long deployTimeoutError = Utils.parseTimeToMillis("90mn");
public File deployScript=Utils.getFileByRelativePath( "/bin/deployer.sh" );
public File uninstallServiceScript = Utils.getFileByRelativePath( "/bin/uninstall_service.sh" );
public File uninstallApplicationScript = Utils.getFileByRelativePath( "/bin/uninstall_application.sh" );
public String removeOutputLines = "";
public String removeOutputString = "";
@Config(ignoreNullValues = true)
public long verifyLoginUserIdTimeout = Utils.parseTimeToMillis("20s");
}
public static class Mails{
public GsMailer.Mailer poolEmpty = new GsMailer.Mailer().setEmail("widget@cloudifysource.org").setName("Cloudify Widget Team");
public GsMailer.Mailer registrationCc = new GsMailer.Mailer();
public GsMailer.Mailer registrationFrom = new GsMailer.Mailer().setEmail("appcatalog@cloudifysource.org").setName("Application Catalog");
public GsMailer.Mailer logErrors = new GsMailer.Mailer();
public UpgradeLogMail changeLog = new UpgradeLogMail();
}
public static class UpgradeLogMail{
public File file = Utils.getFileByRelativePath("/automatic_changelog");
public List<GsMailer.Mailer> addresses = new LinkedList<GsMailer.Mailer>();
}
public static class ResourceConfig {
public File recipesBaseDir = new File(new File(System.getProperty("java.io.tmpdir"), "cloudify-widget"), "recipes");
public File cloudProvidersBaseDir = new File(new File(System.getProperty("java.io.tmpdir"), "cloudify-widget"),"cloud-providers");
}
public ServerConfig getServer(){
return server;
}
public MailChimpDetails getMailChimpDetails() {
return mailChimpDetails;
}
public static class MailChimpDetails{
public String apiKey = null;
public String listId = null;
public String getApiKey() {
return apiKey;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
public String getListId() {
return listId;
}
public void setListId(String listId) {
this.listId = listId;
}
}
public static class AsyncExecutionConf {
public File newScriptsDir = Utils.getFileByRelativePath("node_scripts/_scripts/new");
public File executingScriptsDir = Utils.getFileByRelativePath("node_scripts/_scripts/executing");
public long statusPollingIntervalMillis = Utils.parseTimeToMillis("10s");
}
}