syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [syncope] branch 2_1_X updated: Adjusting platform info with latest changes WRT persistence.properties
Date Fri, 23 Nov 2018 17:17:41 GMT
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 2_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/2_1_X by this push:
     new f5b6b59  Adjusting platform info with latest changes WRT persistence.properties
f5b6b59 is described below

commit f5b6b59d9071c0b670e9862976707b3f6941c21b
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
AuthorDate: Fri Nov 23 15:58:56 2018 +0100

    Adjusting platform info with latest changes WRT persistence.properties
---
 .../syncope/client/cli/commands/info/Info.java     |   8 +-
 .../syncope/common/lib/info/PlatformInfo.java      | 295 +++++++++++++++------
 .../apache/syncope/core/logic/SyncopeLogic.java    |  61 ++++-
 .../client/console/rest/CamelRoutesRestClient.java |   7 +-
 .../apache/syncope/fit/ElasticsearchDetector.java  |   3 +-
 .../org/apache/syncope/fit/FlowableDetector.java   |   2 +-
 .../apache/syncope/fit/core/CamelRouteITCase.java  |   2 +-
 7 files changed, 270 insertions(+), 108 deletions(-)

diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
index 91cb879..e277b9d 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
@@ -73,9 +73,9 @@ public class Info {
     public void provisioningManager() {
         try {
             infoResultManager.printProvisioningManager(
-                    platformInfo.getAnyObjectProvisioningManager(),
-                    platformInfo.getUserProvisioningManager(),
-                    platformInfo.getGroupProvisioningManager());
+                    platformInfo.getProvisioningInfo().getAnyObjectProvisioningManager(),
+                    platformInfo.getProvisioningInfo().getUserProvisioningManager(),
+                    platformInfo.getProvisioningInfo().getGroupProvisioningManager());
         } catch (final Exception ex) {
             LOG.error("Information error", ex);
             infoResultManager.genericError(ex.getMessage());
@@ -234,7 +234,7 @@ public class Info {
 
     public void virAttrCache() {
         try {
-            infoResultManager.printVirtualAttributeCacheClass(platformInfo.getVirAttrCache());
+            infoResultManager.printVirtualAttributeCacheClass(platformInfo.getProvisioningInfo().getVirAttrCache());
         } catch (final Exception ex) {
             LOG.error("Information error", ex);
             infoResultManager.genericError(ex.getMessage());
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java
b/common/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java
index 6ea0e93..805c8c7 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java
@@ -38,37 +38,216 @@ public class PlatformInfo implements Serializable {
 
     private static final long serialVersionUID = -7941853999417673827L;
 
-    private String version;
+    @XmlRootElement(name = "provisioningInfo")
+    @XmlType
+    public class ProvisioningInfo implements Serializable {
 
-    private String buildNumber;
+        private static final long serialVersionUID = 533340357732839568L;
 
-    private boolean selfRegAllowed;
+        private String propagationTaskExecutor;
 
-    private boolean pwdResetAllowed;
+        private String virAttrCache;
 
-    private boolean pwdResetRequiringSecurityQuestions;
+        private String anyObjectProvisioningManager;
 
-    private final Set<String> connIdLocations = new HashSet<>();
+        private String userProvisioningManager;
 
-    private String propagationTaskExecutor;
+        private String groupProvisioningManager;
 
-    private String anyObjectWorkflowAdapter;
+        public String getPropagationTaskExecutor() {
+            return propagationTaskExecutor;
+        }
 
-    private String userWorkflowAdapter;
+        public void setPropagationTaskExecutor(final String propagationTaskExecutor) {
+            this.propagationTaskExecutor = propagationTaskExecutor;
+        }
 
-    private String groupWorkflowAdapter;
+        public String getVirAttrCache() {
+            return virAttrCache;
+        }
 
-    private String anyObjectProvisioningManager;
+        public void setVirAttrCache(final String virAttrCache) {
+            this.virAttrCache = virAttrCache;
+        }
 
-    private String userProvisioningManager;
+        public String getAnyObjectProvisioningManager() {
+            return anyObjectProvisioningManager;
+        }
 
-    private String groupProvisioningManager;
+        public void setAnyObjectProvisioningManager(final String anyObjectProvisioningManager)
{
+            this.anyObjectProvisioningManager = anyObjectProvisioningManager;
+        }
 
-    private String virAttrCache;
+        public String getUserProvisioningManager() {
+            return userProvisioningManager;
+        }
 
-    private String passwordGenerator;
+        public void setUserProvisioningManager(final String userProvisioningManager) {
+            this.userProvisioningManager = userProvisioningManager;
+        }
+
+        public String getGroupProvisioningManager() {
+            return groupProvisioningManager;
+        }
+
+        public void setGroupProvisioningManager(final String groupProvisioningManager) {
+            this.groupProvisioningManager = groupProvisioningManager;
+        }
+    }
+
+    @XmlRootElement(name = "workflowInfo")
+    @XmlType
+    public class WorkflowInfo implements Serializable {
+
+        private static final long serialVersionUID = 6736937721099195324L;
+
+        private String anyObjectWorkflowAdapter;
+
+        private String userWorkflowAdapter;
+
+        private String groupWorkflowAdapter;
+
+        public String getAnyObjectWorkflowAdapter() {
+            return anyObjectWorkflowAdapter;
+        }
+
+        public void setAnyObjectWorkflowAdapter(final String anyObjectWorkflowAdapter) {
+            this.anyObjectWorkflowAdapter = anyObjectWorkflowAdapter;
+        }
+
+        public String getUserWorkflowAdapter() {
+            return userWorkflowAdapter;
+        }
+
+        public void setUserWorkflowAdapter(final String userWorkflowAdapter) {
+            this.userWorkflowAdapter = userWorkflowAdapter;
+        }
+
+        public String getGroupWorkflowAdapter() {
+            return groupWorkflowAdapter;
+        }
+
+        public void setGroupWorkflowAdapter(final String groupWorkflowAdapter) {
+            this.groupWorkflowAdapter = groupWorkflowAdapter;
+        }
+    }
+
+    @XmlRootElement(name = "persistenceInfo")
+    @XmlType
+    public class PersistenceInfo implements Serializable {
+
+        private static final long serialVersionUID = 2902980556801069487L;
+
+        private String entityFactory;
+
+        private String plainSchemaDAO;
+
+        private String plainAttrDAO;
+
+        private String plainAttrValueDAO;
+
+        private String anySearchDAO;
+
+        private String userDAO;
+
+        private String groupDAO;
+
+        private String anyObjectDAO;
+
+        private String confDAO;
+
+        public String getEntityFactory() {
+            return entityFactory;
+        }
+
+        public void setEntityFactory(final String entityFactory) {
+            this.entityFactory = entityFactory;
+        }
+
+        public String getPlainSchemaDAO() {
+            return plainSchemaDAO;
+        }
+
+        public void setPlainSchemaDAO(final String plainSchemaDAO) {
+            this.plainSchemaDAO = plainSchemaDAO;
+        }
+
+        public String getPlainAttrDAO() {
+            return plainAttrDAO;
+        }
+
+        public void setPlainAttrDAO(final String plainAttrDAO) {
+            this.plainAttrDAO = plainAttrDAO;
+        }
+
+        public String getPlainAttrValueDAO() {
+            return plainAttrValueDAO;
+        }
+
+        public void setPlainAttrValueDAO(final String plainAttrValueDAO) {
+            this.plainAttrValueDAO = plainAttrValueDAO;
+        }
+
+        public String getAnySearchDAO() {
+            return anySearchDAO;
+        }
+
+        public void setAnySearchDAO(final String anySearchDAO) {
+            this.anySearchDAO = anySearchDAO;
+        }
+
+        public String getUserDAO() {
+            return userDAO;
+        }
+
+        public void setUserDAO(final String userDAO) {
+            this.userDAO = userDAO;
+        }
+
+        public String getGroupDAO() {
+            return groupDAO;
+        }
+
+        public void setGroupDAO(final String groupDAO) {
+            this.groupDAO = groupDAO;
+        }
+
+        public String getAnyObjectDAO() {
+            return anyObjectDAO;
+        }
+
+        public void setAnyObjectDAO(final String anyObjectDAO) {
+            this.anyObjectDAO = anyObjectDAO;
+        }
+
+        public String getConfDAO() {
+            return confDAO;
+        }
+
+        public void setConfDAO(final String confDAO) {
+            this.confDAO = confDAO;
+        }
+    }
+
+    private String version;
+
+    private String buildNumber;
+
+    private final ProvisioningInfo provisioningInfo = new ProvisioningInfo();
+
+    private final WorkflowInfo workflowInfo = new WorkflowInfo();
+
+    private final PersistenceInfo persistenceInfo = new PersistenceInfo();
+
+    private boolean selfRegAllowed;
+
+    private boolean pwdResetAllowed;
+
+    private boolean pwdResetRequiringSecurityQuestions;
 
-    private String anySearchDAO;
+    private final Set<String> connIdLocations = new HashSet<>();
+
+    private String passwordGenerator;
 
     private final List<String> anyTypes = new ArrayList<>();
 
@@ -90,6 +269,18 @@ public class PlatformInfo implements Serializable {
         return buildNumber;
     }
 
+    public ProvisioningInfo getProvisioningInfo() {
+        return provisioningInfo;
+    }
+
+    public WorkflowInfo getWorkflowInfo() {
+        return workflowInfo;
+    }
+
+    public PersistenceInfo getPersistenceInfo() {
+        return persistenceInfo;
+    }
+
     public boolean isSelfRegAllowed() {
         return selfRegAllowed;
     }
@@ -109,38 +300,6 @@ public class PlatformInfo implements Serializable {
         return connIdLocations;
     }
 
-    public String getPropagationTaskExecutor() {
-        return propagationTaskExecutor;
-    }
-
-    public String getAnyObjectWorkflowAdapter() {
-        return anyObjectWorkflowAdapter;
-    }
-
-    public String getUserWorkflowAdapter() {
-        return userWorkflowAdapter;
-    }
-
-    public String getGroupWorkflowAdapter() {
-        return groupWorkflowAdapter;
-    }
-
-    public String getAnyObjectProvisioningManager() {
-        return anyObjectProvisioningManager;
-    }
-
-    public String getUserProvisioningManager() {
-        return userProvisioningManager;
-    }
-
-    public String getGroupProvisioningManager() {
-        return groupProvisioningManager;
-    }
-
-    public String getVirAttrCache() {
-        return virAttrCache;
-    }
-
     public String getPasswordGenerator() {
         return passwordGenerator;
     }
@@ -149,14 +308,6 @@ public class PlatformInfo implements Serializable {
         this.passwordGenerator = passwordGenerator;
     }
 
-    public String getAnySearchDAO() {
-        return anySearchDAO;
-    }
-
-    public void setAnySearchDAO(final String anySearchDAO) {
-        this.anySearchDAO = anySearchDAO;
-    }
-
     @XmlElementWrapper(name = "anyTypes")
     @XmlElement(name = "anyType")
     @JsonProperty("anyTypes")
@@ -223,36 +374,4 @@ public class PlatformInfo implements Serializable {
     public void setPwdResetRequiringSecurityQuestions(final boolean pwdResetRequiringSecurityQuestions)
{
         this.pwdResetRequiringSecurityQuestions = pwdResetRequiringSecurityQuestions;
     }
-
-    public void setPropagationTaskExecutor(final String propagationTaskExecutor) {
-        this.propagationTaskExecutor = propagationTaskExecutor;
-    }
-
-    public void setAnyObjectWorkflowAdapter(final String anyObjectWorkflowAdapter) {
-        this.anyObjectWorkflowAdapter = anyObjectWorkflowAdapter;
-    }
-
-    public void setUserWorkflowAdapter(final String userWorkflowAdapter) {
-        this.userWorkflowAdapter = userWorkflowAdapter;
-    }
-
-    public void setGroupWorkflowAdapter(final String groupWorkflowAdapter) {
-        this.groupWorkflowAdapter = groupWorkflowAdapter;
-    }
-
-    public void setAnyObjectProvisioningManager(final String anyObjectProvisioningManager)
{
-        this.anyObjectProvisioningManager = anyObjectProvisioningManager;
-    }
-
-    public void setUserProvisioningManager(final String userProvisioningManager) {
-        this.userProvisioningManager = userProvisioningManager;
-    }
-
-    public void setGroupProvisioningManager(final String groupProvisioningManager) {
-        this.groupProvisioningManager = groupProvisioningManager;
-    }
-
-    public void setVirAttrCache(final String virAttrCache) {
-        this.virAttrCache = virAttrCache;
-    }
 }
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java
index 1c1a07f..f5eee14 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java
@@ -57,6 +57,9 @@ import org.apache.syncope.core.persistence.api.dao.ExternalResourceDAO;
 import org.apache.syncope.core.persistence.api.dao.GroupDAO;
 import org.apache.syncope.core.persistence.api.dao.NotFoundException;
 import org.apache.syncope.core.persistence.api.dao.NotificationDAO;
+import org.apache.syncope.core.persistence.api.dao.PlainAttrDAO;
+import org.apache.syncope.core.persistence.api.dao.PlainAttrValueDAO;
+import org.apache.syncope.core.persistence.api.dao.PlainSchemaDAO;
 import org.apache.syncope.core.persistence.api.dao.PolicyDAO;
 import org.apache.syncope.core.persistence.api.dao.RoleDAO;
 import org.apache.syncope.core.persistence.api.dao.SecurityQuestionDAO;
@@ -70,6 +73,7 @@ import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
 import org.apache.syncope.core.persistence.api.dao.search.SearchCond;
 import org.apache.syncope.core.persistence.api.entity.AnyType;
 import org.apache.syncope.core.persistence.api.entity.Entity;
+import org.apache.syncope.core.persistence.api.entity.EntityFactory;
 import org.apache.syncope.core.persistence.api.entity.group.Group;
 import org.apache.syncope.core.persistence.api.entity.group.TypeExtension;
 import org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy;
@@ -186,6 +190,18 @@ public class SyncopeLogic extends AbstractLogic<EntityTO> {
     private PasswordGenerator passwordGenerator;
 
     @Autowired
+    private EntityFactory entityFactory;
+
+    @Autowired
+    private PlainSchemaDAO plainSchemaDAO;
+
+    @Autowired
+    private PlainAttrDAO plainAttrDAO;
+
+    @Autowired
+    private PlainAttrValueDAO plainAttrValueDAO;
+
+    @Autowired
     private AnySearchDAO anySearchDAO;
 
     @Autowired
@@ -216,17 +232,44 @@ public class SyncopeLogic extends AbstractLogic<EntityTO> {
                             map(URI::toASCIIString).collect(Collectors.toList()));
                 }
 
-                PLATFORM_INFO.setPropagationTaskExecutor(AopUtils.getTargetClass(propagationTaskExecutor).getName());
-                PLATFORM_INFO.setAnyObjectWorkflowAdapter(AopUtils.getTargetClass(awfAdapter).getName());
-                PLATFORM_INFO.setUserWorkflowAdapter(AopUtils.getTargetClass(uwfAdapter).getName());
-                PLATFORM_INFO.setGroupWorkflowAdapter(AopUtils.getTargetClass(gwfAdapter).getName());
+                PLATFORM_INFO.getWorkflowInfo().
+                        setAnyObjectWorkflowAdapter(AopUtils.getTargetClass(awfAdapter).getName());
+                PLATFORM_INFO.getWorkflowInfo().
+                        setUserWorkflowAdapter(AopUtils.getTargetClass(uwfAdapter).getName());
+                PLATFORM_INFO.getWorkflowInfo().
+                        setGroupWorkflowAdapter(AopUtils.getTargetClass(gwfAdapter).getName());
+
+                PLATFORM_INFO.getProvisioningInfo().
+                        setAnyObjectProvisioningManager(AopUtils.getTargetClass(aProvisioningManager).getName());
+                PLATFORM_INFO.getProvisioningInfo().
+                        setUserProvisioningManager(AopUtils.getTargetClass(uProvisioningManager).getName());
+                PLATFORM_INFO.getProvisioningInfo().
+                        setGroupProvisioningManager(AopUtils.getTargetClass(gProvisioningManager).getName());
+                PLATFORM_INFO.getProvisioningInfo().
+                        setPropagationTaskExecutor(AopUtils.getTargetClass(propagationTaskExecutor).getName());
+                PLATFORM_INFO.getProvisioningInfo().
+                        setVirAttrCache(AopUtils.getTargetClass(virAttrCache).getName());
 
-                PLATFORM_INFO.setAnyObjectProvisioningManager(AopUtils.getTargetClass(aProvisioningManager).getName());
-                PLATFORM_INFO.setUserProvisioningManager(AopUtils.getTargetClass(uProvisioningManager).getName());
-                PLATFORM_INFO.setGroupProvisioningManager(AopUtils.getTargetClass(gProvisioningManager).getName());
-                PLATFORM_INFO.setVirAttrCache(AopUtils.getTargetClass(virAttrCache).getName());
                 PLATFORM_INFO.setPasswordGenerator(AopUtils.getTargetClass(passwordGenerator).getName());
-                PLATFORM_INFO.setAnySearchDAO(AopUtils.getTargetClass(anySearchDAO).getName());
+
+                PLATFORM_INFO.getPersistenceInfo().
+                        setEntityFactory(AopUtils.getTargetClass(entityFactory).getName());
+                PLATFORM_INFO.getPersistenceInfo().
+                        setPlainSchemaDAO(AopUtils.getTargetClass(plainSchemaDAO).getName());
+                PLATFORM_INFO.getPersistenceInfo().
+                        setPlainAttrDAO(AopUtils.getTargetClass(plainAttrDAO).getName());
+                PLATFORM_INFO.getPersistenceInfo().
+                        setPlainAttrValueDAO(AopUtils.getTargetClass(plainAttrValueDAO).getName());
+                PLATFORM_INFO.getPersistenceInfo().
+                        setAnySearchDAO(AopUtils.getTargetClass(anySearchDAO).getName());
+                PLATFORM_INFO.getPersistenceInfo().
+                        setUserDAO(AopUtils.getTargetClass(userDAO).getName());
+                PLATFORM_INFO.getPersistenceInfo().
+                        setGroupDAO(AopUtils.getTargetClass(groupDAO).getName());
+                PLATFORM_INFO.getPersistenceInfo().
+                        setAnyObjectDAO(AopUtils.getTargetClass(anyObjectDAO).getName());
+                PLATFORM_INFO.getPersistenceInfo().
+                        setConfDAO(AopUtils.getTargetClass(confDAO).getName());
 
                 Arrays.stream(ImplementationType.values()).
                         forEach(type -> {
diff --git a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRoutesRestClient.java
b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRoutesRestClient.java
index aac5498..8f3b5ef 100644
--- a/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRoutesRestClient.java
+++ b/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRoutesRestClient.java
@@ -46,11 +46,12 @@ public class CamelRoutesRestClient extends BaseRestClient {
 
     public boolean isCamelEnabledFor(final AnyTypeKind anyTypeKind) {
         return anyTypeKind == AnyTypeKind.USER
-                ? SyncopeConsoleSession.get().getPlatformInfo().getUserProvisioningManager().contains("Camel")
+                ? SyncopeConsoleSession.get().getPlatformInfo().
+                        getProvisioningInfo().getUserProvisioningManager().contains("Camel")
                 : anyTypeKind == AnyTypeKind.ANY_OBJECT
-                        ? SyncopeConsoleSession.get().getPlatformInfo().
+                        ? SyncopeConsoleSession.get().getPlatformInfo().getProvisioningInfo().
                                 getAnyObjectProvisioningManager().contains("Camel")
-                        : SyncopeConsoleSession.get().getPlatformInfo().
+                        : SyncopeConsoleSession.get().getPlatformInfo().getProvisioningInfo().
                                 getGroupProvisioningManager().contains("Camel");
 
     }
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/ElasticsearchDetector.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/ElasticsearchDetector.java
index 5faa424..8ff1763 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/ElasticsearchDetector.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/ElasticsearchDetector.java
@@ -23,7 +23,6 @@ import org.apache.syncope.common.rest.api.service.SyncopeService;
 public class ElasticsearchDetector {
 
     public static boolean isElasticSearchEnabled(final SyncopeService syncopeService) {
-        return syncopeService.platform().getAnySearchDAO().contains("Elasticsearch");
+        return syncopeService.platform().getPersistenceInfo().getAnySearchDAO().contains("Elasticsearch");
     }
-
 }
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/FlowableDetector.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/FlowableDetector.java
index 08afd11..803c252 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/FlowableDetector.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/FlowableDetector.java
@@ -23,6 +23,6 @@ import org.apache.syncope.common.rest.api.service.SyncopeService;
 public class FlowableDetector {
 
     public static boolean isFlowableEnabledForUserWorkflow(final SyncopeService syncopeService)
{
-        return syncopeService.platform().getUserWorkflowAdapter().contains("Flowable");
+        return syncopeService.platform().getWorkflowInfo().getUserWorkflowAdapter().contains("Flowable");
     }
 }
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/CamelRouteITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/CamelRouteITCase.java
index eb5a3a7..8112cf8 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/CamelRouteITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/CamelRouteITCase.java
@@ -40,7 +40,7 @@ public class CamelRouteITCase extends AbstractITCase {
 
     @BeforeEach
     public void check() {
-        assumeTrue(syncopeService.platform().getUserProvisioningManager().contains("Camel"));
+        assumeTrue(syncopeService.platform().getProvisioningInfo().getUserProvisioningManager().contains("Camel"));
     }
 
     @Test


Mime
View raw message