1
14
15 package com.liferay.portal.verify;
16
17 import com.liferay.portal.kernel.log.Log;
18 import com.liferay.portal.kernel.log.LogFactoryUtil;
19 import com.liferay.portal.util.PropsUtil;
20 import com.liferay.util.SystemProperties;
21
22
27 public class VerifyProperties extends VerifyProcess {
28
29 protected void doVerify() throws Exception {
30
31
33 for (String[] keys : _MIGRATED_SYSTEM_KEYS) {
34 String oldKey = keys[0];
35 String newKey = keys[1];
36
37 verifyMigratedSystemProperty(oldKey, newKey);
38 }
39
40 for (String[] keys : _RENAMED_SYSTEM_KEYS) {
41 String oldKey = keys[0];
42 String newKey = keys[1];
43
44 verifyRenamedSystemProperty(oldKey, newKey);
45 }
46
47 for (String key : _OBSOLETE_SYSTEM_KEYS) {
48 verifyObsoleteSystemProperty(key);
49 }
50
51
53 for (String[] keys : _RENAMED_PORTAL_KEYS) {
54 String oldKey = keys[0];
55 String newKey = keys[1];
56
57 verifyRenamedPortalProperty(oldKey, newKey);
58 }
59
60 for (String key : _OBSOLETE_PORTAL_KEYS) {
61 verifyObsoletePortalProperty(key);
62 }
63 }
64
65 protected void verifyMigratedSystemProperty(String oldKey, String newKey)
66 throws Exception {
67
68 String value = SystemProperties.get(oldKey);
69
70 if (value != null) {
71 _log.error(
72 "System property \"" + oldKey +
73 "\" was migrated to the portal property \"" + newKey +
74 "\"");
75 }
76 }
77
78 protected void verifyRenamedPortalProperty(String oldKey, String newKey)
79 throws Exception {
80
81 String value = PropsUtil.get(oldKey);
82
83 if (value != null) {
84 _log.error(
85 "Portal property \"" + oldKey + "\" was renamed to \"" +
86 newKey + "\"");
87 }
88 }
89
90 protected void verifyRenamedSystemProperty(String oldKey, String newKey)
91 throws Exception {
92
93 String value = SystemProperties.get(oldKey);
94
95 if (value != null) {
96 _log.error(
97 "System property \"" + oldKey + "\" was renamed to \"" +
98 newKey + "\"");
99 }
100 }
101
102 protected void verifyObsoletePortalProperty(String key) throws Exception {
103 String value = PropsUtil.get(key);
104
105 if (value != null) {
106 _log.error("Portal property \"" + key + "\" is obsolete");
107 }
108 }
109
110 protected void verifyObsoleteSystemProperty(String key) throws Exception {
111 String value = SystemProperties.get(key);
112
113 if (value != null) {
114 _log.error("System property \"" + key + "\" is obsolete");
115 }
116 }
117
118 private static final String[][] _MIGRATED_SYSTEM_KEYS = new String[][] {
119 new String[] {
120 "com.liferay.filters.compression.CompressionFilter",
121 "com.liferay.portal.servlet.filters.gzip.GZipFilter"
122 },
123 new String[] {
124 "com.liferay.filters.doubleclick.DoubleClickFilter",
125 "com.liferay.portal.servlet.filters.doubleclick.DoubleClickFilter"
126 },
127 new String[] {
128 "com.liferay.filters.strip.StripFilter",
129 "com.liferay.portal.servlet.filters.strip.StripFilter"
130 },
131 new String[] {
132 "com.liferay.util.Http.max.connections.per.host",
133 "com.liferay.portal.util.HttpImpl.max.connections.per.host"
134 },
135 new String[] {
136 "com.liferay.util.Http.max.total.connections",
137 "com.liferay.portal.util.HttpImpl.max.total.connections"
138 },
139 new String[] {
140 "com.liferay.util.Http.proxy.auth.type",
141 "com.liferay.portal.util.HttpImpl.proxy.auth.type"
142 },
143 new String[] {
144 "com.liferay.util.Http.proxy.ntlm.domain",
145 "com.liferay.portal.util.HttpImpl.proxy.ntlm.domain"
146 },
147 new String[] {
148 "com.liferay.util.Http.proxy.ntlm.host",
149 "com.liferay.portal.util.HttpImpl.proxy.ntlm.host"
150 },
151 new String[] {
152 "com.liferay.util.Http.proxy.password",
153 "com.liferay.portal.util.HttpImpl.proxy.password"
154 },
155 new String[] {
156 "com.liferay.util.Http.proxy.username",
157 "com.liferay.portal.util.HttpImpl.proxy.username"
158 },
159 new String[] {
160 "com.liferay.util.Http.timeout",
161 "com.liferay.portal.util.HttpImpl.timeout"
162 },
163 new String[] {
164 "com.liferay.util.servlet.UploadServletRequest.max.size",
165 "com.liferay.portal.upload.UploadServletRequestImpl.max.size"
166 },
167 new String[] {
168 "com.liferay.util.servlet.UploadServletRequest.temp.dir",
169 "com.liferay.portal.upload.UploadServletRequestImpl.temp.dir"
170 },
171 new String[] {
172 "com.liferay.util.servlet.fileupload.LiferayFileItem." +
173 "threshold.size",
174 "com.liferay.portal.upload.LiferayFileItem.threshold.size"
175 },
176 new String[] {
177 "com.liferay.util.servlet.fileupload.LiferayInputStream." +
178 "threshold.size",
179 "com.liferay.portal.upload.LiferayInputStream.threshold.size"
180 }
181 };
182
183 private static final String[] _OBSOLETE_PORTAL_KEYS = new String[] {
184 "auth.max.failures.limit",
185 "auth.simultaneous.logins",
186 "cas.validate.url",
187 "commons.pool.enabled",
188 "jbi.workflow.url",
189 "ldap.import.interval",
190 "message.boards.thread.locking.enabled",
191 "webdav.storage.class",
192 "webdav.storage.show.edit.url",
193 "webdav.storage.show.view.url",
194 "webdav.storage.tokens",
195 "xss.allow"
196 };
197
198 private static final String[] _OBSOLETE_SYSTEM_KEYS = new String[] {
199 "com.liferay.util.Http.proxy.host",
200 "com.liferay.util.Http.proxy.port",
201 "com.liferay.util.XSSUtil.regexp.pattern"
202 };
203
204 private static final String[][] _RENAMED_PORTAL_KEYS = new String[][] {
205 new String[] {
206 "amazon.license.0",
207 "amazon.access.key.id"
208 },
209 new String[] {
210 "amazon.license.1",
211 "amazon.access.key.id"
212 },
213 new String[] {
214 "amazon.license.2",
215 "amazon.access.key.id"
216 },
217 new String[] {
218 "amazon.license.3",
219 "amazon.access.key.id"
220 },
221 new String[] {
222 "cdn.host",
223 "cdn.host.http"
224 },
225 new String[] {
226 "com.liferay.portal.servlet.filters.compression.CompressionFilter",
227 "com.liferay.portal.servlet.filters.gzip.GZipFilter"
228 },
229 new String[] {
230 "default.guest.friendly.url",
231 "default.guest.public.layout.friendly.url"
232 },
233 new String[] {
234 "default.guest.layout.column",
235 "default.guest.public.layout.column"
236 },
237 new String[] {
238 "default.guest.layout.name",
239 "default.guest.public.layout.name"
240 },
241 new String[] {
242 "default.guest.layout.template.id",
243 "default.guest.public.layout.template.id"
244 },
245 new String[] {
246 "default.user.layout.column",
247 "default.user.public.layout.column"
248 },
249 new String[] {
250 "default.user.layout.name",
251 "default.user.public.layout.name"
252 },
253 new String[] {
254 "default.user.layout.template.id",
255 "default.user.public.layout.template.id"
256 },
257 new String[] {
258 "default.user.private.layout.lar",
259 "default.user.private.layouts.lar"
260 },
261 new String[] {
262 "default.user.public.layout.lar",
263 "default.user.public.layouts.lar"
264 },
265 new String[] {
266 "referer.url.domains.allowed",
267 "redirect.url.domains.allowed"
268 },
269 new String[] {
270 "referer.url.ips.allowed",
271 "redirect.url.ips.allowed"
272 },
273 new String[] {
274 "referer.url.security.mode",
275 "redirect.url.security.mode"
276 }
277 };
278
279 private static final String[][] _RENAMED_SYSTEM_KEYS = new String[][] {
280 };
281
282 private static Log _log = LogFactoryUtil.getLog(VerifyProperties.class);
283
284 }