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 2012/07/09 18:08:41 UTC
svn commit: r1359245 - in
/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core:
propagation/ConnectorFacadeProxy.java propagation/PropagationManager.java
util/SchemaMappingUtil.java
Author: ilgrosso
Date: Mon Jul 9 16:08:41 2012
New Revision: 1359245
URL: http://svn.apache.org/viewvc?rev=1359245&view=rev
Log:
Small enhancements and fixes
Modified:
incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFacadeProxy.java
incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/PropagationManager.java
incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/util/SchemaMappingUtil.java
Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFacadeProxy.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFacadeProxy.java?rev=1359245&r1=1359244&r2=1359245&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFacadeProxy.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/ConnectorFacadeProxy.java Mon Jul 9 16:08:41 2012
@@ -25,6 +25,16 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javassist.NotFoundException;
+import org.apache.syncope.core.persistence.beans.ConnInstance;
+import org.apache.syncope.core.persistence.beans.ExternalResource;
+import org.apache.syncope.core.persistence.beans.SchemaMapping;
+import org.apache.syncope.core.persistence.dao.MissingConfKeyException;
+import org.apache.syncope.core.util.ConnBundleManager;
+import org.apache.syncope.core.util.SchemaMappingUtil;
+import org.apache.syncope.types.ConnConfProperty;
+import org.apache.syncope.types.ConnectorCapability;
+import org.apache.syncope.types.PropagationMode;
+import org.apache.syncope.types.PropagationOperation;
import org.identityconnectors.common.security.GuardedByteArray;
import org.identityconnectors.common.security.GuardedString;
import org.identityconnectors.framework.api.APIConfiguration;
@@ -53,16 +63,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.ClassUtils;
import org.springframework.util.StringUtils;
-import org.apache.syncope.core.persistence.beans.ConnInstance;
-import org.apache.syncope.core.persistence.beans.ExternalResource;
-import org.apache.syncope.core.persistence.beans.SchemaMapping;
-import org.apache.syncope.core.persistence.dao.MissingConfKeyException;
-import org.apache.syncope.core.util.ConnBundleManager;
-import org.apache.syncope.core.util.SchemaMappingUtil;
-import org.apache.syncope.types.ConnConfProperty;
-import org.apache.syncope.types.ConnectorCapability;
-import org.apache.syncope.types.PropagationMode;
-import org.apache.syncope.types.PropagationOperation;
/**
* Intercept calls to ConnectorFacade's methods and check if the corresponding connector instance has been configured to
Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/PropagationManager.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/PropagationManager.java?rev=1359245&r1=1359244&r2=1359245&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/PropagationManager.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/propagation/PropagationManager.java Mon Jul 9 16:08:41 2012
@@ -30,21 +30,6 @@ import java.util.Map.Entry;
import java.util.Set;
import javassist.NotFoundException;
import org.apache.commons.collections.keyvalue.DefaultMapEntry;
-import org.identityconnectors.framework.common.FrameworkUtil;
-import org.identityconnectors.framework.common.exceptions.ConnectorException;
-import org.identityconnectors.framework.common.objects.Attribute;
-import org.identityconnectors.framework.common.objects.AttributeBuilder;
-import org.identityconnectors.framework.common.objects.AttributeUtil;
-import org.identityconnectors.framework.common.objects.ConnectorObject;
-import org.identityconnectors.framework.common.objects.Name;
-import org.identityconnectors.framework.common.objects.ObjectClass;
-import org.identityconnectors.framework.common.objects.Uid;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.NoSuchBeanDefinitionException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.StringUtils;
import org.apache.syncope.client.mod.AttributeMod;
import org.apache.syncope.client.to.AttributeTO;
import org.apache.syncope.core.init.ConnInstanceLoader;
@@ -61,7 +46,6 @@ import org.apache.syncope.core.persisten
import org.apache.syncope.core.persistence.dao.ResourceDAO;
import org.apache.syncope.core.persistence.dao.SchemaDAO;
import org.apache.syncope.core.persistence.dao.TaskDAO;
-import org.apache.syncope.core.persistence.dao.TaskExecDAO;
import org.apache.syncope.core.persistence.dao.UserDAO;
import org.apache.syncope.core.rest.data.UserDataBinder;
import org.apache.syncope.core.util.AttributableUtil;
@@ -75,6 +59,21 @@ import org.apache.syncope.types.Propagat
import org.apache.syncope.types.PropagationTaskExecStatus;
import org.apache.syncope.types.SchemaType;
import org.apache.syncope.types.TraceLevel;
+import org.identityconnectors.framework.common.FrameworkUtil;
+import org.identityconnectors.framework.common.exceptions.ConnectorException;
+import org.identityconnectors.framework.common.objects.Attribute;
+import org.identityconnectors.framework.common.objects.AttributeBuilder;
+import org.identityconnectors.framework.common.objects.AttributeUtil;
+import org.identityconnectors.framework.common.objects.ConnectorObject;
+import org.identityconnectors.framework.common.objects.Name;
+import org.identityconnectors.framework.common.objects.ObjectClass;
+import org.identityconnectors.framework.common.objects.Uid;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.NoSuchBeanDefinitionException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
/**
* Manage the data propagation to external resources.
@@ -124,12 +123,6 @@ public class PropagationManager {
private TaskDAO taskDAO;
/**
- * Task execution DAO.
- */
- @Autowired
- private TaskExecDAO taskExecDAO;
-
- /**
* JEXL engine for evaluating connector's account link.
*/
@Autowired
@@ -793,7 +786,7 @@ public class PropagationManager {
// Flush call is needed to value the id field of execution (used by deal test of TaskTestITCase).
taskDAO.flush();
-
+
// An alternative to the flush call could be the following statement but we should accept the risk to
// have a not so probable trouble coming from concurrent calls.
//final TaskExec latestExec = taskExecDAO.findLatestStarted(taskDAO.save(task));
Modified: incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/util/SchemaMappingUtil.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/util/SchemaMappingUtil.java?rev=1359245&r1=1359244&r2=1359245&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/util/SchemaMappingUtil.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/apache/syncope/core/util/SchemaMappingUtil.java Mon Jul 9 16:08:41 2012
@@ -27,10 +27,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.collections.keyvalue.DefaultMapEntry;
-import org.identityconnectors.framework.common.objects.OperationalAttributes;
-import org.identityconnectors.framework.common.objects.Uid;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.syncope.core.persistence.beans.AbstractAttr;
import org.apache.syncope.core.persistence.beans.AbstractAttrValue;
import org.apache.syncope.core.persistence.beans.AbstractAttributable;
@@ -45,13 +41,16 @@ import org.apache.syncope.core.persisten
import org.apache.syncope.core.persistence.beans.role.RSchema;
import org.apache.syncope.core.persistence.beans.role.RVirSchema;
import org.apache.syncope.core.persistence.beans.user.SyncopeUser;
-import org.apache.syncope.core.persistence.beans.user.UAttr;
import org.apache.syncope.core.persistence.beans.user.UAttrValue;
import org.apache.syncope.core.persistence.beans.user.UDerSchema;
import org.apache.syncope.core.persistence.beans.user.USchema;
import org.apache.syncope.core.persistence.beans.user.UVirSchema;
import org.apache.syncope.core.persistence.dao.SchemaDAO;
import org.apache.syncope.types.IntMappingType;
+import org.identityconnectors.framework.common.objects.OperationalAttributes;
+import org.identityconnectors.framework.common.objects.Uid;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class SchemaMappingUtil {
@@ -253,7 +252,8 @@ public class SchemaMappingUtil {
switch (mapping.getIntMappingType()) {
case Username:
if (!(attributable instanceof SyncopeUser)) {
- throw new ClassCastException("mappingtype is Username, but attributable is not SyncopeUser: " + attributable.getClass().getName());
+ throw new ClassCastException("mappingtype is Username, but attributable is not SyncopeUser: "
+ + attributable.getClass().getName());
}
value.add(((SyncopeUser) attributable).getUsername());
break;
@@ -350,8 +350,7 @@ public class SchemaMappingUtil {
* @param mappings collection of SchemaMapping.
* @return AccountId mapping or null if no occurences found.
*/
- public static final SchemaMapping getAccountIdMapping(final Collection<SchemaMapping> mappings) {
-
+ public static SchemaMapping getAccountIdMapping(final Collection<SchemaMapping> mappings) {
for (SchemaMapping mapping : mappings) {
if (mapping.isAccountid()) {
return mapping;
@@ -368,8 +367,9 @@ public class SchemaMappingUtil {
* @param mappings collection of SchemaMapping.
* @return accountId internal value.
*/
- public static final String getAccountIdValue(final AbstractAttributable attributable,
+ public static String getAccountIdValue(final AbstractAttributable attributable,
final Collection<SchemaMapping> mappings) {
+
final List<String> values = getIntValueAsStrings(attributable, getAccountIdMapping(mappings));
return values == null || values.isEmpty()
? null
@@ -383,7 +383,7 @@ public class SchemaMappingUtil {
* @param mappings accountId mapping.
* @return accountId internal value.
*/
- public static final String getAccountIdValue(final AbstractAttributable attributable, final SchemaMapping mapping) {
+ public static String getAccountIdValue(final AbstractAttributable attributable, final SchemaMapping mapping) {
final List<String> values = getIntValueAsStrings(attributable, mapping);
return values == null || values.isEmpty()
? null