From: <go...@us...> - 2012-04-28 09:44:33
|
Revision: 13327 http://unicore.svn.sourceforge.net/unicore/?rev=13327&view=rev Author: golbi Date: 2012-04-28 09:44:27 +0000 (Sat, 28 Apr 2012) Log Message: ----------- Updated to the improved properties API Modified Paths: -------------- gateway/trunk/src/main/java/eu/unicore/gateway/properties/ConnectionsProperties.java gateway/trunk/src/main/java/eu/unicore/gateway/properties/GatewayJettyProperties.java gateway/trunk/src/main/java/eu/unicore/gateway/properties/GatewayProperties.java Modified: gateway/trunk/src/main/java/eu/unicore/gateway/properties/ConnectionsProperties.java =================================================================== --- gateway/trunk/src/main/java/eu/unicore/gateway/properties/ConnectionsProperties.java 2012-04-28 09:39:07 UTC (rev 13326) +++ gateway/trunk/src/main/java/eu/unicore/gateway/properties/ConnectionsProperties.java 2012-04-28 09:44:27 UTC (rev 13327) @@ -50,7 +50,7 @@ public ConnectionsProperties(File f) throws ConfigurationException, IOException { - super("", f, null, null, log); + super("", f, null, log); } public Iterator<Object> getEntries() Modified: gateway/trunk/src/main/java/eu/unicore/gateway/properties/GatewayJettyProperties.java =================================================================== --- gateway/trunk/src/main/java/eu/unicore/gateway/properties/GatewayJettyProperties.java 2012-04-28 09:39:07 UTC (rev 13326) +++ gateway/trunk/src/main/java/eu/unicore/gateway/properties/GatewayJettyProperties.java 2012-04-28 09:44:27 UTC (rev 13327) @@ -34,6 +34,7 @@ import eu.unicore.security.util.ConfigurationException; import eu.unicore.security.util.FilePropertiesHelper; +import eu.unicore.security.util.PropertyMD; import eu.unicore.security.util.jetty.JettyProperties; @@ -56,6 +57,6 @@ public GatewayJettyProperties(File f) throws ConfigurationException, IOException { super(FilePropertiesHelper.load(f)); - defaults.put(ENABLE_AJP, "false"); + defaults.put(ENABLE_AJP, new PropertyMD().setDefault("false")); } } Modified: gateway/trunk/src/main/java/eu/unicore/gateway/properties/GatewayProperties.java =================================================================== --- gateway/trunk/src/main/java/eu/unicore/gateway/properties/GatewayProperties.java 2012-04-28 09:39:07 UTC (rev 13326) +++ gateway/trunk/src/main/java/eu/unicore/gateway/properties/GatewayProperties.java 2012-04-28 09:44:27 UTC (rev 13327) @@ -40,6 +40,7 @@ import eu.unicore.gateway.util.ProtocolPluginHandler; import eu.unicore.security.util.ConfigurationException; import eu.unicore.security.util.FilePropertiesHelper; +import eu.unicore.security.util.PropertyMD; public class GatewayProperties extends FilePropertiesHelper { @@ -74,30 +75,31 @@ public static final File FILE_JETTY_PROPERTIES = GatewayProperties.FILE_GATEWAY_PROPERTIES; - private static final Map<String, String> REQ_PROPERTIES = new HashMap<String, String>(); - public static final Map<String, String> DEFAULTS = new HashMap<String, String>(); + public static final Map<String, PropertyMD> DEFAULTS = new HashMap<String, PropertyMD>(); public static final int DEFAULT_MAX_HDR = 102400; static { - REQ_PROPERTIES.put(KEY_HOSTNAME, "external gateway bind address"); + DEFAULTS.put(KEY_HOSTNAME, new PropertyMD().setMandatory(). + setDescription("external gateway bind address")); - DEFAULTS.put(KEY_CHUNKED, "true"); - DEFAULTS.put(KEY_CONN_GZIP, "true"); - DEFAULTS.put(KEY_CONN_KEEPALIVE, "true"); - DEFAULTS.put(KEY_CONN_MAX_PERHOST, "20"); - DEFAULTS.put(KEY_CONN_MAX_TOTAL, "100"); - DEFAULTS.put(KEY_CONN_TIMEOUT, "30000"); - DEFAULTS.put(KEY_CONSIGNORT_SIGN, "false"); - DEFAULTS.put(KEY_CONSIGNORT_TOLERANCE, "30"); - DEFAULTS.put(KEY_CONSIGNORT_VALIDITY, "60"); - DEFAULTS.put(KEY_EXTERNAL_ADDRESS, null); - DEFAULTS.put(KEY_MAX_HEADER, DEFAULT_MAX_HDR+""); - DEFAULTS.put(KEY_PROTO_EXPECTCONTINUE, "true"); - DEFAULTS.put(KEY_REG_ENABLED, "false"); - DEFAULTS.put(KEY_REG_EXCL, null); - DEFAULTS.put(KEY_REG_INCL, null); - DEFAULTS.put(KEY_SOCKET_TIMEOUT, "30000"); - DEFAULTS.put(KEY_WEBPAGE_DISABLE, "false"); + DEFAULTS.put(KEY_CHUNKED, new PropertyMD("true")); + DEFAULTS.put(KEY_CONN_GZIP, new PropertyMD("true")); + DEFAULTS.put(KEY_CONN_KEEPALIVE, new PropertyMD("true")); + DEFAULTS.put(KEY_CONN_MAX_PERHOST, new PropertyMD("20")); + DEFAULTS.put(KEY_CONN_MAX_TOTAL, new PropertyMD("100")); + DEFAULTS.put(KEY_CONN_TIMEOUT, new PropertyMD("30000")); + DEFAULTS.put(KEY_CONSIGNORT_SIGN, new PropertyMD("false")); + DEFAULTS.put(KEY_CONSIGNORT_TOLERANCE, new PropertyMD("30").setNonNegative()); + DEFAULTS.put(KEY_CONSIGNORT_VALIDITY, new PropertyMD("60").setPositive()); + DEFAULTS.put(KEY_EXTERNAL_ADDRESS, new PropertyMD(null)); + DEFAULTS.put(KEY_MAX_HEADER, new PropertyMD(DEFAULT_MAX_HDR+""). + setBounds(1024, 1024000000)); + DEFAULTS.put(KEY_PROTO_EXPECTCONTINUE, new PropertyMD("true")); + DEFAULTS.put(KEY_REG_ENABLED, new PropertyMD("false")); + DEFAULTS.put(KEY_REG_EXCL, new PropertyMD(null)); + DEFAULTS.put(KEY_REG_INCL, new PropertyMD(null)); + DEFAULTS.put(KEY_SOCKET_TIMEOUT, new PropertyMD("30000")); + DEFAULTS.put(KEY_WEBPAGE_DISABLE, new PropertyMD("false")); } @@ -108,7 +110,7 @@ public GatewayProperties(File f) throws ConfigurationException, IOException { - super("", f, DEFAULTS, REQ_PROPERTIES, log); + super("", f, DEFAULTS, log); } @@ -158,12 +160,12 @@ public int getConsTTol() { - return getIntValue(KEY_CONSIGNORT_TOLERANCE, 0, Integer.MAX_VALUE); + return getIntValue(KEY_CONSIGNORT_TOLERANCE); } public int getConsTVal() { - return getIntValue(KEY_CONSIGNORT_VALIDITY, 1, Integer.MAX_VALUE); + return getIntValue(KEY_CONSIGNORT_VALIDITY); } public boolean isConsTSign() @@ -211,6 +213,6 @@ public int getMaxSoapHeader() { - return getIntValue(KEY_MAX_HEADER, 1024, 1024000000); + return getIntValue(KEY_MAX_HEADER); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |