You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2016/02/15 11:45:06 UTC
[1/2] syncope git commit: [SYNCOPE-750] Reworking statistics + adding
numbers about users, groups, any objects, ...
Repository: syncope
Updated Branches:
refs/heads/master 62c8175af -> de0a37d75
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/core/logic/src/main/java/org/apache/syncope/core/logic/SyncopeLogic.java
----------------------------------------------------------------------
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 0adc11e..9d55e62 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
@@ -24,13 +24,23 @@ import java.lang.management.RuntimeMXBean;
import org.apache.syncope.core.misc.EntitlementsHolder;
import java.lang.reflect.Method;
import java.net.URI;
+import java.util.Iterator;
+import java.util.Map;
import javax.annotation.Resource;
-import org.apache.syncope.common.lib.to.PlatformTO;
-import org.apache.syncope.common.lib.to.SyncopeTO;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+import org.apache.syncope.common.lib.info.NumbersInfo;
+import org.apache.syncope.common.lib.info.SystemInfo;
+import org.apache.syncope.common.lib.info.PlatformInfo;
import org.apache.syncope.core.misc.security.PasswordGenerator;
import org.apache.syncope.core.persistence.api.ImplementationLookup;
import org.apache.syncope.core.persistence.api.ImplementationLookup.Type;
+import org.apache.syncope.core.persistence.api.dao.AnyObjectDAO;
import org.apache.syncope.core.persistence.api.dao.ConfDAO;
+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.RoleDAO;
+import org.apache.syncope.core.persistence.api.dao.UserDAO;
+import org.apache.syncope.core.persistence.api.entity.AnyType;
import org.apache.syncope.core.provisioning.api.AnyObjectProvisioningManager;
import org.apache.syncope.core.provisioning.api.ConnIdBundleManager;
import org.apache.syncope.core.provisioning.api.GroupProvisioningManager;
@@ -45,14 +55,30 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
+@Transactional(readOnly = true)
@Component
-public class SyncopeLogic extends AbstractLogic<SyncopeTO> {
+public class SyncopeLogic extends AbstractLogic<AbstractBaseBean> {
private static final int MB = 1024 * 1024;
- private static final SyncopeTO SYNCOPE_TO = new SyncopeTO();
+ private static PlatformInfo PLATFORM_INFO;
- private static final PlatformTO PLATFORM_TO = new PlatformTO();
+ private static SystemInfo SYSTEM_INFO;
+
+ @Autowired
+ private UserDAO userDAO;
+
+ @Autowired
+ private GroupDAO groupDAO;
+
+ @Autowired
+ private AnyObjectDAO anyObjectDAO;
+
+ @Autowired
+ private ExternalResourceDAO resourceDAO;
+
+ @Autowired
+ private RoleDAO roleDAO;
@Autowired
private ConfDAO confDAO;
@@ -90,88 +116,92 @@ public class SyncopeLogic extends AbstractLogic<SyncopeTO> {
@Autowired
private ImplementationLookup implLookup;
- @Transactional(readOnly = true)
public boolean isSelfRegAllowed() {
return confDAO.find("selfRegistration.allowed", "false").getValues().get(0).getBooleanValue();
}
- @Transactional(readOnly = true)
public boolean isPwdResetAllowed() {
return confDAO.find("passwordReset.allowed", "false").getValues().get(0).getBooleanValue();
}
- @Transactional(readOnly = true)
public boolean isPwdResetRequiringSecurityQuestions() {
return confDAO.find("passwordReset.securityQuestion", "true").getValues().get(0).getBooleanValue();
}
@PreAuthorize("isAuthenticated()")
- @Transactional(readOnly = true)
- public SyncopeTO info() {
- synchronized (SYNCOPE_TO) {
- SYNCOPE_TO.setVersion(version);
-
- SYNCOPE_TO.setSelfRegAllowed(isSelfRegAllowed());
- SYNCOPE_TO.setPwdResetAllowed(isPwdResetAllowed());
- SYNCOPE_TO.setPwdResetRequiringSecurityQuestions(isPwdResetRequiringSecurityQuestions());
-
- if (bundleManager.getLocations() != null) {
- for (URI location : bundleManager.getLocations()) {
- SYNCOPE_TO.getConnIdLocations().add(location.toASCIIString());
+ public PlatformInfo platform() {
+ synchronized (this) {
+ if (PLATFORM_INFO == null) {
+ PLATFORM_INFO = new PlatformInfo();
+ PLATFORM_INFO.setVersion(version);
+
+ if (bundleManager.getLocations() != null) {
+ for (URI location : bundleManager.getLocations()) {
+ PLATFORM_INFO.getConnIdLocations().add(location.toASCIIString());
+ }
}
+
+ PLATFORM_INFO.setAnyObjectWorkflowAdapter(AopUtils.getTargetClass(awfAdapter).getName());
+ PLATFORM_INFO.setUserWorkflowAdapter(AopUtils.getTargetClass(uwfAdapter).getName());
+ PLATFORM_INFO.setGroupWorkflowAdapter(AopUtils.getTargetClass(gwfAdapter).getName());
+
+ PLATFORM_INFO.setAnyObjectProvisioningManager(aProvisioningManager.getClass().getName());
+ PLATFORM_INFO.setUserProvisioningManager(uProvisioningManager.getClass().getName());
+ PLATFORM_INFO.setGroupProvisioningManager(gProvisioningManager.getClass().getName());
+ PLATFORM_INFO.setVirAttrCache(virAttrCache.getClass().getName());
+ PLATFORM_INFO.setPasswordGenerator(passwordGenerator.getClass().getName());
+
+ PLATFORM_INFO.getReportlets().addAll(implLookup.getClassNames(Type.REPORTLET));
+ PLATFORM_INFO.getAccountRules().addAll(implLookup.getClassNames(Type.ACCOUNT_RULE));
+ PLATFORM_INFO.getPasswordRules().addAll(implLookup.getClassNames(Type.PASSWORD_RULE));
+ PLATFORM_INFO.getMappingItemTransformers().addAll(
+ implLookup.getClassNames(Type.MAPPING_ITEM_TRANSFORMER));
+ PLATFORM_INFO.getTaskJobs().addAll(implLookup.getClassNames(Type.TASKJOBDELEGATE));
+ PLATFORM_INFO.getReconciliationFilterBuilders().
+ addAll(implLookup.getClassNames(Type.RECONCILIATION_FILTER_BUILDER));
+ PLATFORM_INFO.getLogicActions().addAll(implLookup.getClassNames(Type.LOGIC_ACTIONS));
+ PLATFORM_INFO.getPropagationActions().addAll(implLookup.getClassNames(Type.PROPAGATION_ACTIONS));
+ PLATFORM_INFO.getSyncActions().addAll(implLookup.getClassNames(Type.SYNC_ACTIONS));
+ PLATFORM_INFO.getPushActions().addAll(implLookup.getClassNames(Type.PUSH_ACTIONS));
+ PLATFORM_INFO.getSyncCorrelationRules().addAll(implLookup.getClassNames(Type.SYNC_CORRELATION_RULE));
+ PLATFORM_INFO.getValidators().addAll(implLookup.getClassNames(Type.VALIDATOR));
+ PLATFORM_INFO.getNotificationRecipientsProviders().
+ addAll(implLookup.getClassNames(Type.NOTIFICATION_RECIPIENTS_PROVIDER));
}
- SYNCOPE_TO.setAnyObjectWorkflowAdapter(AopUtils.getTargetClass(awfAdapter).getName());
- SYNCOPE_TO.setUserWorkflowAdapter(AopUtils.getTargetClass(uwfAdapter).getName());
- SYNCOPE_TO.setGroupWorkflowAdapter(AopUtils.getTargetClass(gwfAdapter).getName());
-
- SYNCOPE_TO.setAnyObjectProvisioningManager(aProvisioningManager.getClass().getName());
- SYNCOPE_TO.setUserProvisioningManager(uProvisioningManager.getClass().getName());
- SYNCOPE_TO.setGroupProvisioningManager(gProvisioningManager.getClass().getName());
- SYNCOPE_TO.setVirAttrCache(virAttrCache.getClass().getName());
- SYNCOPE_TO.setPasswordGenerator(passwordGenerator.getClass().getName());
-
- SYNCOPE_TO.getEntitlements().addAll(EntitlementsHolder.getInstance().getValues());
-
- SYNCOPE_TO.getReportlets().addAll(implLookup.getClassNames(Type.REPORTLET));
- SYNCOPE_TO.getAccountRules().addAll(implLookup.getClassNames(Type.ACCOUNT_RULE));
- SYNCOPE_TO.getPasswordRules().addAll(implLookup.getClassNames(Type.PASSWORD_RULE));
- SYNCOPE_TO.getMappingItemTransformers().addAll(implLookup.getClassNames(Type.MAPPING_ITEM_TRANSFORMER));
- SYNCOPE_TO.getTaskJobs().addAll(implLookup.getClassNames(Type.TASKJOBDELEGATE));
- SYNCOPE_TO.getReconciliationFilterBuilders().
- addAll(implLookup.getClassNames(Type.RECONCILIATION_FILTER_BUILDER));
- SYNCOPE_TO.getLogicActions().addAll(implLookup.getClassNames(Type.LOGIC_ACTIONS));
- SYNCOPE_TO.getPropagationActions().addAll(implLookup.getClassNames(Type.PROPAGATION_ACTIONS));
- SYNCOPE_TO.getSyncActions().addAll(implLookup.getClassNames(Type.SYNC_ACTIONS));
- SYNCOPE_TO.getPushActions().addAll(implLookup.getClassNames(Type.PUSH_ACTIONS));
- SYNCOPE_TO.getSyncCorrelationRules().addAll(implLookup.getClassNames(Type.SYNC_CORRELATION_RULE));
- SYNCOPE_TO.getValidators().addAll(implLookup.getClassNames(Type.VALIDATOR));
- SYNCOPE_TO.getNotificationRecipientsProviders().
- addAll(implLookup.getClassNames(Type.NOTIFICATION_RECIPIENTS_PROVIDER));
+ PLATFORM_INFO.setSelfRegAllowed(isSelfRegAllowed());
+ PLATFORM_INFO.setPwdResetAllowed(isPwdResetAllowed());
+ PLATFORM_INFO.setPwdResetRequiringSecurityQuestions(isPwdResetRequiringSecurityQuestions());
+
+ PLATFORM_INFO.getEntitlements().clear();
+ PLATFORM_INFO.getEntitlements().addAll(EntitlementsHolder.getInstance().getValues());
}
- return SYNCOPE_TO;
+ return PLATFORM_INFO;
}
@PreAuthorize("isAuthenticated()")
- @Transactional(readOnly = true)
- public PlatformTO platform() {
+ public SystemInfo system() {
+ synchronized (this) {
+ OperatingSystemMXBean operatingSystemMXBean = ManagementFactory.getOperatingSystemMXBean();
+ RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
+
+ if (SYSTEM_INFO == null) {
+ SYSTEM_INFO = new SystemInfo();
+ SYSTEM_INFO.setOs(operatingSystemMXBean.getName()
+ + " " + operatingSystemMXBean.getVersion()
+ + " " + operatingSystemMXBean.getArch());
+ SYSTEM_INFO.setAvailableProcessors(operatingSystemMXBean.getAvailableProcessors());
+ SYSTEM_INFO.setJvm(
+ runtimeMXBean.getVmName()
+ + " " + System.getProperty("java.version")
+ + " " + runtimeMXBean.getVmVendor());
+ }
- synchronized (PLATFORM_TO) {
- PlatformTO.PlatformLoad instant = new PlatformTO.PlatformLoad();
+ SystemInfo.PlatformLoad instant = new SystemInfo.PlatformLoad();
- OperatingSystemMXBean operatingSystemMXBean = ManagementFactory.getOperatingSystemMXBean();
- PLATFORM_TO.setOs(operatingSystemMXBean.getName()
- + " " + operatingSystemMXBean.getVersion()
- + " " + operatingSystemMXBean.getArch());
- PLATFORM_TO.setAvailableProcessors(operatingSystemMXBean.getAvailableProcessors());
instant.setSystemLoadAverage(operatingSystemMXBean.getSystemLoadAverage());
- RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
- PLATFORM_TO.setJvm(
- runtimeMXBean.getVmName()
- + " " + System.getProperty("java.version")
- + " " + runtimeMXBean.getVmVendor());
instant.setUptime(runtimeMXBean.getUptime());
Runtime runtime = Runtime.getRuntime();
@@ -179,14 +209,49 @@ public class SyncopeLogic extends AbstractLogic<SyncopeTO> {
instant.setMaxMemory(runtime.maxMemory() / MB);
instant.setFreeMemory(runtime.freeMemory() / MB);
- PLATFORM_TO.getLoad().add(instant);
+ SYSTEM_INFO.getLoad().add(instant);
}
- return PLATFORM_TO;
+ return SYSTEM_INFO;
+ }
+
+ @PreAuthorize("isAuthenticated()")
+ public NumbersInfo numbers() {
+ NumbersInfo numbersInfo = new NumbersInfo();
+
+ numbersInfo.setTotalUsers(userDAO.count());
+ numbersInfo.getUsersByRealm().putAll(userDAO.countByRealm());
+ numbersInfo.getUsersByStatus().putAll(userDAO.countByStatus());
+
+ numbersInfo.setTotalGroups(groupDAO.count());
+ numbersInfo.getGroupsByRealm().putAll(groupDAO.countByRealm());
+
+ Map<AnyType, Integer> anyObjectNumbers = anyObjectDAO.countByType();
+ int i = 0;
+ for (Iterator<Map.Entry<AnyType, Integer>> itor = anyObjectNumbers.entrySet().iterator();
+ i < 2 && itor.hasNext(); i++) {
+
+ Map.Entry<AnyType, Integer> entry = itor.next();
+ if (i == 0) {
+ numbersInfo.setAnyType1(entry.getKey().getKey());
+ numbersInfo.setTotalAny1(entry.getValue());
+ numbersInfo.getAny1ByRealm().putAll(anyObjectDAO.countByRealm(entry.getKey()));
+ } else if (i == 1) {
+ numbersInfo.setAnyType2(entry.getKey().getKey());
+ numbersInfo.setTotalAny2(entry.getValue());
+ numbersInfo.getAny2ByRealm().putAll(anyObjectDAO.countByRealm(entry.getKey()));
+ }
+ }
+
+ numbersInfo.setTotalResources(resourceDAO.count());
+
+ numbersInfo.setTotalRoles(roleDAO.count());
+
+ return numbersInfo;
}
@Override
- protected SyncopeTO resolveReference(final Method method, final Object... args)
+ protected AbstractBaseBean resolveReference(final Method method, final Object... args)
throws UnresolvedReferenceException {
throw new UnresolvedReferenceException();
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyObjectDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyObjectDAO.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyObjectDAO.java
index 32845a2..7fabda3 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyObjectDAO.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AnyObjectDAO.java
@@ -20,6 +20,8 @@ package org.apache.syncope.core.persistence.api.dao;
import java.util.Collection;
import java.util.List;
+import java.util.Map;
+import org.apache.syncope.core.persistence.api.entity.AnyType;
import org.apache.syncope.core.persistence.api.entity.anyobject.ARelationship;
import org.apache.syncope.core.persistence.api.entity.anyobject.AnyObject;
import org.apache.syncope.core.persistence.api.entity.group.Group;
@@ -28,6 +30,16 @@ import org.apache.syncope.core.persistence.api.entity.user.URelationship;
public interface AnyObjectDAO extends AnyDAO<AnyObject> {
+ /**
+ * Counts the number of instances for each type.
+ * The returned map is expected to be sorted on values.
+ *
+ * @return the number of instances for each type
+ */
+ Map<AnyType, Integer> countByType();
+
+ Map<String, Integer> countByRealm(AnyType anyType);
+
List<Group> findDynGroupMemberships(AnyObject anyObject);
List<ARelationship> findARelationships(AnyObject anyObject);
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ExternalResourceDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ExternalResourceDAO.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ExternalResourceDAO.java
index aeabe23..35e9689 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ExternalResourceDAO.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ExternalResourceDAO.java
@@ -27,6 +27,8 @@ import org.apache.syncope.core.persistence.api.entity.resource.Provision;
public interface ExternalResourceDAO extends DAO<ExternalResource, String> {
+ int count();
+
ExternalResource find(String key);
Provision findProvision(Long key);
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/GroupDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/GroupDAO.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/GroupDAO.java
index 65555c2..d372fbc 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/GroupDAO.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/GroupDAO.java
@@ -31,6 +31,10 @@ import org.apache.syncope.core.persistence.api.entity.user.User;
public interface GroupDAO extends AnyDAO<Group> {
+ int count();
+
+ Map<String, Integer> countByRealm();
+
Group find(String name);
List<Group> findOwnedByUser(Long userKey);
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RoleDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RoleDAO.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RoleDAO.java
index d838df7..2b76eb9 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RoleDAO.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RoleDAO.java
@@ -25,6 +25,8 @@ import org.apache.syncope.core.persistence.api.entity.user.User;
public interface RoleDAO extends DAO<Role, String> {
+ int count();
+
Role find(String key);
List<Role> findByRealm(Realm realm);
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/UserDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/UserDAO.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/UserDAO.java
index 3fc9b99..3eed6bc 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/UserDAO.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/UserDAO.java
@@ -20,6 +20,7 @@ package org.apache.syncope.core.persistence.api.dao;
import java.util.Collection;
import java.util.List;
+import java.util.Map;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.core.persistence.api.entity.Role;
import org.apache.syncope.core.persistence.api.entity.group.Group;
@@ -29,6 +30,12 @@ import org.apache.syncope.core.persistence.api.entity.user.User;
public interface UserDAO extends AnyDAO<User> {
+ int count();
+
+ Map<String, Integer> countByRealm();
+
+ Map<String, Integer> countByStatus();
+
User authFind(String username);
User find(String username);
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
index e27c1c9..4513837 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAAnyObjectDAO.java
@@ -20,9 +20,14 @@ package org.apache.syncope.core.persistence.jpa.dao;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import java.util.Set;
+import javax.persistence.Query;
import javax.persistence.TypedQuery;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.IterableUtils;
@@ -36,7 +41,9 @@ import org.apache.syncope.core.misc.security.DelegatedAdministrationException;
import org.apache.syncope.core.misc.utils.EntityUtils;
import org.apache.syncope.core.persistence.api.dao.AnyObjectDAO;
import org.apache.syncope.core.persistence.api.dao.GroupDAO;
+import org.apache.syncope.core.persistence.api.entity.AnyType;
import org.apache.syncope.core.persistence.api.entity.AnyUtils;
+import org.apache.syncope.core.persistence.api.entity.Realm;
import org.apache.syncope.core.persistence.api.entity.anyobject.AMembership;
import org.apache.syncope.core.persistence.api.entity.anyobject.ARelationship;
import org.apache.syncope.core.persistence.api.entity.anyobject.AnyObject;
@@ -46,6 +53,7 @@ import org.apache.syncope.core.persistence.api.entity.user.URelationship;
import org.apache.syncope.core.persistence.jpa.entity.JPAAnyUtilsFactory;
import org.apache.syncope.core.persistence.jpa.entity.anyobject.JPAADynGroupMembership;
import org.apache.syncope.core.persistence.jpa.entity.anyobject.JPAARelationship;
+import org.apache.syncope.core.persistence.jpa.entity.anyobject.JPAAnyObject;
import org.apache.syncope.core.persistence.jpa.entity.user.JPAURelationship;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@@ -59,6 +67,39 @@ public class JPAAnyObjectDAO extends AbstractAnyDAO<AnyObject> implements AnyObj
private GroupDAO groupDAO;
@Override
+ public Map<AnyType, Integer> countByType() {
+ Query query = entityManager().createQuery(
+ "SELECT e.type, COUNT(e) AS countByType FROM " + JPAAnyObject.class.getSimpleName() + " e "
+ + "GROUP BY e.type ORDER BY countByType DESC");
+ @SuppressWarnings("unchecked")
+ List<Object[]> results = query.getResultList();
+
+ Map<AnyType, Integer> countByRealm = new LinkedHashMap<>(results.size());
+ for (Object[] result : results) {
+ countByRealm.put((AnyType) result[0], ((Number) result[1]).intValue());
+ }
+
+ return Collections.unmodifiableMap(countByRealm);
+ }
+
+ @Override
+ public Map<String, Integer> countByRealm(final AnyType anyType) {
+ Query query = entityManager().createQuery(
+ "SELECT e.realm, COUNT(e) FROM " + JPAAnyObject.class.getSimpleName() + " e "
+ + "WHERE e.type=:type GROUP BY e.realm");
+ query.setParameter("type", anyType);
+ @SuppressWarnings("unchecked")
+ List<Object[]> results = query.getResultList();
+
+ Map<String, Integer> countByRealm = new HashMap<>(results.size());
+ for (Object[] result : results) {
+ countByRealm.put(((Realm) result[0]).getFullPath(), ((Number) result[1]).intValue());
+ }
+
+ return Collections.unmodifiableMap(countByRealm);
+ }
+
+ @Override
protected AnyUtils init() {
return new JPAAnyUtilsFactory().getInstance(AnyTypeKind.ANY_OBJECT);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAExternalResourceDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAExternalResourceDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAExternalResourceDAO.java
index b270d8b..392f357 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAExternalResourceDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAExternalResourceDAO.java
@@ -21,6 +21,7 @@ package org.apache.syncope.core.persistence.jpa.dao;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import javax.persistence.Query;
import javax.persistence.TypedQuery;
import org.apache.syncope.common.lib.types.IntMappingType;
import org.apache.syncope.common.lib.types.PolicyType;
@@ -76,6 +77,13 @@ public class JPAExternalResourceDAO extends AbstractDAO<ExternalResource, String
private ConnectorRegistry connRegistry;
@Override
+ public int count() {
+ Query query = entityManager().createQuery(
+ "SELECT COUNT(e) FROM " + JPAExternalResource.class.getSimpleName() + " e");
+ return ((Number) query.getSingleResult()).intValue();
+ }
+
+ @Override
public ExternalResource find(final String name) {
return entityManager().find(JPAExternalResource.class, name);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
index 6c4815c..ece8d6c 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAGroupDAO.java
@@ -24,6 +24,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.persistence.NoResultException;
+import javax.persistence.Query;
import javax.persistence.TypedQuery;
import org.apache.commons.collections4.IterableUtils;
import org.apache.commons.collections4.Predicate;
@@ -76,6 +77,28 @@ public class JPAGroupDAO extends AbstractAnyDAO<Group> implements GroupDAO {
}
@Override
+ public int count() {
+ Query query = entityManager().createQuery(
+ "SELECT COUNT(e) FROM " + JPAGroup.class.getSimpleName() + " e");
+ return ((Number) query.getSingleResult()).intValue();
+ }
+
+ @Override
+ public Map<String, Integer> countByRealm() {
+ Query query = entityManager().createQuery(
+ "SELECT e.realm, COUNT(e) FROM " + JPAGroup.class.getSimpleName() + " e GROUP BY e.realm");
+ @SuppressWarnings("unchecked")
+ List<Object[]> results = query.getResultList();
+
+ Map<String, Integer> countByRealm = new HashMap<>(results.size());
+ for (Object[] result : results) {
+ countByRealm.put(((Realm) result[0]).getFullPath(), ((Number) result[1]).intValue());
+ }
+
+ return Collections.unmodifiableMap(countByRealm);
+ }
+
+ @Override
protected void securityChecks(final Group group) {
Set<String> authRealms = AuthContextUtils.getAuthorizations().get(StandardEntitlement.GROUP_READ);
boolean authorized = IterableUtils.matchesAny(authRealms, new Predicate<String>() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARoleDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARoleDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARoleDAO.java
index 19ee6d1..406a378 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARoleDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARoleDAO.java
@@ -19,6 +19,7 @@
package org.apache.syncope.core.persistence.jpa.dao;
import java.util.List;
+import javax.persistence.Query;
import javax.persistence.TypedQuery;
import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.core.misc.search.SearchCondConverter;
@@ -40,6 +41,13 @@ public class JPARoleDAO extends AbstractDAO<Role, String> implements RoleDAO {
private AnySearchDAO searchDAO;
@Override
+ public int count() {
+ Query query = entityManager().createQuery(
+ "SELECT COUNT(e) FROM " + JPARole.class.getSimpleName() + " e");
+ return ((Number) query.getSingleResult()).intValue();
+ }
+
+ @Override
public Role find(final String key) {
return entityManager().find(JPARole.class, key);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
index 0bbe763..822c02d 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAUserDAO.java
@@ -20,11 +20,15 @@ package org.apache.syncope.core.persistence.jpa.dao;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import javax.annotation.Resource;
import javax.persistence.NoResultException;
+import javax.persistence.Query;
import javax.persistence.TypedQuery;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.IterableUtils;
@@ -98,6 +102,43 @@ public class JPAUserDAO extends AbstractAnyDAO<User> implements UserDAO {
}
@Override
+ public int count() {
+ Query query = entityManager().createQuery(
+ "SELECT COUNT(e) FROM " + JPAUser.class.getSimpleName() + " e");
+ return ((Number) query.getSingleResult()).intValue();
+ }
+
+ @Override
+ public Map<String, Integer> countByRealm() {
+ Query query = entityManager().createQuery(
+ "SELECT e.realm, COUNT(e) FROM " + JPAUser.class.getSimpleName() + " e GROUP BY e.realm");
+ @SuppressWarnings("unchecked")
+ List<Object[]> results = query.getResultList();
+
+ Map<String, Integer> countByRealm = new HashMap<>(results.size());
+ for (Object[] result : results) {
+ countByRealm.put(((Realm) result[0]).getFullPath(), ((Number) result[1]).intValue());
+ }
+
+ return Collections.unmodifiableMap(countByRealm);
+ }
+
+ @Override
+ public Map<String, Integer> countByStatus() {
+ Query query = entityManager().createQuery(
+ "SELECT e.status, COUNT(e) FROM " + JPAUser.class.getSimpleName() + " e GROUP BY e.status");
+ @SuppressWarnings("unchecked")
+ List<Object[]> results = query.getResultList();
+
+ Map<String, Integer> countByStatus = new HashMap<>(results.size());
+ for (Object[] result : results) {
+ countByStatus.put(((String) result[0]), ((Number) result[1]).intValue());
+ }
+
+ return Collections.unmodifiableMap(countByStatus);
+ }
+
+ @Override
protected void securityChecks(final User user) {
// Allows anonymous (during self-registration) and self (during self-update) to read own user,
// otherwise goes through security checks to see if required entitlements are owned
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SyncopeServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SyncopeServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SyncopeServiceImpl.java
index 69acb72..944d684 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SyncopeServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SyncopeServiceImpl.java
@@ -18,8 +18,9 @@
*/
package org.apache.syncope.core.rest.cxf.service;
-import org.apache.syncope.common.lib.to.PlatformTO;
-import org.apache.syncope.common.lib.to.SyncopeTO;
+import org.apache.syncope.common.lib.info.NumbersInfo;
+import org.apache.syncope.common.lib.info.SystemInfo;
+import org.apache.syncope.common.lib.info.PlatformInfo;
import org.apache.syncope.common.rest.api.service.SyncopeService;
import org.apache.syncope.core.logic.SyncopeLogic;
import org.springframework.beans.factory.annotation.Autowired;
@@ -32,13 +33,18 @@ public class SyncopeServiceImpl extends AbstractServiceImpl implements SyncopeSe
private SyncopeLogic logic;
@Override
- public SyncopeTO syncope() {
- return logic.info();
+ public PlatformInfo platform() {
+ return logic.platform();
}
@Override
- public PlatformTO platform() {
- return logic.platform();
+ public SystemInfo system() {
+ return logic.system();
+ }
+
+ @Override
+ public NumbersInfo numbers() {
+ return logic.numbers();
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/ext/camel/client-console/src/main/java/org/apache/syncope/client/console/rest/CamelRoutesRestClient.java
----------------------------------------------------------------------
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 d3cbfc9..f1ddc0a 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
@@ -43,10 +43,12 @@ public class CamelRoutesRestClient extends BaseRestClient {
public boolean isCamelEnabledFor(final AnyTypeKind anyTypeKind) {
return anyTypeKind == AnyTypeKind.USER
- ? SyncopeConsoleSession.get().getSyncopeTO().getUserProvisioningManager().contains("Camel")
+ ? SyncopeConsoleSession.get().getPlatformInfo().getUserProvisioningManager().contains("Camel")
: anyTypeKind == AnyTypeKind.ANY_OBJECT
- ? SyncopeConsoleSession.get().getSyncopeTO().getAnyObjectProvisioningManager().contains("Camel")
- : SyncopeConsoleSession.get().getSyncopeTO().getGroupProvisioningManager().contains("Camel");
+ ? SyncopeConsoleSession.get().getPlatformInfo().
+ getAnyObjectProvisioningManager().contains("Camel")
+ : SyncopeConsoleSession.get().getPlatformInfo().
+ getGroupProvisioningManager().contains("Camel");
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/fit/core-reference/src/test/java/org/apache/syncope/fit/ActivitiDetector.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/ActivitiDetector.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/ActivitiDetector.java
index a951e02..d14eec2 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/ActivitiDetector.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/ActivitiDetector.java
@@ -23,14 +23,14 @@ import org.apache.syncope.common.rest.api.service.SyncopeService;
public class ActivitiDetector {
public static boolean isActivitiEnabledForUsers(final SyncopeService syncopeService) {
- return syncopeService.syncope().getUserWorkflowAdapter().contains("Activiti");
+ return syncopeService.platform().getUserWorkflowAdapter().contains("Activiti");
}
public static boolean isActivitiEnabledForGroups(final SyncopeService syncopeService) {
- return syncopeService.syncope().getGroupWorkflowAdapter().contains("Activiti");
+ return syncopeService.platform().getGroupWorkflowAdapter().contains("Activiti");
}
public static boolean isActivitiEnabledForAnyObjects(final SyncopeService syncopeService) {
- return syncopeService.syncope().getAnyObjectWorkflowAdapter().contains("Activiti");
+ return syncopeService.platform().getAnyObjectWorkflowAdapter().contains("Activiti");
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/fit/core-reference/src/test/java/org/apache/syncope/fit/CamelDetector.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/CamelDetector.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/CamelDetector.java
index 0a3f839..8ac7871 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/CamelDetector.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/CamelDetector.java
@@ -23,14 +23,14 @@ import org.apache.syncope.common.rest.api.service.SyncopeService;
public class CamelDetector {
public static boolean isCamelEnabledForUsers(final SyncopeService syncopeService) {
- return syncopeService.syncope().getUserProvisioningManager().contains("Camel");
+ return syncopeService.platform().getUserProvisioningManager().contains("Camel");
}
public static boolean isCamelEnabledForGroups(final SyncopeService syncopeService) {
- return syncopeService.syncope().getGroupProvisioningManager().contains("Camel");
+ return syncopeService.platform().getGroupProvisioningManager().contains("Camel");
}
public static boolean isCamelEnabledForAnyObjects(final SyncopeService syncopeService) {
- return syncopeService.syncope().getAnyObjectProvisioningManager().contains("Camel");
+ return syncopeService.platform().getAnyObjectProvisioningManager().contains("Camel");
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/fit/core-reference/src/test/java/org/apache/syncope/fit/cli/CLIITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/cli/CLIITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/cli/CLIITCase.java
index 3cf2e6a..5995146 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/cli/CLIITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/cli/CLIITCase.java
@@ -137,7 +137,7 @@ public class CLIITCase extends AbstractITCase {
return line.startsWith("-");
}
});
- assertEquals(syncopeService.syncope().getEntitlements().size(), entitlements);
+ assertEquals(syncopeService.platform().getEntitlements().size(), entitlements);
process.destroy();
} catch (IOException e) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java
index 9e2c3c3..d32350c 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuthenticationITCase.java
@@ -117,7 +117,7 @@ public class AuthenticationITCase extends AbstractITCase {
// 3. as admin
self = adminClient.self();
- assertEquals(syncopeService.syncope().getEntitlements().size(), self.getKey().size());
+ assertEquals(syncopeService.platform().getEntitlements().size(), self.getKey().size());
assertFalse(self.getKey().keySet().contains(StandardEntitlement.ANONYMOUS));
assertEquals(ADMIN_UNAME, self.getValue().getUsername());
@@ -402,7 +402,7 @@ public class AuthenticationITCase extends AbstractITCase {
final String anyTypeKey = "FOLDER " + getUUIDString();
// 1. no entitlement exists (yet) for the any type to be created
- assertFalse(IterableUtils.matchesAny(syncopeService.syncope().getEntitlements(), new Predicate<String>() {
+ assertFalse(IterableUtils.matchesAny(syncopeService.platform().getEntitlements(), new Predicate<String>() {
@Override
public boolean evaluate(final String entitlement) {
@@ -428,7 +428,7 @@ public class AuthenticationITCase extends AbstractITCase {
anyTypeService.create(anyTypeTO);
// 2. now entitlement exists for the any type just created
- assertTrue(IterableUtils.matchesAny(syncopeService.syncope().getEntitlements(), new Predicate<String>() {
+ assertTrue(IterableUtils.matchesAny(syncopeService.platform().getEntitlements(), new Predicate<String>() {
@Override
public boolean evaluate(final String entitlement) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PolicyITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PolicyITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PolicyITCase.java
index dd90fb8..cf7f335 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PolicyITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PolicyITCase.java
@@ -161,7 +161,7 @@ public class PolicyITCase extends AbstractITCase {
@Test
public void getCorrelationRules() {
- assertEquals(2, syncopeService.syncope().getSyncCorrelationRules().size());
+ assertEquals(2, syncopeService.platform().getSyncCorrelationRules().size());
}
@Test
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java
index 9c09f00..3dafc94 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java
@@ -67,7 +67,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
@Test
public void getPushActionsClasses() {
- Set<String> actions = syncopeService.syncope().getPushActions();
+ Set<String> actions = syncopeService.platform().getPushActions();
assertNotNull(actions);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportITCase.java
index ad1c1e8..1179671 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportITCase.java
@@ -66,7 +66,7 @@ public class ReportITCase extends AbstractITCase {
@Test
public void getReportletClasses() {
- Set<String> reportlets = syncopeService.syncope().getReportlets();
+ Set<String> reportlets = syncopeService.platform().getReportlets();
assertNotNull(reportlets);
assertFalse(reportlets.isEmpty());
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ResourceITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ResourceITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ResourceITCase.java
index 123e659..cc6706f 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ResourceITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ResourceITCase.java
@@ -103,7 +103,7 @@ public class ResourceITCase extends AbstractITCase {
@Test
public void getPropagationActionsClasses() {
- Set<String> actions = syncopeService.syncope().getPropagationActions();
+ Set<String> actions = syncopeService.platform().getPropagationActions();
assertNotNull(actions);
assertFalse(actions.isEmpty());
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
index dbfd158..0b67502 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
@@ -53,7 +53,7 @@ public class SchedTaskITCase extends AbstractTaskITCase {
@Test
public void getJobClasses() {
- Set<String> jobClasses = syncopeService.syncope().getTaskJobs();
+ Set<String> jobClasses = syncopeService.platform().getTaskJobs();
assertNotNull(jobClasses);
assertFalse(jobClasses.isEmpty());
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SyncTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SyncTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SyncTaskITCase.java
index 23c30a1..d677571 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SyncTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SyncTaskITCase.java
@@ -96,7 +96,7 @@ public class SyncTaskITCase extends AbstractTaskITCase {
@Test
public void getSyncActionsClasses() {
- Set<String> actions = syncopeService.syncope().getSyncActions();
+ Set<String> actions = syncopeService.platform().getSyncActions();
assertNotNull(actions);
assertFalse(actions.isEmpty());
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java
index b3180ba..abbac1a 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserSelfITCase.java
@@ -65,7 +65,7 @@ public class UserSelfITCase extends AbstractITCase {
@Test
public void selfRegistrationAllowed() {
- assertTrue(syncopeService.syncope().isSelfRegAllowed());
+ assertTrue(syncopeService.platform().isSelfRegAllowed());
}
@Test
[2/2] syncope git commit: [SYNCOPE-750] Reworking statistics + adding
numbers about users, groups, any objects, ...
Posted by il...@apache.org.
[SYNCOPE-750] Reworking statistics + adding numbers about users, groups, any objects, ...
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/de0a37d7
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/de0a37d7
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/de0a37d7
Branch: refs/heads/master
Commit: de0a37d750f7671fb5160cad39f54e08a6f9b420
Parents: 62c8175
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Mon Feb 15 11:44:53 2016 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Mon Feb 15 11:44:53 2016 +0100
----------------------------------------------------------------------
.../syncope/client/cli/SyncopeServices.java | 2 +-
.../EntitlementSyncopeOperations.java | 6 +-
.../syncope/client/cli/commands/info/Info.java | 57 ++--
.../cli/commands/install/InstallSetup.java | 2 +-
.../commands/install/InstallSetupForDebug.java | 2 +-
.../client/console/SyncopeConsoleSession.java | 10 +-
.../console/panels/PlainSchemaDetails.java | 2 +-
.../client/console/rest/PolicyRestClient.java | 2 +-
.../client/console/rest/ResourceRestClient.java | 2 +-
.../client/console/rest/RoleRestClient.java | 2 +-
.../client/console/rest/SchemaRestClient.java | 2 +-
.../client/console/rest/TaskRestClient.java | 6 +-
.../client/console/rest/UserSelfRestClient.java | 6 +-
.../client/console/rest/WorkflowRestClient.java | 2 +-
.../client/console/topology/Topology.java | 2 +-
.../client/enduser/SyncopeEnduserSession.java | 11 +-
.../enduser/adapters/PlatformInfoAdapter.java | 41 +++
.../enduser/adapters/SyncopeTOAdapter.java | 43 ---
.../enduser/model/PlatformInfoRequest.java | 80 +++++
.../client/enduser/model/SyncopeTORequest.java | 80 -----
.../enduser/resources/AbstractBaseResource.java | 2 +-
.../client/enduser/resources/InfoResource.java | 15 +-
.../resources/UserSelfPasswordReset.java | 2 +-
.../syncope/common/lib/info/NumbersInfo.java | 162 ++++++++++
.../syncope/common/lib/info/PlatformInfo.java | 299 +++++++++++++++++++
.../syncope/common/lib/info/SystemInfo.java | 131 ++++++++
.../syncope/common/lib/to/PlatformTO.java | 131 --------
.../apache/syncope/common/lib/to/SyncopeTO.java | 299 -------------------
.../common/rest/api/service/SyncopeService.java | 32 +-
.../syncope/core/logic/AbstractLogic.java | 2 +-
.../apache/syncope/core/logic/SyncopeLogic.java | 195 ++++++++----
.../core/persistence/api/dao/AnyObjectDAO.java | 12 +
.../api/dao/ExternalResourceDAO.java | 2 +
.../core/persistence/api/dao/GroupDAO.java | 4 +
.../core/persistence/api/dao/RoleDAO.java | 2 +
.../core/persistence/api/dao/UserDAO.java | 7 +
.../persistence/jpa/dao/JPAAnyObjectDAO.java | 41 +++
.../jpa/dao/JPAExternalResourceDAO.java | 8 +
.../core/persistence/jpa/dao/JPAGroupDAO.java | 23 ++
.../core/persistence/jpa/dao/JPARoleDAO.java | 8 +
.../core/persistence/jpa/dao/JPAUserDAO.java | 41 +++
.../rest/cxf/service/SyncopeServiceImpl.java | 18 +-
.../console/rest/CamelRoutesRestClient.java | 8 +-
.../apache/syncope/fit/ActivitiDetector.java | 6 +-
.../org/apache/syncope/fit/CamelDetector.java | 6 +-
.../org/apache/syncope/fit/cli/CLIITCase.java | 2 +-
.../syncope/fit/core/AuthenticationITCase.java | 6 +-
.../apache/syncope/fit/core/PolicyITCase.java | 2 +-
.../apache/syncope/fit/core/PushTaskITCase.java | 2 +-
.../apache/syncope/fit/core/ReportITCase.java | 2 +-
.../apache/syncope/fit/core/ResourceITCase.java | 2 +-
.../syncope/fit/core/SchedTaskITCase.java | 2 +-
.../apache/syncope/fit/core/SyncTaskITCase.java | 2 +-
.../apache/syncope/fit/core/UserSelfITCase.java | 2 +-
54 files changed, 1114 insertions(+), 724 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/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 335546b..d1cb9af 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
@@ -67,7 +67,7 @@ public final class SyncopeServices {
}
final SyncopeClient syncopeClient = new SyncopeClientFactoryBean()
.setAddress(properties.getProperty("syncope.rest.services")).create(username, password);
- syncopeClient.getService(SyncopeService.class).syncope();
+ syncopeClient.getService(SyncopeService.class).platform();
}
private SyncopeServices() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementSyncopeOperations.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementSyncopeOperations.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementSyncopeOperations.java
index 55522d2..31053a8 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementSyncopeOperations.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/entitlement/EntitlementSyncopeOperations.java
@@ -25,20 +25,20 @@ import org.apache.syncope.client.cli.SyncopeServices;
import org.apache.syncope.client.cli.commands.role.RoleSyncopeOperations;
import org.apache.syncope.client.cli.commands.user.UserSyncopeOperations;
import org.apache.syncope.common.lib.to.RoleTO;
-import org.apache.syncope.common.lib.to.SyncopeTO;
+import org.apache.syncope.common.lib.info.PlatformInfo;
import org.apache.syncope.common.lib.to.UserTO;
import org.apache.syncope.common.rest.api.service.SyncopeService;
public class EntitlementSyncopeOperations {
- private final SyncopeTO syncopeTO = SyncopeServices.get(SyncopeService.class).syncope();
+ private final PlatformInfo platformInfo = SyncopeServices.get(SyncopeService.class).platform();
private final UserSyncopeOperations userSyncopeOperations = new UserSyncopeOperations();
private final RoleSyncopeOperations roleSyncopeOperations = new RoleSyncopeOperations();
public Set<String> list() {
- return syncopeTO.getEntitlements();
+ return platformInfo.getEntitlements();
}
public boolean exists(final String entitlement) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/cli/src/main/java/org/apache/syncope/client/cli/commands/info/Info.java
----------------------------------------------------------------------
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 d02fcd8..bae4b88 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
@@ -19,7 +19,7 @@
package org.apache.syncope.client.cli.commands.info;
import org.apache.syncope.client.cli.SyncopeServices;
-import org.apache.syncope.common.lib.to.SyncopeTO;
+import org.apache.syncope.common.lib.info.PlatformInfo;
import org.apache.syncope.common.rest.api.service.SyncopeService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -28,13 +28,13 @@ public class Info {
private static final Logger LOG = LoggerFactory.getLogger(Info.class);
- private final SyncopeTO syncopeTO = SyncopeServices.get(SyncopeService.class).syncope();
+ private final PlatformInfo platformInfo = SyncopeServices.get(SyncopeService.class).platform();
private final InfoResultManager infoResultManager = new InfoResultManager();
public void version() {
try {
- infoResultManager.printVersion(syncopeTO.getVersion());
+ infoResultManager.printVersion(platformInfo.getVersion());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -43,7 +43,7 @@ public class Info {
public void pwdResetAllowed() {
try {
- infoResultManager.printPwdResetAllowed(syncopeTO.isPwdResetAllowed());
+ infoResultManager.printPwdResetAllowed(platformInfo.isPwdResetAllowed());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -52,7 +52,8 @@ public class Info {
public void resetWithSecurityQuestion() {
try {
- infoResultManager.printPwdResetRequiringSecurityQuestions(syncopeTO.isPwdResetRequiringSecurityQuestions());
+ infoResultManager.printPwdResetRequiringSecurityQuestions(
+ platformInfo.isPwdResetRequiringSecurityQuestions());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -61,7 +62,7 @@ public class Info {
public void selfRegistrationAllowed() {
try {
- infoResultManager.printSelfRegistrationAllowed(syncopeTO.isSelfRegAllowed());
+ infoResultManager.printSelfRegistrationAllowed(platformInfo.isSelfRegAllowed());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -71,9 +72,9 @@ public class Info {
public void provisioningManager() {
try {
infoResultManager.printProvisioningManager(
- syncopeTO.getAnyObjectProvisioningManager(),
- syncopeTO.getUserProvisioningManager(),
- syncopeTO.getGroupProvisioningManager());
+ platformInfo.getAnyObjectProvisioningManager(),
+ platformInfo.getUserProvisioningManager(),
+ platformInfo.getGroupProvisioningManager());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -83,9 +84,9 @@ public class Info {
public void workflowAdapter() {
try {
infoResultManager.printWorkflowAdapter(
- syncopeTO.getAnyObjectWorkflowAdapter(),
- syncopeTO.getUserWorkflowAdapter(),
- syncopeTO.getGroupWorkflowAdapter());
+ platformInfo.getAnyObjectWorkflowAdapter(),
+ platformInfo.getUserWorkflowAdapter(),
+ platformInfo.getGroupWorkflowAdapter());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -94,7 +95,7 @@ public class Info {
public void accountRules() {
try {
- infoResultManager.printAccountRules(syncopeTO.getAccountRules());
+ infoResultManager.printAccountRules(platformInfo.getAccountRules());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -103,7 +104,7 @@ public class Info {
public void connidLocations() {
try {
- infoResultManager.printConnidLocations(syncopeTO.getConnIdLocations());
+ infoResultManager.printConnidLocations(platformInfo.getConnIdLocations());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -112,7 +113,7 @@ public class Info {
public void reconciliationFilterBuilders() {
try {
- infoResultManager.printReconciliationFilterBuilders(syncopeTO.getReconciliationFilterBuilders());
+ infoResultManager.printReconciliationFilterBuilders(platformInfo.getReconciliationFilterBuilders());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -121,7 +122,7 @@ public class Info {
public void logicActions() {
try {
- infoResultManager.printLogicActions(syncopeTO.getLogicActions());
+ infoResultManager.printLogicActions(platformInfo.getLogicActions());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -130,7 +131,7 @@ public class Info {
public void mappingItemTransformers() {
try {
- infoResultManager.printMappingItemTransformers(syncopeTO.getMappingItemTransformers());
+ infoResultManager.printMappingItemTransformers(platformInfo.getMappingItemTransformers());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -139,7 +140,7 @@ public class Info {
public void passwordRules() {
try {
- infoResultManager.printPasswordRules(syncopeTO.getPasswordRules());
+ infoResultManager.printPasswordRules(platformInfo.getPasswordRules());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -148,7 +149,7 @@ public class Info {
public void propagationActions() {
try {
- infoResultManager.printPropagationActions(syncopeTO.getPropagationActions());
+ infoResultManager.printPropagationActions(platformInfo.getPropagationActions());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -157,7 +158,7 @@ public class Info {
public void pushActions() {
try {
- infoResultManager.printPushActions(syncopeTO.getPushActions());
+ infoResultManager.printPushActions(platformInfo.getPushActions());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -166,7 +167,7 @@ public class Info {
public void pushCorrelationActions() {
try {
- infoResultManager.printCorrelationActions(syncopeTO.getPushCorrelationRules());
+ infoResultManager.printCorrelationActions(platformInfo.getPushCorrelationRules());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -175,7 +176,7 @@ public class Info {
public void reportlets() {
try {
- infoResultManager.printReportlets(syncopeTO.getReportlets());
+ infoResultManager.printReportlets(platformInfo.getReportlets());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -184,7 +185,7 @@ public class Info {
public void syncActions() {
try {
- infoResultManager.printSyncActions(syncopeTO.getSyncActions());
+ infoResultManager.printSyncActions(platformInfo.getSyncActions());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -193,7 +194,7 @@ public class Info {
public void syncCorrelationRules() {
try {
- infoResultManager.printCorrelationRules(syncopeTO.getSyncCorrelationRules());
+ infoResultManager.printCorrelationRules(platformInfo.getSyncCorrelationRules());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -202,7 +203,7 @@ public class Info {
public void taskJobs() {
try {
- infoResultManager.printJobs(syncopeTO.getTaskJobs());
+ infoResultManager.printJobs(platformInfo.getTaskJobs());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -211,7 +212,7 @@ public class Info {
public void validators() {
try {
- infoResultManager.printValidators(syncopeTO.getValidators());
+ infoResultManager.printValidators(platformInfo.getValidators());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -220,7 +221,7 @@ public class Info {
public void passwordGenerators() {
try {
- infoResultManager.printPasswordGenerator(syncopeTO.getPasswordGenerator());
+ infoResultManager.printPasswordGenerator(platformInfo.getPasswordGenerator());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
@@ -229,7 +230,7 @@ public class Info {
public void virAttrCache() {
try {
- infoResultManager.printVirtualAttributeCacheClass(syncopeTO.getVirAttrCache());
+ infoResultManager.printVirtualAttributeCacheClass(platformInfo.getVirAttrCache());
} catch (final Exception ex) {
LOG.error("Information error", ex);
infoResultManager.genericError(ex.getMessage());
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/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 1af1619..3c81075 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
@@ -167,7 +167,7 @@ public class InstallSetup {
try {
final SyncopeService syncopeService = SyncopeServices.get(SyncopeService.class);
- final String syncopeVersion = syncopeService.syncope().getVersion();
+ final String syncopeVersion = syncopeService.platform().getVersion();
installResultManager.installationSuccessful(syncopeVersion);
} catch (final ProcessingException ex) {
LOG.error("Error installing CLI", ex);
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/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 a0af984..65ff376 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
@@ -67,7 +67,7 @@ public class InstallSetupForDebug {
try {
final SyncopeService syncopeService = SyncopeServices.get(SyncopeService.class);
- final String syncopeVersion = syncopeService.syncope().getVersion();
+ final String syncopeVersion = syncopeService.platform().getVersion();
installResultManager.installationSuccessful(syncopeVersion);
} catch (final ProcessingException ex) {
LOG.error("Error installing CLI", ex);
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java
index e8f541f..806d115 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java
@@ -37,7 +37,7 @@ import org.apache.syncope.client.lib.SyncopeClientFactoryBean;
import org.apache.syncope.common.lib.SyncopeConstants;
import org.apache.syncope.common.lib.EntityTOUtils;
import org.apache.syncope.common.lib.to.DomainTO;
-import org.apache.syncope.common.lib.to.SyncopeTO;
+import org.apache.syncope.common.lib.info.PlatformInfo;
import org.apache.syncope.common.lib.to.UserTO;
import org.apache.syncope.common.rest.api.service.DomainService;
import org.apache.syncope.common.rest.api.service.SyncopeService;
@@ -58,7 +58,7 @@ public class SyncopeConsoleSession extends AuthenticatedWebSession {
public static final String MENU_COLLAPSE = "MENU_COLLAPSE";
- private final SyncopeTO syncopeTO;
+ private final PlatformInfo platformInfo;
private final List<String> domains;
@@ -89,7 +89,7 @@ public class SyncopeConsoleSession extends AuthenticatedWebSession {
SyncopeConsoleApplication.get().getAnonymousUser(),
SyncopeConsoleApplication.get().getAnonymousKey());
- syncopeTO = anonymousClient.getService(SyncopeService.class).syncope();
+ platformInfo = anonymousClient.getService(SyncopeService.class).platform();
domains = new ArrayList<>();
domains.add(SyncopeConstants.MASTER_DOMAIN);
CollectionUtils.collect(anonymousClient.getService(DomainService.class).list(),
@@ -97,8 +97,8 @@ public class SyncopeConsoleSession extends AuthenticatedWebSession {
domains);
}
- public SyncopeTO getSyncopeTO() {
- return syncopeTO;
+ public PlatformInfo getPlatformInfo() {
+ return platformInfo;
}
public List<String> getDomains() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java
index 2c1f259..4336b6a 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java
@@ -236,7 +236,7 @@ public class PlainSchemaDetails extends AbstractSchemaDetailsPanel {
@Override
protected List<String> load() {
- return new ArrayList<>(SyncopeConsoleSession.get().getSyncopeTO().getValidators());
+ return new ArrayList<>(SyncopeConsoleSession.get().getPlatformInfo().getValidators());
}
};
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/console/src/main/java/org/apache/syncope/client/console/rest/PolicyRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/PolicyRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/PolicyRestClient.java
index 6abe254..11ec127 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/PolicyRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/PolicyRestClient.java
@@ -72,7 +72,7 @@ public class PolicyRestClient extends BaseRestClient {
Set<String> rules = null;
try {
- rules = SyncopeConsoleSession.get().getSyncopeTO().getSyncCorrelationRules();
+ rules = SyncopeConsoleSession.get().getPlatformInfo().getSyncCorrelationRules();
} catch (Exception e) {
LOG.error("While getting all correlation rule classes", e);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java
index 9809562..b4b880f 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/ResourceRestClient.java
@@ -38,7 +38,7 @@ public class ResourceRestClient extends BaseRestClient {
private static final long serialVersionUID = -6898907679835668987L;
public List<String> getPropagationActionsClasses() {
- return new ArrayList<>(SyncopeConsoleSession.get().getSyncopeTO().getPropagationActions());
+ return new ArrayList<>(SyncopeConsoleSession.get().getPlatformInfo().getPropagationActions());
}
public List<ResourceTO> getAll() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/console/src/main/java/org/apache/syncope/client/console/rest/RoleRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/RoleRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/RoleRestClient.java
index 1d83a9d..d7517ce 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/RoleRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/RoleRestClient.java
@@ -59,6 +59,6 @@ public class RoleRestClient extends BaseRestClient {
}
public List<String> getAllAvailableEntitlements() {
- return new ArrayList<>(getSyncopeService().syncope().getEntitlements());
+ return new ArrayList<>(getSyncopeService().platform().getEntitlements());
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/console/src/main/java/org/apache/syncope/client/console/rest/SchemaRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/SchemaRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/SchemaRestClient.java
index 2e3f037..7ca9cc7 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/SchemaRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/SchemaRestClient.java
@@ -166,7 +166,7 @@ public class SchemaRestClient extends BaseRestClient {
List<String> response = null;
try {
- response = new ArrayList<>(SyncopeConsoleSession.get().getSyncopeTO().getValidators());
+ response = new ArrayList<>(SyncopeConsoleSession.get().getPlatformInfo().getValidators());
} catch (SyncopeClientException e) {
LOG.error("While getting all validators", e);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java
index 7dc5ef4..1e158e5 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java
@@ -46,15 +46,15 @@ public class TaskRestClient extends BaseRestClient implements ExecutionRestClien
private static final long serialVersionUID = 6284485820911028843L;
public Set<String> getJobClasses() {
- return SyncopeConsoleSession.get().getSyncopeTO().getTaskJobs();
+ return SyncopeConsoleSession.get().getPlatformInfo().getTaskJobs();
}
public Set<String> getSyncActionsClasses() {
- return SyncopeConsoleSession.get().getSyncopeTO().getSyncActions();
+ return SyncopeConsoleSession.get().getPlatformInfo().getSyncActions();
}
public Set<String> getPushActionsClasses() {
- return SyncopeConsoleSession.get().getSyncopeTO().getPushActions();
+ return SyncopeConsoleSession.get().getPlatformInfo().getPushActions();
}
/**
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/console/src/main/java/org/apache/syncope/client/console/rest/UserSelfRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/UserSelfRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/UserSelfRestClient.java
index d4bc603..24cfafe 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/UserSelfRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/UserSelfRestClient.java
@@ -31,7 +31,7 @@ public class UserSelfRestClient extends BaseRestClient {
public boolean isSelfRegistrationAllowed() {
Boolean result = null;
try {
- result = SyncopeConsoleSession.get().getSyncopeTO().isSelfRegAllowed();
+ result = SyncopeConsoleSession.get().getPlatformInfo().isSelfRegAllowed();
} catch (SyncopeClientException e) {
LOG.error("While seeking if self registration is allowed", e);
}
@@ -60,7 +60,7 @@ public class UserSelfRestClient extends BaseRestClient {
public boolean isPasswordResetAllowed() {
Boolean result = null;
try {
- result = SyncopeConsoleSession.get().getSyncopeTO().isPwdResetAllowed();
+ result = SyncopeConsoleSession.get().getPlatformInfo().isPwdResetAllowed();
} catch (SyncopeClientException e) {
LOG.error("While seeking if password reset is allowed", e);
}
@@ -73,7 +73,7 @@ public class UserSelfRestClient extends BaseRestClient {
public boolean isPwdResetRequiringSecurityQuestions() {
Boolean result = null;
try {
- result = SyncopeConsoleSession.get().getSyncopeTO().isPwdResetRequiringSecurityQuestions();
+ result = SyncopeConsoleSession.get().getPlatformInfo().isPwdResetRequiringSecurityQuestions();
} catch (SyncopeClientException e) {
LOG.error("While seeking if password reset requires security question", e);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java
index b21ba41..d7f9df5 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/WorkflowRestClient.java
@@ -58,7 +58,7 @@ public class WorkflowRestClient extends BaseRestClient {
}
public boolean isActivitiEnabledForUsers() {
- return SyncopeConsoleSession.get().getSyncopeTO().getUserWorkflowAdapter().contains("Activiti");
+ return SyncopeConsoleSession.get().getPlatformInfo().getUserWorkflowAdapter().contains("Activiti");
}
public void updateDefinition(final MediaType mediaType, final String definition) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java b/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
index e576e03..01a369c 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/topology/Topology.java
@@ -128,7 +128,7 @@ public class Topology extends BasePage {
final List<URI> connectorServers = new ArrayList<>();
final List<URI> filePaths = new ArrayList<>();
- for (String location : SyncopeConsoleSession.get().getSyncopeTO().getConnIdLocations()) {
+ for (String location : SyncopeConsoleSession.get().getPlatformInfo().getConnIdLocations()) {
if (location.startsWith(CONNECTOR_SERVER_LOCATION_PREFIX)) {
connectorServers.add(URI.create(location));
} else {
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserSession.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserSession.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserSession.java
index b1cf987..dfaf844 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserSession.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserSession.java
@@ -31,7 +31,7 @@ import org.apache.cxf.jaxrs.client.WebClient;
import org.apache.syncope.client.lib.SyncopeClient;
import org.apache.syncope.client.lib.SyncopeClientFactoryBean;
import org.apache.syncope.common.lib.SyncopeConstants;
-import org.apache.syncope.common.lib.to.SyncopeTO;
+import org.apache.syncope.common.lib.info.PlatformInfo;
import org.apache.syncope.common.lib.to.UserTO;
import org.apache.syncope.common.rest.api.service.SyncopeService;
import org.apache.wicket.Session;
@@ -58,7 +58,7 @@ public class SyncopeEnduserSession extends WebSession {
private String password;
- private final SyncopeTO syncopeTO;
+ private final PlatformInfo platformInfo;
private UserTO selfTO;
@@ -80,8 +80,7 @@ public class SyncopeEnduserSession extends WebSession {
anonymousClient = SyncopeEnduserApplication.get().getClientFactory().create(
SyncopeEnduserApplication.get().getAnonymousUser(),
SyncopeEnduserApplication.get().getAnonymousKey());
- syncopeTO = anonymousClient.getService(SyncopeService.class).syncope();
-
+ platformInfo = anonymousClient.getService(SyncopeService.class).platform();
}
public boolean authenticate(final String username, final String password) {
@@ -165,8 +164,8 @@ public class SyncopeEnduserSession extends WebSession {
return password;
}
- public SyncopeTO getSyncopeTO() {
- return syncopeTO;
+ public PlatformInfo getPlatformInfo() {
+ return platformInfo;
}
public UserTO getSelfTO() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/enduser/src/main/java/org/apache/syncope/client/enduser/adapters/PlatformInfoAdapter.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/adapters/PlatformInfoAdapter.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/adapters/PlatformInfoAdapter.java
new file mode 100644
index 0000000..5ed11be
--- /dev/null
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/adapters/PlatformInfoAdapter.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.enduser.adapters;
+
+import org.apache.syncope.client.enduser.SyncopeEnduserApplication;
+import org.apache.syncope.client.enduser.model.PlatformInfoRequest;
+import org.apache.syncope.common.lib.info.PlatformInfo;
+
+public final class PlatformInfoAdapter {
+
+ public static PlatformInfoRequest toPlatformInfoRequest(final PlatformInfo platformInfo) {
+ PlatformInfoRequest request = new PlatformInfoRequest();
+ request.setPwdResetAllowed(platformInfo.isPwdResetAllowed());
+ request.setSelfRegAllowed(platformInfo.isSelfRegAllowed());
+ request.setPwdResetRequiringSecurityQuestions(platformInfo.isPwdResetRequiringSecurityQuestions());
+ request.setVersion(platformInfo.getVersion());
+ request.setCaptchaEnabled(SyncopeEnduserApplication.get().isCaptchaEnabled());
+
+ return request;
+ }
+
+ private PlatformInfoAdapter() {
+ // private constructor for static utility class
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/enduser/src/main/java/org/apache/syncope/client/enduser/adapters/SyncopeTOAdapter.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/adapters/SyncopeTOAdapter.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/adapters/SyncopeTOAdapter.java
deleted file mode 100644
index d075b27..0000000
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/adapters/SyncopeTOAdapter.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.client.enduser.adapters;
-
-import org.apache.syncope.client.enduser.SyncopeEnduserApplication;
-import org.apache.syncope.client.enduser.model.SyncopeTORequest;
-import org.apache.syncope.common.lib.to.SyncopeTO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class SyncopeTOAdapter {
-
- private static final Logger LOG = LoggerFactory.getLogger(SyncopeTOAdapter.class);
-
- public SyncopeTORequest toSyncopeTORequest(final SyncopeTO syncopeTO) {
-
- final SyncopeTORequest syncopeTORequest = new SyncopeTORequest();
- syncopeTORequest.setPwdResetAllowed(syncopeTO.isPwdResetAllowed());
- syncopeTORequest.setSelfRegAllowed(syncopeTO.isSelfRegAllowed());
- syncopeTORequest.setPwdResetRequiringSecurityQuestions(syncopeTO.isPwdResetRequiringSecurityQuestions());
- syncopeTORequest.setVersion(syncopeTO.getVersion());
- syncopeTORequest.setCaptchaEnabled(SyncopeEnduserApplication.get().isCaptchaEnabled());
-
- return syncopeTORequest;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/enduser/src/main/java/org/apache/syncope/client/enduser/model/PlatformInfoRequest.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/model/PlatformInfoRequest.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/model/PlatformInfoRequest.java
new file mode 100644
index 0000000..b95706c
--- /dev/null
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/model/PlatformInfoRequest.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.enduser.model;
+
+import java.io.Serializable;
+
+public class PlatformInfoRequest implements Serializable {
+
+ private static final long serialVersionUID = -6763020920564016374L;
+
+ private String version;
+
+ private boolean selfRegAllowed;
+
+ private boolean pwdResetAllowed;
+
+ private boolean pwdResetRequiringSecurityQuestions;
+
+ private boolean captchaEnabled;
+
+ public PlatformInfoRequest() {
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public boolean isSelfRegAllowed() {
+ return selfRegAllowed;
+ }
+
+ public boolean isPwdResetAllowed() {
+ return pwdResetAllowed;
+ }
+
+ public boolean isCaptchaEnabled() {
+ return captchaEnabled;
+ }
+
+ public boolean isPwdResetRequiringSecurityQuestions() {
+ return pwdResetRequiringSecurityQuestions;
+ }
+
+ public void setVersion(final String version) {
+ this.version = version;
+ }
+
+ public void setSelfRegAllowed(final boolean selfRegAllowed) {
+ this.selfRegAllowed = selfRegAllowed;
+ }
+
+ public void setPwdResetAllowed(final boolean pwdResetAllowed) {
+ this.pwdResetAllowed = pwdResetAllowed;
+ }
+
+ public void setPwdResetRequiringSecurityQuestions(final boolean pwdResetRequiringSecurityQuestions) {
+ this.pwdResetRequiringSecurityQuestions = pwdResetRequiringSecurityQuestions;
+ }
+
+ public void setCaptchaEnabled(final boolean captchaEnabled) {
+ this.captchaEnabled = captchaEnabled;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/enduser/src/main/java/org/apache/syncope/client/enduser/model/SyncopeTORequest.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/model/SyncopeTORequest.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/model/SyncopeTORequest.java
deleted file mode 100644
index d9ce45c..0000000
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/model/SyncopeTORequest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.client.enduser.model;
-
-import java.io.Serializable;
-
-public class SyncopeTORequest implements Serializable {
-
- private static final long serialVersionUID = -6763020920564016374L;
-
- private String version;
-
- private boolean selfRegAllowed;
-
- private boolean pwdResetAllowed;
-
- private boolean pwdResetRequiringSecurityQuestions;
-
- private boolean captchaEnabled;
-
- public SyncopeTORequest() {
- }
-
- public String getVersion() {
- return version;
- }
-
- public boolean isSelfRegAllowed() {
- return selfRegAllowed;
- }
-
- public boolean isPwdResetAllowed() {
- return pwdResetAllowed;
- }
-
- public boolean isCaptchaEnabled() {
- return captchaEnabled;
- }
-
- public boolean isPwdResetRequiringSecurityQuestions() {
- return pwdResetRequiringSecurityQuestions;
- }
-
- public void setVersion(final String version) {
- this.version = version;
- }
-
- public void setSelfRegAllowed(final boolean selfRegAllowed) {
- this.selfRegAllowed = selfRegAllowed;
- }
-
- public void setPwdResetAllowed(final boolean pwdResetAllowed) {
- this.pwdResetAllowed = pwdResetAllowed;
- }
-
- public void setPwdResetRequiringSecurityQuestions(final boolean pwdResetRequiringSecurityQuestions) {
- this.pwdResetRequiringSecurityQuestions = pwdResetRequiringSecurityQuestions;
- }
-
- public void setCaptchaEnabled(final boolean captchaEnabled) {
- this.captchaEnabled = captchaEnabled;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java
index fbde3c6..6c402db 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java
@@ -37,7 +37,7 @@ public abstract class AbstractBaseResource extends AbstractResource {
protected final boolean isSelfRegistrationAllowed() {
Boolean result = null;
try {
- result = SyncopeEnduserSession.get().getSyncopeTO().isSelfRegAllowed();
+ result = SyncopeEnduserSession.get().getPlatformInfo().isSelfRegAllowed();
} catch (SyncopeClientException e) {
LOG.error("While seeking if self registration is allowed", e);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/InfoResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/InfoResource.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/InfoResource.java
index 813dd8b..acfbac9 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/InfoResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/InfoResource.java
@@ -23,7 +23,7 @@ import javax.ws.rs.core.Response;
import org.apache.commons.lang3.StringUtils;
import org.apache.syncope.client.enduser.SyncopeEnduserConstants;
import org.apache.syncope.client.enduser.SyncopeEnduserSession;
-import org.apache.syncope.client.enduser.adapters.SyncopeTOAdapter;
+import org.apache.syncope.client.enduser.adapters.PlatformInfoAdapter;
import org.apache.syncope.client.enduser.util.SaltGenerator;
import org.apache.syncope.core.misc.serialization.POJOHelper;
import org.apache.wicket.request.resource.IResource;
@@ -37,15 +37,8 @@ public class InfoResource extends AbstractBaseResource {
private static final long serialVersionUID = 6453101466981543020L;
- private final SyncopeTOAdapter syncopeTOAdapter;
-
- public InfoResource() {
- syncopeTOAdapter = new SyncopeTOAdapter();
- }
-
@Override
protected ResourceResponse newResourceResponse(final IResource.Attributes attributes) {
-
ResourceResponse response = new ResourceResponse();
try {
@@ -63,8 +56,10 @@ public class InfoResource extends AbstractBaseResource {
@Override
public void writeData(final IResource.Attributes attributes) throws IOException {
- attributes.getResponse().write(POJOHelper.serialize(syncopeTOAdapter.toSyncopeTORequest(
- SyncopeEnduserSession.get().getSyncopeTO())));
+ attributes.getResponse().write(
+ POJOHelper.serialize(
+ PlatformInfoAdapter.toPlatformInfoRequest(
+ SyncopeEnduserSession.get().getPlatformInfo())));
}
});
response.setStatusCode(Response.Status.OK.getStatusCode());
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfPasswordReset.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfPasswordReset.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfPasswordReset.java
index d17b636..8a11ca7 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfPasswordReset.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfPasswordReset.java
@@ -70,7 +70,7 @@ public class UserSelfPasswordReset extends AbstractBaseResource {
throw new Exception("Entered captcha is not matching");
}
- if (SyncopeEnduserSession.get().getSyncopeTO().isPwdResetRequiringSecurityQuestions()) {
+ if (SyncopeEnduserSession.get().getPlatformInfo().isPwdResetRequiringSecurityQuestions()) {
if (parameters.get("securityanswer") == null || parameters.get("securityanswer").length == 0) {
throw new Exception("A correct security answer should be provided");
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/common/lib/src/main/java/org/apache/syncope/common/lib/info/NumbersInfo.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/info/NumbersInfo.java b/common/lib/src/main/java/org/apache/syncope/common/lib/info/NumbersInfo.java
new file mode 100644
index 0000000..a831e76
--- /dev/null
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/info/NumbersInfo.java
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.info;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.HashMap;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+import org.apache.syncope.common.lib.jaxb.XmlGenericMapAdapter;
+
+@XmlRootElement(name = "numbersInfo")
+@XmlType
+public class NumbersInfo extends AbstractBaseBean {
+
+ private static final long serialVersionUID = 7691187370598649583L;
+
+ private int totalUsers;
+
+ @XmlJavaTypeAdapter(XmlGenericMapAdapter.class)
+ @JsonIgnore
+ private final Map<String, Integer> usersByRealm = new HashMap<>();
+
+ @XmlJavaTypeAdapter(XmlGenericMapAdapter.class)
+ @JsonIgnore
+ private final Map<String, Integer> usersByStatus = new HashMap<>();
+
+ private int totalGroups;
+
+ @XmlJavaTypeAdapter(XmlGenericMapAdapter.class)
+ @JsonIgnore
+ private final Map<String, Integer> groupsByRealm = new HashMap<>();
+
+ private String anyType1;
+
+ private Integer totalAny1;
+
+ @XmlJavaTypeAdapter(XmlGenericMapAdapter.class)
+ @JsonIgnore
+ private final Map<String, Integer> any1ByRealm = new HashMap<>();
+
+ private String anyType2;
+
+ private Integer totalAny2;
+
+ @XmlJavaTypeAdapter(XmlGenericMapAdapter.class)
+ @JsonIgnore
+ private final Map<String, Integer> any2ByRealm = new HashMap<>();
+
+ private int totalResources;
+
+ private int totalRoles;
+
+ public int getTotalUsers() {
+ return totalUsers;
+ }
+
+ public void setTotalUsers(final int totalUsers) {
+ this.totalUsers = totalUsers;
+ }
+
+ public int getTotalGroups() {
+ return totalGroups;
+ }
+
+ public void setTotalGroups(final int totalGroups) {
+ this.totalGroups = totalGroups;
+ }
+
+ public String getAnyType1() {
+ return anyType1;
+ }
+
+ public void setAnyType1(final String anyType1) {
+ this.anyType1 = anyType1;
+ }
+
+ public Integer getTotalAny1() {
+ return totalAny1;
+ }
+
+ public void setTotalAny1(final Integer totalAny1) {
+ this.totalAny1 = totalAny1;
+ }
+
+ public String getAnyType2() {
+ return anyType2;
+ }
+
+ public void setAnyType2(final String anyType2) {
+ this.anyType2 = anyType2;
+ }
+
+ public Integer getTotalAny2() {
+ return totalAny2;
+ }
+
+ public void setTotalAny2(final Integer totalAny2) {
+ this.totalAny2 = totalAny2;
+ }
+
+ public int getTotalResources() {
+ return totalResources;
+ }
+
+ public void setTotalResources(final int totalResources) {
+ this.totalResources = totalResources;
+ }
+
+ public int getTotalRoles() {
+ return totalRoles;
+ }
+
+ public void setTotalRoles(final int totalRoles) {
+ this.totalRoles = totalRoles;
+ }
+
+ @JsonProperty
+ public Map<String, Integer> getUsersByRealm() {
+ return usersByRealm;
+ }
+
+ @JsonProperty
+ public Map<String, Integer> getUsersByStatus() {
+ return usersByStatus;
+ }
+
+ @JsonProperty
+ public Map<String, Integer> getGroupsByRealm() {
+ return groupsByRealm;
+ }
+
+ @JsonProperty
+ public Map<String, Integer> getAny1ByRealm() {
+ return any1ByRealm;
+ }
+
+ @JsonProperty
+ public Map<String, Integer> getAny2ByRealm() {
+ return any2ByRealm;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/common/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java
----------------------------------------------------------------------
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
new file mode 100644
index 0000000..790ec59
--- /dev/null
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java
@@ -0,0 +1,299 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.info;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.HashSet;
+import java.util.Set;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+
+@XmlRootElement(name = "platformInfo")
+@XmlType
+public class PlatformInfo extends AbstractBaseBean {
+
+ private static final long serialVersionUID = -7941853999417673827L;
+
+ private String version;
+
+ private boolean selfRegAllowed;
+
+ private boolean pwdResetAllowed;
+
+ private boolean pwdResetRequiringSecurityQuestions;
+
+ private final Set<String> connIdLocations = new HashSet<>();
+
+ private String anyObjectWorkflowAdapter;
+
+ private String userWorkflowAdapter;
+
+ private String groupWorkflowAdapter;
+
+ private String anyObjectProvisioningManager;
+
+ private String userProvisioningManager;
+
+ private String groupProvisioningManager;
+
+ private String virAttrCache;
+
+ private String passwordGenerator;
+
+ private final Set<String> entitlements = new HashSet<>();
+
+ private final Set<String> reportlets = new HashSet<>();
+
+ private final Set<String> accountRules = new HashSet<>();
+
+ private final Set<String> passwordRules = new HashSet<>();
+
+ private final Set<String> mappingItemTransformers = new HashSet<>();
+
+ private final Set<String> taskJobs = new HashSet<>();
+
+ private final Set<String> reconciliationFilterBuilders = new HashSet<>();
+
+ private final Set<String> logicActions = new HashSet<>();
+
+ private final Set<String> propagationActions = new HashSet<>();
+
+ private final Set<String> syncActions = new HashSet<>();
+
+ private final Set<String> pushActions = new HashSet<>();
+
+ private final Set<String> syncCorrelationRules = new HashSet<>();
+
+ private final Set<String> pushCorrelationRules = new HashSet<>();
+
+ private final Set<String> validators = new HashSet<>();
+
+ private final Set<String> notificationRecipientsProviders = new HashSet<>();
+
+ public String getVersion() {
+ return version;
+ }
+
+ public boolean isSelfRegAllowed() {
+ return selfRegAllowed;
+ }
+
+ public boolean isPwdResetAllowed() {
+ return pwdResetAllowed;
+ }
+
+ public boolean isPwdResetRequiringSecurityQuestions() {
+ return pwdResetRequiringSecurityQuestions;
+ }
+
+ @XmlElementWrapper(name = "connIdLocations")
+ @XmlElement(name = "connIdLocation")
+ @JsonProperty("connIdLocations")
+ public Set<String> getConnIdLocations() {
+ return connIdLocations;
+ }
+
+ 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;
+ }
+
+ public void setPasswordGenerator(final String passwordGenerator) {
+ this.passwordGenerator = passwordGenerator;
+ }
+
+ @XmlElementWrapper(name = "entitlements")
+ @XmlElement(name = "entitlement")
+ @JsonProperty("entitlements")
+ public Set<String> getEntitlements() {
+ return entitlements;
+ }
+
+ @XmlElementWrapper(name = "reportlets")
+ @XmlElement(name = "reportlet")
+ @JsonProperty("reportlets")
+ public Set<String> getReportlets() {
+ return reportlets;
+ }
+
+ @XmlElementWrapper(name = "accountRules")
+ @XmlElement(name = "accountRule")
+ @JsonProperty("accountRules")
+ public Set<String> getAccountRules() {
+ return accountRules;
+ }
+
+ @XmlElementWrapper(name = "passwordRules")
+ @XmlElement(name = "passwordRule")
+ @JsonProperty("passwordRules")
+ public Set<String> getPasswordRules() {
+ return passwordRules;
+ }
+
+ @XmlElementWrapper(name = "mappingItemTransformers")
+ @XmlElement(name = "mappingItemTransformer")
+ @JsonProperty("mappingItemTransformers")
+ public Set<String> getMappingItemTransformers() {
+ return mappingItemTransformers;
+ }
+
+ @XmlElementWrapper(name = "taskJobs")
+ @XmlElement(name = "taskJob")
+ @JsonProperty("taskJobs")
+ public Set<String> getTaskJobs() {
+ return taskJobs;
+ }
+
+ @XmlElementWrapper(name = "reconciliationFilterBuilders")
+ @XmlElement(name = "reconciliationFilterBuilder")
+ @JsonProperty("reconciliationFilterBuilders")
+ public Set<String> getReconciliationFilterBuilders() {
+ return reconciliationFilterBuilders;
+ }
+
+ @XmlElementWrapper(name = "logicActions")
+ @XmlElement(name = "logicAction")
+ @JsonProperty("logicActions")
+ public Set<String> getLogicActions() {
+ return logicActions;
+ }
+
+ @XmlElementWrapper(name = "propagationActions")
+ @XmlElement(name = "propagationAction")
+ @JsonProperty("propagationActions")
+ public Set<String> getPropagationActions() {
+ return propagationActions;
+ }
+
+ @XmlElementWrapper(name = "syncActions")
+ @XmlElement(name = "syncAction")
+ @JsonProperty("syncActions")
+ public Set<String> getSyncActions() {
+ return syncActions;
+ }
+
+ @XmlElementWrapper(name = "pushActions")
+ @XmlElement(name = "pushAction")
+ @JsonProperty("pushActions")
+ public Set<String> getPushActions() {
+ return pushActions;
+ }
+
+ @XmlElementWrapper(name = "syncCorrelationRules")
+ @XmlElement(name = "syncCorrelationRule")
+ @JsonProperty("syncCorrelationRules")
+ public Set<String> getSyncCorrelationRules() {
+ return syncCorrelationRules;
+ }
+
+ @XmlElementWrapper(name = "pushCorrelationRules")
+ @XmlElement(name = "pushCorrelationRule")
+ @JsonProperty("pushCorrelationRules")
+ public Set<String> getPushCorrelationRules() {
+ return pushCorrelationRules;
+ }
+
+ @XmlElementWrapper(name = "validators")
+ @XmlElement(name = "validator")
+ @JsonProperty("validators")
+ public Set<String> getValidators() {
+ return validators;
+ }
+
+ @XmlElementWrapper(name = "notificationRecipientsProviders")
+ @XmlElement(name = "notificationRecipientsProvider")
+ @JsonProperty("notificationRecipientsProviders")
+ public Set<String> getNotificationRecipientsProviders() {
+ return notificationRecipientsProviders;
+ }
+
+ public void setVersion(final String version) {
+ this.version = version;
+ }
+
+ public void setSelfRegAllowed(final boolean selfRegAllowed) {
+ this.selfRegAllowed = selfRegAllowed;
+ }
+
+ public void setPwdResetAllowed(final boolean pwdResetAllowed) {
+ this.pwdResetAllowed = pwdResetAllowed;
+ }
+
+ public void setPwdResetRequiringSecurityQuestions(final boolean pwdResetRequiringSecurityQuestions) {
+ this.pwdResetRequiringSecurityQuestions = pwdResetRequiringSecurityQuestions;
+ }
+
+ 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;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/common/lib/src/main/java/org/apache/syncope/common/lib/info/SystemInfo.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/info/SystemInfo.java b/common/lib/src/main/java/org/apache/syncope/common/lib/info/SystemInfo.java
new file mode 100644
index 0000000..eb806ed
--- /dev/null
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/info/SystemInfo.java
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.info;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.commons.collections4.queue.CircularFifoQueue;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+
+@XmlRootElement(name = "systemInfo")
+@XmlType
+public class SystemInfo extends AbstractBaseBean {
+
+ private static final long serialVersionUID = -352727968865892499L;
+
+ private String os;
+
+ private String jvm;
+
+ private int availableProcessors;
+
+ private final CircularFifoQueue<PlatformLoad> load = new CircularFifoQueue<>(10);
+
+ public String getOs() {
+ return os;
+ }
+
+ public void setOs(final String os) {
+ this.os = os;
+ }
+
+ public String getJvm() {
+ return jvm;
+ }
+
+ public void setJvm(final String jvm) {
+ this.jvm = jvm;
+ }
+
+ public int getAvailableProcessors() {
+ return availableProcessors;
+ }
+
+ public void setAvailableProcessors(final int availableProcessors) {
+ this.availableProcessors = availableProcessors;
+ }
+
+ @XmlElementWrapper(name = "load")
+ @XmlElement(name = "instant")
+ @JsonProperty("load")
+ public CircularFifoQueue<PlatformLoad> getLoad() {
+ return load;
+ }
+
+ @XmlRootElement(name = "platformLoad")
+ @XmlType
+ public static class PlatformLoad extends AbstractBaseBean {
+
+ private static final long serialVersionUID = 1700788373758716478L;
+
+ private long uptime;
+
+ private double systemLoadAverage;
+
+ private long totalMemory;
+
+ private long freeMemory;
+
+ private long maxMemory;
+
+ public double getSystemLoadAverage() {
+ return systemLoadAverage;
+ }
+
+ public void setSystemLoadAverage(final double systemLoadAverage) {
+ this.systemLoadAverage = systemLoadAverage;
+ }
+
+ public long getUptime() {
+ return uptime;
+ }
+
+ public void setUptime(final long uptime) {
+ this.uptime = uptime;
+ }
+
+ public long getTotalMemory() {
+ return totalMemory;
+ }
+
+ public void setTotalMemory(final long totalMemory) {
+ this.totalMemory = totalMemory;
+ }
+
+ public long getFreeMemory() {
+ return freeMemory;
+ }
+
+ public void setFreeMemory(final long freeMemory) {
+ this.freeMemory = freeMemory;
+ }
+
+ public long getMaxMemory() {
+ return maxMemory;
+ }
+
+ public void setMaxMemory(final long maxMemory) {
+ this.maxMemory = maxMemory;
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/common/lib/src/main/java/org/apache/syncope/common/lib/to/PlatformTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/PlatformTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/PlatformTO.java
deleted file mode 100644
index d65e7ce..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/PlatformTO.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.common.lib.to;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import org.apache.commons.collections4.queue.CircularFifoQueue;
-import org.apache.syncope.common.lib.AbstractBaseBean;
-
-@XmlRootElement(name = "platform")
-@XmlType
-public class PlatformTO extends AbstractBaseBean {
-
- private static final long serialVersionUID = -352727968865892499L;
-
- private String os;
-
- private String jvm;
-
- private int availableProcessors;
-
- private final CircularFifoQueue<PlatformLoad> load = new CircularFifoQueue<>(5);
-
- public String getOs() {
- return os;
- }
-
- public void setOs(final String os) {
- this.os = os;
- }
-
- public String getJvm() {
- return jvm;
- }
-
- public void setJvm(final String jvm) {
- this.jvm = jvm;
- }
-
- public int getAvailableProcessors() {
- return availableProcessors;
- }
-
- public void setAvailableProcessors(final int availableProcessors) {
- this.availableProcessors = availableProcessors;
- }
-
- @XmlElementWrapper(name = "load")
- @XmlElement(name = "instant")
- @JsonProperty("load")
- public CircularFifoQueue<PlatformLoad> getLoad() {
- return load;
- }
-
- @XmlRootElement(name = "platformLoad")
- @XmlType
- public static class PlatformLoad extends AbstractBaseBean {
-
- private static final long serialVersionUID = 1700788373758716478L;
-
- private long uptime;
-
- private double systemLoadAverage;
-
- private long totalMemory;
-
- private long freeMemory;
-
- private long maxMemory;
-
- public double getSystemLoadAverage() {
- return systemLoadAverage;
- }
-
- public void setSystemLoadAverage(final double systemLoadAverage) {
- this.systemLoadAverage = systemLoadAverage;
- }
-
- public long getUptime() {
- return uptime;
- }
-
- public void setUptime(final long uptime) {
- this.uptime = uptime;
- }
-
- public long getTotalMemory() {
- return totalMemory;
- }
-
- public void setTotalMemory(final long totalMemory) {
- this.totalMemory = totalMemory;
- }
-
- public long getFreeMemory() {
- return freeMemory;
- }
-
- public void setFreeMemory(final long freeMemory) {
- this.freeMemory = freeMemory;
- }
-
- public long getMaxMemory() {
- return maxMemory;
- }
-
- public void setMaxMemory(final long maxMemory) {
- this.maxMemory = maxMemory;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/common/lib/src/main/java/org/apache/syncope/common/lib/to/SyncopeTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/SyncopeTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/SyncopeTO.java
deleted file mode 100644
index a3c03b6..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/SyncopeTO.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.common.lib.to;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.util.HashSet;
-import java.util.Set;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import org.apache.syncope.common.lib.AbstractBaseBean;
-
-@XmlRootElement(name = "syncope")
-@XmlType
-public class SyncopeTO extends AbstractBaseBean {
-
- private static final long serialVersionUID = -7941853999417673827L;
-
- private String version;
-
- private boolean selfRegAllowed;
-
- private boolean pwdResetAllowed;
-
- private boolean pwdResetRequiringSecurityQuestions;
-
- private final Set<String> connIdLocations = new HashSet<>();
-
- private String anyObjectWorkflowAdapter;
-
- private String userWorkflowAdapter;
-
- private String groupWorkflowAdapter;
-
- private String anyObjectProvisioningManager;
-
- private String userProvisioningManager;
-
- private String groupProvisioningManager;
-
- private String virAttrCache;
-
- private String passwordGenerator;
-
- private final Set<String> entitlements = new HashSet<>();
-
- private final Set<String> reportlets = new HashSet<>();
-
- private final Set<String> accountRules = new HashSet<>();
-
- private final Set<String> passwordRules = new HashSet<>();
-
- private final Set<String> mappingItemTransformers = new HashSet<>();
-
- private final Set<String> taskJobs = new HashSet<>();
-
- private final Set<String> reconciliationFilterBuilders = new HashSet<>();
-
- private final Set<String> logicActions = new HashSet<>();
-
- private final Set<String> propagationActions = new HashSet<>();
-
- private final Set<String> syncActions = new HashSet<>();
-
- private final Set<String> pushActions = new HashSet<>();
-
- private final Set<String> syncCorrelationRules = new HashSet<>();
-
- private final Set<String> pushCorrelationRules = new HashSet<>();
-
- private final Set<String> validators = new HashSet<>();
-
- private final Set<String> notificationRecipientsProviders = new HashSet<>();
-
- public String getVersion() {
- return version;
- }
-
- public boolean isSelfRegAllowed() {
- return selfRegAllowed;
- }
-
- public boolean isPwdResetAllowed() {
- return pwdResetAllowed;
- }
-
- public boolean isPwdResetRequiringSecurityQuestions() {
- return pwdResetRequiringSecurityQuestions;
- }
-
- @XmlElementWrapper(name = "connIdLocations")
- @XmlElement(name = "connIdLocation")
- @JsonProperty("connIdLocations")
- public Set<String> getConnIdLocations() {
- return connIdLocations;
- }
-
- 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;
- }
-
- public void setPasswordGenerator(final String passwordGenerator) {
- this.passwordGenerator = passwordGenerator;
- }
-
- @XmlElementWrapper(name = "entitlements")
- @XmlElement(name = "entitlement")
- @JsonProperty("entitlements")
- public Set<String> getEntitlements() {
- return entitlements;
- }
-
- @XmlElementWrapper(name = "reportlets")
- @XmlElement(name = "reportlet")
- @JsonProperty("reportlets")
- public Set<String> getReportlets() {
- return reportlets;
- }
-
- @XmlElementWrapper(name = "accountRules")
- @XmlElement(name = "accountRule")
- @JsonProperty("accountRules")
- public Set<String> getAccountRules() {
- return accountRules;
- }
-
- @XmlElementWrapper(name = "passwordRules")
- @XmlElement(name = "passwordRule")
- @JsonProperty("passwordRules")
- public Set<String> getPasswordRules() {
- return passwordRules;
- }
-
- @XmlElementWrapper(name = "mappingItemTransformers")
- @XmlElement(name = "mappingItemTransformer")
- @JsonProperty("mappingItemTransformers")
- public Set<String> getMappingItemTransformers() {
- return mappingItemTransformers;
- }
-
- @XmlElementWrapper(name = "taskJobs")
- @XmlElement(name = "taskJob")
- @JsonProperty("taskJobs")
- public Set<String> getTaskJobs() {
- return taskJobs;
- }
-
- @XmlElementWrapper(name = "reconciliationFilterBuilders")
- @XmlElement(name = "reconciliationFilterBuilder")
- @JsonProperty("reconciliationFilterBuilders")
- public Set<String> getReconciliationFilterBuilders() {
- return reconciliationFilterBuilders;
- }
-
- @XmlElementWrapper(name = "logicActions")
- @XmlElement(name = "logicAction")
- @JsonProperty("logicActions")
- public Set<String> getLogicActions() {
- return logicActions;
- }
-
- @XmlElementWrapper(name = "propagationActions")
- @XmlElement(name = "propagationAction")
- @JsonProperty("propagationActions")
- public Set<String> getPropagationActions() {
- return propagationActions;
- }
-
- @XmlElementWrapper(name = "syncActions")
- @XmlElement(name = "syncAction")
- @JsonProperty("syncActions")
- public Set<String> getSyncActions() {
- return syncActions;
- }
-
- @XmlElementWrapper(name = "pushActions")
- @XmlElement(name = "pushAction")
- @JsonProperty("pushActions")
- public Set<String> getPushActions() {
- return pushActions;
- }
-
- @XmlElementWrapper(name = "syncCorrelationRules")
- @XmlElement(name = "syncCorrelationRule")
- @JsonProperty("syncCorrelationRules")
- public Set<String> getSyncCorrelationRules() {
- return syncCorrelationRules;
- }
-
- @XmlElementWrapper(name = "pushCorrelationRules")
- @XmlElement(name = "pushCorrelationRule")
- @JsonProperty("pushCorrelationRules")
- public Set<String> getPushCorrelationRules() {
- return pushCorrelationRules;
- }
-
- @XmlElementWrapper(name = "validators")
- @XmlElement(name = "validator")
- @JsonProperty("validators")
- public Set<String> getValidators() {
- return validators;
- }
-
- @XmlElementWrapper(name = "notificationRecipientsProviders")
- @XmlElement(name = "notificationRecipientsProvider")
- @JsonProperty("notificationRecipientsProviders")
- public Set<String> getNotificationRecipientsProviders() {
- return notificationRecipientsProviders;
- }
-
- public void setVersion(final String version) {
- this.version = version;
- }
-
- public void setSelfRegAllowed(final boolean selfRegAllowed) {
- this.selfRegAllowed = selfRegAllowed;
- }
-
- public void setPwdResetAllowed(final boolean pwdResetAllowed) {
- this.pwdResetAllowed = pwdResetAllowed;
- }
-
- public void setPwdResetRequiringSecurityQuestions(final boolean pwdResetRequiringSecurityQuestions) {
- this.pwdResetRequiringSecurityQuestions = pwdResetRequiringSecurityQuestions;
- }
-
- 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;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SyncopeService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SyncopeService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SyncopeService.java
index 782efae..cb2ad8b 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SyncopeService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SyncopeService.java
@@ -22,8 +22,9 @@ import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
-import org.apache.syncope.common.lib.to.PlatformTO;
-import org.apache.syncope.common.lib.to.SyncopeTO;
+import org.apache.syncope.common.lib.info.NumbersInfo;
+import org.apache.syncope.common.lib.info.SystemInfo;
+import org.apache.syncope.common.lib.info.PlatformInfo;
/**
* General info about this Apache Syncope deployment.
@@ -32,21 +33,34 @@ import org.apache.syncope.common.lib.to.SyncopeTO;
public interface SyncopeService extends JAXRSService {
/**
- * Provides information summary about this Apache Syncope deployment's configuration.
+ * Provides information summary about platform configuration (workflow adapters, provisioning managers, validators,
+ * actions, correlation rules, reportlets, ...).
*
- * @return information summary about this Apache Syncope deployment's configuration
+ * @return information summary about platform configuration (workflow adapters, provisioning managers, validators,
+ * actions, correlation rules, reportlets, ...)
*/
@GET
+ @Path("/platform")
@Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- SyncopeTO syncope();
+ PlatformInfo platform();
/**
- * Provides information about the underlying platform (Operating System, CPU / memory usage, ...).
+ * Provides information about the underlying system (Operating System, CPU / memory usage, ...).
*
- * @return information about the underlying platform (Operating System, CPU / memory usage, ...)
+ * @return information about the underlying system (Operating System, CPU / memory usage, ...)
*/
@GET
- @Path("/platform")
+ @Path("/system")
+ @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ SystemInfo system();
+
+ /** *
+ * Provides some numbers about the managed entities (users, groups, any objects...).
+ *
+ * @return some numbers about the managed entities (users, groups, any objects...)
+ */
+ @GET
+ @Path("/numbers")
@Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- PlatformTO platform();
+ NumbersInfo numbers();
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/de0a37d7/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractLogic.java
index 6602ca0..1706c99 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractLogic.java
@@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.transaction.annotation.Transactional;
/**
- * Superclass for all controllers.
+ * Superclass for all business logic modules.
*
* @param <T> transfer object used for input / output
*/