syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject syncope git commit: [SYNCOPE-842] Implementation provided
Date Fri, 06 May 2016 12:27:09 GMT
Repository: syncope
Updated Branches:
  refs/heads/master 9ef167750 -> 570269424


[SYNCOPE-842] Implementation provided


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/57026942
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/57026942
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/57026942

Branch: refs/heads/master
Commit: 570269424a5507f4d4e2f8d7fc51f73fb555151d
Parents: 9ef1677
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Fri May 6 14:27:01 2016 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Fri May 6 14:27:01 2016 +0200

----------------------------------------------------------------------
 .../syncope/client/cli/SyncopeServices.java       | 18 ++++++++++--------
 .../install/InstallConfigFileTemplate.java        |  7 ++++---
 .../client/cli/commands/install/InstallSetup.java |  2 +-
 .../commands/install/InstallSetupForDebug.java    |  2 +-
 .../syncope/client/cli/util/JasyptUtils.java      |  2 +-
 .../syncope/client/cli/util/JasyptUtilsTest.java  |  2 +-
 .../client/console/SyncopeConsoleApplication.java |  7 ++++++-
 .../console/src/main/resources/console.properties |  1 +
 .../client/enduser/SyncopeEnduserApplication.java |  9 +++++++--
 .../enduser/resources/UserSelfIsLogged.java       |  3 +--
 .../enduser/src/main/resources/enduser.properties |  1 +
 .../src/main/resources/console.properties         |  1 +
 .../src/test/resources/console.properties         |  1 +
 .../src/main/resources/enduser.properties         |  1 +
 14 files changed, 37 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/57026942/client/cli/src/main/java/org/apache/syncope/client/cli/SyncopeServices.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/SyncopeServices.java b/client/cli/src/main/java/org/apache/syncope/client/cli/SyncopeServices.java
index d1cb9af..2fecf4a 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/SyncopeServices.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/SyncopeServices.java
@@ -21,6 +21,7 @@ package org.apache.syncope.client.cli;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.util.Properties;
+import org.apache.commons.lang3.BooleanUtils;
 import org.apache.syncope.client.cli.commands.install.InstallConfigFileTemplate;
 import org.apache.syncope.client.cli.util.JasyptUtils;
 import org.apache.syncope.client.lib.SyncopeClient;
@@ -35,7 +36,7 @@ public final class SyncopeServices {
 
     private static String SYNCOPE_ADDRESS;
 
-    public static <T> T get(final Class<T> claz) {
+    public static <T> T get(final Class<T> clazz) {
         final Properties properties = new Properties();
         try {
             properties.load(new FileInputStream(InstallConfigFileTemplate.configurationFilePath()));
@@ -43,15 +44,16 @@ public final class SyncopeServices {
             LOG.error("Error opening properties file", e);
         }
 
-        final String syncopeAdminPassword = JasyptUtils.getJasyptUtils().decrypt(properties.getProperty(
-                "syncope.admin.password"));
+        String syncopeAdminPassword = JasyptUtils.get().decrypt(properties.getProperty("syncope.admin.password"));
         SYNCOPE_ADDRESS = properties.getProperty("syncope.rest.services");
-        final SyncopeClient syncopeClient = new SyncopeClientFactoryBean()
-                .setAddress(SYNCOPE_ADDRESS)
-                .create(properties.getProperty("syncope.admin.user"), syncopeAdminPassword);
+        String useGZIPCompression = properties.getProperty("useGZIPCompression");
+        SyncopeClient syncopeClient = new SyncopeClientFactoryBean().
+                setAddress(SYNCOPE_ADDRESS).
+                setUseCompression(BooleanUtils.toBoolean(useGZIPCompression)).
+                create(properties.getProperty("syncope.admin.user"), syncopeAdminPassword);
 
-        LOG.debug("Creting service for {}", claz.getName());
-        return syncopeClient.getService(claz);
+        LOG.debug("Creting service for {}", clazz.getName());
+        return syncopeClient.getService(clazz);
     }
 
     public static String getAddress() {

http://git-wip-us.apache.org/repos/asf/syncope/blob/57026942/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallConfigFileTemplate.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallConfigFileTemplate.java
b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallConfigFileTemplate.java
index 2bf0ded..4eb15a4 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallConfigFileTemplate.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallConfigFileTemplate.java
@@ -25,8 +25,7 @@ public final class InstallConfigFileTemplate {
 
     private static final ResourceBundle CONF = ResourceBundle.getBundle("configuration");
 
-    public static final String CONFIGURATION_FILE_NAME
-            = CONF.getString("cli.installation.filename");
+    public static final String CONFIGURATION_FILE_NAME = CONF.getString("cli.installation.filename");
 
     private static final String SYNCOPE_REST_SERVICES = "syncope.rest.services=%s://%s:%s%s";
 
@@ -41,11 +40,13 @@ public final class InstallConfigFileTemplate {
             final String restContext,
             final String user,
             final String password) {
+
         final String syncopeRestServices = String.format(SYNCOPE_REST_SERVICES, schema, hostname,
port, restContext);
         final String syncopeAdminUser = String.format(SYNCOPE_ADMIN_USER, user);
         final String syncopeAdminPassword = String.format(SYNCOPE_ADMIN_PASSWORD, password);
+        final String useGZIPCompression = String.format("syncope.useGZIPCompression=true");
 
-        return syncopeRestServices + "\n" + syncopeAdminUser + "\n" + syncopeAdminPassword;
+        return syncopeRestServices + "\n" + syncopeAdminUser + "\n" + syncopeAdminPassword
+ "\n" + useGZIPCompression;
     }
 
     public static String dirPath() {

http://git-wip-us.apache.org/repos/asf/syncope/blob/57026942/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallSetup.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallSetup.java
b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallSetup.java
index 9b084ff..7acf12f 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallSetup.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallSetup.java
@@ -148,7 +148,7 @@ public class InstallSetup {
             }
         }
 
-        final JasyptUtils jasyptUtils = JasyptUtils.getJasyptUtils();
+        final JasyptUtils jasyptUtils = JasyptUtils.get();
         try {
 
             final String contentCliPropertiesFile = InstallConfigFileTemplate.cliPropertiesFile(

http://git-wip-us.apache.org/repos/asf/syncope/blob/57026942/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallSetupForDebug.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallSetupForDebug.java
b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallSetupForDebug.java
index 65ff376..7e7bc46 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallSetupForDebug.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/install/InstallSetupForDebug.java
@@ -50,7 +50,7 @@ public class InstallSetupForDebug {
         System.out.println("- File system permission checked");
         System.out.println("");
 
-        final JasyptUtils jasyptUtils = JasyptUtils.getJasyptUtils();
+        final JasyptUtils jasyptUtils = JasyptUtils.get();
         try {
 
             final String contentCliPropertiesFile = InstallConfigFileTemplate.cliPropertiesFile(

http://git-wip-us.apache.org/repos/asf/syncope/blob/57026942/client/cli/src/main/java/org/apache/syncope/client/cli/util/JasyptUtils.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/util/JasyptUtils.java
b/client/cli/src/main/java/org/apache/syncope/client/cli/util/JasyptUtils.java
index fe99971..0ddd9bf 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/util/JasyptUtils.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/util/JasyptUtils.java
@@ -28,7 +28,7 @@ public final class JasyptUtils {
 
     private static JasyptUtils JASYPT_UTILS = null;
 
-    public static JasyptUtils getJasyptUtils() {
+    public static JasyptUtils get() {
         if (JASYPT_UTILS == null) {
             JASYPT_UTILS = new JasyptUtils();
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/57026942/client/cli/src/test/java/org/apache/syncope/client/cli/util/JasyptUtilsTest.java
----------------------------------------------------------------------
diff --git a/client/cli/src/test/java/org/apache/syncope/client/cli/util/JasyptUtilsTest.java
b/client/cli/src/test/java/org/apache/syncope/client/cli/util/JasyptUtilsTest.java
index 9fd0dba..6962a2c 100644
--- a/client/cli/src/test/java/org/apache/syncope/client/cli/util/JasyptUtilsTest.java
+++ b/client/cli/src/test/java/org/apache/syncope/client/cli/util/JasyptUtilsTest.java
@@ -27,7 +27,7 @@ public class JasyptUtilsTest {
     @Test
     public void encryption() {
         String password = "password";
-        JasyptUtils jasyptUtils = JasyptUtils.getJasyptUtils();
+        JasyptUtils jasyptUtils = JasyptUtils.get();
         String encPassword = jasyptUtils.encrypt(password);
         String decPassword = jasyptUtils.decrypt(encPassword);
         assertEquals(password, decPassword);

http://git-wip-us.apache.org/repos/asf/syncope/blob/57026942/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
index 4655faf..7ac21a3 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
@@ -33,6 +33,7 @@ import java.util.Map;
 import java.util.Properties;
 import javax.ws.rs.core.MediaType;
 import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.BooleanUtils;
 import org.apache.commons.lang3.ClassUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.syncope.client.console.init.ClassPathScanImplementationLookup;
@@ -156,8 +157,12 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication
{
         Args.notNull(port, "<port> not set");
         String rootPath = props.getProperty("rootPath");
         Args.notNull(rootPath, "<rootPath> not set");
+        String useGZIPCompression = props.getProperty("useGZIPCompression");
+        Args.notNull(rootPath, "<useGZIPCompression> not set");
 
-        clientFactory = new SyncopeClientFactoryBean().setAddress(scheme + "://" + host +
":" + port + "/" + rootPath);
+        clientFactory = new SyncopeClientFactoryBean().
+                setAddress(scheme + "://" + host + ":" + port + "/" + rootPath).
+                setUseCompression(BooleanUtils.toBoolean(useGZIPCompression));
 
         // process page properties
         pageClasses = new HashMap<>();

http://git-wip-us.apache.org/repos/asf/syncope/blob/57026942/client/console/src/main/resources/console.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/console.properties b/client/console/src/main/resources/console.properties
index c7733fd..36e2394 100644
--- a/client/console/src/main/resources/console.properties
+++ b/client/console/src/main/resources/console.properties
@@ -27,6 +27,7 @@ scheme=http
 host=localhost
 port=8080
 rootPath=/syncope/rest/
+useGZIPCompression=true
 
 activitiModelerDirectory=${activiti-modeler.directory}
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/57026942/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
index ca8f563..4383f95 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
@@ -28,6 +28,7 @@ import java.util.List;
 import java.util.Locale;
 import java.util.Properties;
 import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.BooleanUtils;
 import org.apache.syncope.client.enduser.resources.CaptchaResource;
 import org.apache.syncope.client.enduser.resources.InfoResource;
 import org.apache.syncope.client.enduser.resources.LoginResource;
@@ -134,9 +135,13 @@ public class SyncopeEnduserApplication extends WebApplication implements
Seriali
         Args.notNull(port, "<port> not set");
         String rootPath = props.getProperty("rootPath");
         Args.notNull(rootPath, "<rootPath> not set");
+        String useGZIPCompression = props.getProperty("useGZIPCompression");
+        Args.notNull(rootPath, "<useGZIPCompression> not set");
 
-        clientFactory = new SyncopeClientFactoryBean().setAddress(scheme + "://" + host +
":" + port + "/" + rootPath);
-        clientFactory.setContentType(SyncopeClientFactoryBean.ContentType.JSON);
+        clientFactory = new SyncopeClientFactoryBean().
+                setAddress(scheme + "://" + host + ":" + port + "/" + rootPath).
+                setContentType(SyncopeClientFactoryBean.ContentType.JSON).
+                setUseCompression(BooleanUtils.toBoolean(useGZIPCompression));
 
         // resource to provide login functionality managed by wicket
         mountResource("/api/login", new ResourceReference("login") {

http://git-wip-us.apache.org/repos/asf/syncope/blob/57026942/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfIsLogged.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfIsLogged.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfIsLogged.java
index d1f0c7a..6d9facf 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfIsLogged.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfIsLogged.java
@@ -26,11 +26,10 @@ import org.apache.wicket.request.resource.IResource;
 
 public class UserSelfIsLogged extends AbstractBaseResource {
 
-    private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = -8716361267586908871L;
 
     @Override
     protected ResourceResponse newResourceResponse(final Attributes attributes) {
-
         ResourceResponse response = new ResourceResponse();
 
         LOG.debug("Checking if user is authenticated");

http://git-wip-us.apache.org/repos/asf/syncope/blob/57026942/client/enduser/src/main/resources/enduser.properties
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/enduser.properties b/client/enduser/src/main/resources/enduser.properties
index aadb054..bad773e 100644
--- a/client/enduser/src/main/resources/enduser.properties
+++ b/client/enduser/src/main/resources/enduser.properties
@@ -23,6 +23,7 @@ license=${licenseUrl}
 anonymousUser=${anonymousUser}
 anonymousKey=${anonymousKey}
 adminUser=${adminUser}
+useGZIPCompression=true
 
 scheme=http
 host=localhost

http://git-wip-us.apache.org/repos/asf/syncope/blob/57026942/fit/console-reference/src/main/resources/console.properties
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/main/resources/console.properties b/fit/console-reference/src/main/resources/console.properties
index 73acb0a..f87b8d7 100644
--- a/fit/console-reference/src/main/resources/console.properties
+++ b/fit/console-reference/src/main/resources/console.properties
@@ -27,6 +27,7 @@ scheme=http
 host=localhost
 port=9080
 rootPath=/syncope/rest/
+useGZIPCompression=true
 
 activitiModelerDirectory=${activiti-modeler.directory}
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/57026942/fit/core-reference/src/test/resources/console.properties
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/resources/console.properties b/fit/core-reference/src/test/resources/console.properties
index 73acb0a..f87b8d7 100644
--- a/fit/core-reference/src/test/resources/console.properties
+++ b/fit/core-reference/src/test/resources/console.properties
@@ -27,6 +27,7 @@ scheme=http
 host=localhost
 port=9080
 rootPath=/syncope/rest/
+useGZIPCompression=true
 
 activitiModelerDirectory=${activiti-modeler.directory}
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/57026942/fit/enduser-reference/src/main/resources/enduser.properties
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/main/resources/enduser.properties b/fit/enduser-reference/src/main/resources/enduser.properties
index a8644aa..5c618ed 100644
--- a/fit/enduser-reference/src/main/resources/enduser.properties
+++ b/fit/enduser-reference/src/main/resources/enduser.properties
@@ -23,6 +23,7 @@ license=${licenseUrl}
 anonymousUser=${anonymousUser}
 anonymousKey=${anonymousKey}
 adminUser=${adminUser}
+useGZIPCompression=true
 
 scheme=http
 host=localhost


Mime
View raw message