You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by re...@apache.org on 2010/06/19 20:28:31 UTC

svn commit: r956267 - /incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.launcher.storageless.parent/org.apache.clerezza.platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/

Author: reto
Date: Sat Jun 19 18:28:31 2010
New Revision: 956267

URL: http://svn.apache.org/viewvc?rev=956267&view=rev
Log:
CLEREZZA-235: added command line options to launcher

Modified:
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.launcher.storageless.parent/org.apache.clerezza.platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/LauncherArguments.java
    incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.launcher.storageless.parent/org.apache.clerezza.platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/Main.java

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.launcher.storageless.parent/org.apache.clerezza.platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/LauncherArguments.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.launcher.storageless.parent/org.apache.clerezza.platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/LauncherArguments.java?rev=956267&r1=956266&r2=956267&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.launcher.storageless.parent/org.apache.clerezza.platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/LauncherArguments.java (original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.launcher.storageless.parent/org.apache.clerezza.platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/LauncherArguments.java Sat Jun 19 18:28:31 2010
@@ -42,4 +42,26 @@ public interface LauncherArguments {
 	@CommandLine(longName = "port", shortName = {"P"}, required = false,
 	description = "The port on which the default webservice shall listen")
 	public String getPort();
+	
+	@CommandLine(longName = "https_port", shortName = {}, required = false,
+	description = "The port on which the https secure webserver shall listen")
+	public String getSecurePort();
+	
+	@CommandLine(longName = "https_keystore_path", shortName = {}, required = false,
+	description = "The folder with the keystore for https")
+	public String getKeyStorePath();
+	
+	@CommandLine(longName = "https_keystore_password", shortName = {}, required = false,
+	description = "The folder with the keystore for https")
+	public String getKeyStorePassword();
+	
+	@CommandLine(longName = "https_keystore_type", shortName = {}, required = false,
+	description = "The type of the key-store")
+	public String getKeyStoreType();
+	
+	@CommandLine(longName = "https_keystore_clientauth", shortName = {}, required = false,
+	description = "Client Auth request, one of \"none\", \"want\" or \"need\"")
+	public String getClientAuth();
+	
+	
 }

Modified: incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.launcher.storageless.parent/org.apache.clerezza.platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/Main.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.launcher.storageless.parent/org.apache.clerezza.platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/Main.java?rev=956267&r1=956266&r2=956267&view=diff
==============================================================================
--- incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.launcher.storageless.parent/org.apache.clerezza.platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/Main.java (original)
+++ incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.launcher.storageless.parent/org.apache.clerezza.platform.launcher.storageless/src/main/java/org/apache/clerezza/platform/launcher/Main.java Sat Jun 19 18:28:31 2010
@@ -241,28 +241,80 @@ public class Main implements BundleActiv
 
 		Properties configProps = new Properties();
 		configProps.putAll(System.getProperties());
-		String argLogLevel = arguments.getLogLevel();
-		if (argLogLevel == null) {
-			argLogLevel = "INFO";
-		}
-		System.out.println("setting log-level to: " + argLogLevel);
-		configProps.put("org.ops4j.pax.logging.DefaultServiceLog.level",
-				argLogLevel);
-
-		final String port = arguments.getPort();
-		if (port != null) {
-			configProps.put("org.osgi.service.http.port", port);
-		}
-		configProps.put("org.ops4j.pax.url.mvn.repositories", getCommaSeparatedListOfMavenRepos());
-
-		String extraPackages = (String) configProps.get("org.osgi.framework.system.packages.extra");
-		if (extraPackages == null) {
-			extraPackages = "";
-		}
-		configProps.put("org.osgi.framework.system.packages.extra",
-				"sun.misc;"
-				+ extraPackages);
-
+		{
+			String argLogLevel = arguments.getLogLevel();
+			if (argLogLevel == null) {
+				argLogLevel = "INFO";
+			}
+			System.out.println("setting log-level to: " + argLogLevel);
+			configProps.put("org.ops4j.pax.logging.DefaultServiceLog.level",
+					argLogLevel);
+		}
+		{
+			final String port = arguments.getPort();
+			if (port != null) {
+				configProps.put("org.osgi.service.http.port", port);
+			}
+			configProps.put("org.ops4j.pax.url.mvn.repositories", getCommaSeparatedListOfMavenRepos());
+		}
+		{
+			String extraPackages = (String) configProps.get("org.osgi.framework.system.packages.extra");
+			if (extraPackages == null) {
+				extraPackages = "";
+			}
+			configProps.put("org.osgi.framework.system.packages.extra",
+					"sun.misc;"
+					+ extraPackages);
+		}
+
+	//public static final String CONTEXT_PROPERTY_HTTP_PORT_SECURE = "";
+		boolean httpsEnabled = false;
+		{
+			
+			final String httpsPort = arguments.getSecurePort();
+			if (httpsPort != null) {
+				configProps.put("org.osgi.service.http.port.secure", httpsPort);
+				httpsEnabled = true;
+			}
+		}
+		{
+			
+			final String keyStorePath = arguments.getKeyStorePath();
+			if (keyStorePath != null) {
+				configProps.put("org.wymiwyg.jetty.httpservice.https.keystore.path", keyStorePath);
+				httpsEnabled = true;
+			}
+		}
+		{
+			
+			final String keyStorePassword = arguments.getKeyStorePath();
+			if (keyStorePassword != null) {
+				configProps.put("org.wymiwyg.jetty.httpservice.https.keystore.password", keyStorePassword);
+				httpsEnabled = true;
+			}
+		}
+		{
+			
+			final String keyStoreType = arguments.getKeyStoreType();
+			if (keyStoreType != null) {
+				configProps.put("org.wymiwyg.jetty.httpservice.https.keystore.type", keyStoreType);
+				httpsEnabled = true;
+			}
+		}
+		
+		{
+			
+			final String clientAuth = arguments.getClientAuth();
+			if (clientAuth != null) {
+				configProps.put("org.wymiwyg.jetty.httpservice.clientauth", clientAuth);
+				httpsEnabled = true;
+			}
+		}
+		
+		if (httpsEnabled) {
+			configProps.put("org.osgi.service.http.secure.enabled", "true");
+		}
+		
 		return configProps;
 
 	}