Return-Path: X-Original-To: apmail-syncope-commits-archive@www.apache.org Delivered-To: apmail-syncope-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 10B58FAA4 for ; Fri, 22 Mar 2013 17:06:06 +0000 (UTC) Received: (qmail 50162 invoked by uid 500); 22 Mar 2013 17:06:06 -0000 Delivered-To: apmail-syncope-commits-archive@syncope.apache.org Received: (qmail 50133 invoked by uid 500); 22 Mar 2013 17:06:06 -0000 Mailing-List: contact commits-help@syncope.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@syncope.apache.org Delivered-To: mailing list commits@syncope.apache.org Received: (qmail 50125 invoked by uid 99); 22 Mar 2013 17:06:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Mar 2013 17:06:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Mar 2013 17:06:03 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 29C2823888E7; Fri, 22 Mar 2013 17:05:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1459902 - in /syncope/trunk: client/src/main/java/org/apache/syncope/client/services/proxy/ common/src/main/java/org/apache/syncope/common/services/ common/src/main/java/org/apache/syncope/common/util/ console/src/main/java/org/apache/sync... Date: Fri, 22 Mar 2013 17:05:42 -0000 To: commits@syncope.apache.org From: ilgrosso@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130322170543.29C2823888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ilgrosso Date: Fri Mar 22 17:05:41 2013 New Revision: 1459902 URL: http://svn.apache.org/r1459902 Log: [SYNCOPE-343] Introduced a dedicated handler for (possibly empty) string collections Added: syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/SyncCorrelationRule.java - copied, changed from r1459775, syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/SyncRule.java Removed: syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/SyncRule.java Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConfigurationServiceProxy.java syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/PolicyServiceProxy.java syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ReportServiceProxy.java syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ResourceServiceProxy.java syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SchemaServiceProxy.java syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SpringServiceProxy.java syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/TaskServiceProxy.java syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java syncope/trunk/common/src/main/java/org/apache/syncope/common/util/CollectionWrapper.java syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/AuthRestClient.java syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ImplementationClassNamesLoader.java syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/PolicyController.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConfigurationServiceImpl.java syncope/trunk/core/src/main/java/org/apache/syncope/core/services/PolicyServiceImpl.java syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java syncope/trunk/core/src/main/java/org/apache/syncope/core/util/AttributableUtil.java syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/PolicyTestITCase.java syncope/trunk/core/src/test/java/org/apache/syncope/core/sync/TestSyncRule.java Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConfigurationServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConfigurationServiceProxy.java?rev=1459902&r1=1459901&r2=1459902&view=diff ============================================================================== --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConfigurationServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ConfigurationServiceProxy.java Fri Mar 22 17:05:41 2013 @@ -22,7 +22,6 @@ import java.io.UnsupportedEncodingExcept import java.net.URI; import java.net.URLEncoder; import java.util.Arrays; -import java.util.HashSet; import java.util.List; import java.util.Set; import javax.ws.rs.InternalServerErrorException; @@ -81,16 +80,14 @@ public class ConfigurationServiceProxy e @Override public Set getValidators() { - Set response = new HashSet(Arrays.asList(getRestTemplate().getForObject( - baseUrl + "configuration/validators.json", String[].class))); - return CollectionWrapper.wrapValidator(response); + return CollectionWrapper.wrapValidators( + handlePossiblyEmptyStringCollection(baseUrl + "configuration/validators.json")); } @Override public Set getMailTemplates() { - Set response = new HashSet(Arrays.asList(getRestTemplate().getForObject( - baseUrl + "configuration/mailTemplates.json", String[].class))); - return CollectionWrapper.wrapMailTemplates(response); + return CollectionWrapper.wrapMailTemplates( + handlePossiblyEmptyStringCollection(baseUrl + "configuration/mailTemplates.json")); } @Override Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/PolicyServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/PolicyServiceProxy.java?rev=1459902&r1=1459901&r2=1459902&view=diff ============================================================================== --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/PolicyServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/PolicyServiceProxy.java Fri Mar 22 17:05:41 2013 @@ -20,7 +20,7 @@ package org.apache.syncope.client.servic import java.net.URI; import java.util.Arrays; -import java.util.HashSet; +import java.util.Collections; import java.util.List; import java.util.Set; import javax.ws.rs.NotFoundException; @@ -137,16 +137,15 @@ public class PolicyServiceProxy extends } @Override - public Set getCorrelationRuleClasses(final PolicyType type) { - Set result = null; + @SuppressWarnings({"unchecked", "rawtypes"}) + public Set getSyncCorrelationRuleClasses(final PolicyType type) { + Set result = Collections.emptySet(); switch (type) { case SYNC: case GLOBAL_SYNC: - final Set classes = new HashSet(Arrays.asList(getRestTemplate().getForObject( - baseUrl + "policy/correlationRuleClasses.json", String[].class))); - - result = CollectionWrapper.wrapCorrelationRuleClasses(classes); + result = CollectionWrapper.wrapSyncCorrelationRuleClasses( + handlePossiblyEmptyStringCollection(baseUrl + "policy/syncCorrelationRuleClasses.json")); break; default: Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ReportServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ReportServiceProxy.java?rev=1459902&r1=1459901&r2=1459902&view=diff ============================================================================== --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ReportServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ReportServiceProxy.java Fri Mar 22 17:05:41 2013 @@ -66,9 +66,8 @@ public class ReportServiceProxy extends @Override public ReportletConfClasses getReportletConfClasses() { - List confClasses = Arrays.asList(getRestTemplate().getForObject( - baseUrl + "report/reportletConfClasses.json", String[].class)); - return new ReportletConfClasses(confClasses); + return new ReportletConfClasses( + handlePossiblyEmptyStringCollection(baseUrl + "report/reportletConfClasses.json")); } @Override Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ResourceServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ResourceServiceProxy.java?rev=1459902&r1=1459901&r2=1459902&view=diff ============================================================================== --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ResourceServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/ResourceServiceProxy.java Fri Mar 22 17:05:41 2013 @@ -22,7 +22,6 @@ import java.io.UnsupportedEncodingExcept import java.net.URI; import java.net.URLEncoder; import java.util.Arrays; -import java.util.HashSet; import java.util.List; import java.util.Set; @@ -82,10 +81,8 @@ public class ResourceServiceProxy extend @Override public Set getPropagationActionsClasses() { - Set classes = new HashSet(Arrays.asList(getRestTemplate().getForObject( - baseUrl + "resource/propagationActionsClasses.json", String[].class))); - - return CollectionWrapper.wrapPropagationActionClasses(classes); + return CollectionWrapper.wrapPropagationActionClasses( + handlePossiblyEmptyStringCollection(baseUrl + "resource/propagationActionsClasses.json")); } @Override Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SchemaServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SchemaServiceProxy.java?rev=1459902&r1=1459901&r2=1459902&view=diff ============================================================================== --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SchemaServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SchemaServiceProxy.java Fri Mar 22 17:05:41 2013 @@ -65,7 +65,6 @@ public class SchemaServiceProxy extends @Override public void delete(final AttributableType kind, final SchemaType type, final String schemaName) { - getRestTemplate().getForObject(baseUrl + type.toSpringURL() + "/{kind}/delete/{name}.json", getTOClass(type), kind, schemaName); } Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SpringServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SpringServiceProxy.java?rev=1459902&r1=1459901&r2=1459902&view=diff ============================================================================== --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SpringServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/SpringServiceProxy.java Fri Mar 22 17:05:41 2013 @@ -19,6 +19,8 @@ package org.apache.syncope.client.services.proxy; import java.io.IOException; +import java.util.Collection; +import java.util.Collections; import javax.ws.rs.InternalServerErrorException; import javax.ws.rs.core.Response; import org.apache.http.HttpEntity; @@ -87,4 +89,19 @@ public abstract class SpringServiceProxy throw new InternalServerErrorException(e); } } + + @SuppressWarnings("unchecked") + protected Collection handlePossiblyEmptyStringCollection(final String url) { + Collection result = Collections.emptySet(); + + final Object object = getRestTemplate().getForObject(url, Object.class); + if (object instanceof String) { + String string = (String) object; + result = Collections.singleton(string); + } else if (object instanceof Collection) { + result = (Collection) object; + } + + return result; + } } Modified: syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/TaskServiceProxy.java URL: http://svn.apache.org/viewvc/syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/TaskServiceProxy.java?rev=1459902&r1=1459901&r2=1459902&view=diff ============================================================================== --- syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/TaskServiceProxy.java (original) +++ syncope/trunk/client/src/main/java/org/apache/syncope/client/services/proxy/TaskServiceProxy.java Fri Mar 22 17:05:41 2013 @@ -21,7 +21,6 @@ package org.apache.syncope.client.servic import java.io.IOException; import java.net.URI; import java.util.Arrays; -import java.util.HashSet; import java.util.List; import java.util.Set; import javax.ws.rs.core.Response; @@ -106,18 +105,14 @@ public class TaskServiceProxy extends Sp @Override public Set getJobClasses() { - Set classes = new HashSet(Arrays.asList(getRestTemplate().getForObject( - baseUrl + "task/jobClasses.json", String[].class))); - - return CollectionWrapper.wrapJobClasses(classes); + return CollectionWrapper.wrapJobClasses( + handlePossiblyEmptyStringCollection(baseUrl + "task/jobClasses.json")); } @Override public Set getSyncActionsClasses() { - Set classes = new HashSet(Arrays.asList(getRestTemplate().getForObject( - baseUrl + "task/syncActionsClasses.json", String[].class))); - - return CollectionWrapper.wrapSyncActionClasses(classes); + return CollectionWrapper.wrapSyncActionClasses( + handlePossiblyEmptyStringCollection(baseUrl + "task/syncActionsClasses.json")); } @Override Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java?rev=1459902&r1=1459901&r2=1459902&view=diff ============================================================================== --- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java Fri Mar 22 17:05:41 2013 @@ -101,6 +101,6 @@ public interface PolicyService { * @return Returns correlation rules java classes. */ @GET - @Path("correlationRuleClasses") - Set getCorrelationRuleClasses(@PathParam("type") PolicyType type); + @Path("syncCorrelationRuleClasses") + Set getSyncCorrelationRuleClasses(@PathParam("type") PolicyType type); } Modified: syncope/trunk/common/src/main/java/org/apache/syncope/common/util/CollectionWrapper.java URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/util/CollectionWrapper.java?rev=1459902&r1=1459901&r2=1459902&view=diff ============================================================================== --- syncope/trunk/common/src/main/java/org/apache/syncope/common/util/CollectionWrapper.java (original) +++ syncope/trunk/common/src/main/java/org/apache/syncope/common/util/CollectionWrapper.java Fri Mar 22 17:05:41 2013 @@ -19,11 +19,11 @@ package org.apache.syncope.common.util; import java.util.ArrayList; +import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; import org.apache.syncope.common.to.CorrelationRuleClassTO; - import org.apache.syncope.common.to.EntitlementTO; import org.apache.syncope.common.to.JobClassTO; import org.apache.syncope.common.to.LoggerTO; @@ -38,25 +38,23 @@ import org.springframework.web.servlet.M public final class CollectionWrapper { private CollectionWrapper() { + // empty constructor for static utility class } - public static Set wrap(final Set collection) { - Set respons = new HashSet(); - for (String e : collection) { - respons.add(EntitlementTO.instance(e)); - } - return respons; + @SuppressWarnings("unchecked") + public static List wrapStrings(final ModelAndView modelAndView) { + return (List) modelAndView.getModel().values().iterator().next(); } - public static List wrap(final List collection) { - List respons = new ArrayList(); + public static Set wrap(final Collection collection) { + Set respons = new HashSet(); for (String e : collection) { respons.add(EntitlementTO.instance(e)); } return respons; } - public static Set unwrap(final Set collection) { + public static Set unwrap(final Collection collection) { Set respons = new HashSet(); for (EntitlementTO e : collection) { respons.add(e.getName()); @@ -64,21 +62,7 @@ public final class CollectionWrapper { return respons; } - public static List unwrap(final List collection) { - List respons = new ArrayList(); - for (EntitlementTO e : collection) { - respons.add(e.getName()); - } - return respons; - } - - public static Set wrapMailTemplates(final ModelAndView mailTemplates) { - @SuppressWarnings("unchecked") - Set collection = (Set) mailTemplates.getModel().values().iterator().next(); - return wrapMailTemplates(collection); - } - - public static Set wrapMailTemplates(final Set collection) { + public static Set wrapMailTemplates(final Collection collection) { Set respons = new HashSet(); for (String e : collection) { respons.add(MailTemplateTO.instance(e)); @@ -86,37 +70,43 @@ public final class CollectionWrapper { return respons; } - public static Set wrapValidator(final ModelAndView validators) { - @SuppressWarnings("unchecked") - Set collection = (Set) validators.getModel().values().iterator().next(); - return wrapValidator(collection); - } - - public static List unwrapValidator(final List collection) { + public static List unwrapMailTemplates(final Collection collection) { List respons = new ArrayList(); - for (ValidatorTO e : collection) { + for (MailTemplateTO e : collection) { respons.add(e.getName()); } return respons; } - public static List unwrapMailTemplates(final List collection) { + public static Set wrapValidators(final Collection validators) { + Set respons = new HashSet(); + for (String validator : validators) { + respons.add(ValidatorTO.instance(validator)); + } + return respons; + } + + public static List unwrapValidator(final Collection collection) { List respons = new ArrayList(); - for (MailTemplateTO e : collection) { + for (ValidatorTO e : collection) { respons.add(e.getName()); } return respons; } - public static Set wrapValidator(final Set collection) { - Set respons = new HashSet(); - for (String e : collection) { - respons.add(ValidatorTO.instance(e)); + public static List wrapLogger(final Collection logger) { + List respons = new ArrayList(); + for (LoggerTO l : logger) { + try { + respons.add(AuditLoggerName.fromLoggerName(l.getName())); + } catch (Exception e) { + //TODO log event + } } return respons; } - public static List unwrapLogger(List auditNames) { + public static List unwrapLogger(final Collection auditNames) { List respons = new ArrayList(); for (AuditLoggerName l : auditNames) { LoggerTO loggerTO = new LoggerTO(); @@ -127,7 +117,7 @@ public final class CollectionWrapper { return respons; } - public static Set wrapJobClasses(Set classes) { + public static Set wrapJobClasses(final Collection classes) { Set respons = new HashSet(); for (String cl : classes) { respons.add(JobClassTO.instance(cl)); @@ -135,35 +125,23 @@ public final class CollectionWrapper { return respons; } - public static Set wrapSyncActionClasses(Set classes) { - Set respons = new HashSet(); - for (String cl : classes) { - respons.add(SyncActionClassTO.instance(cl)); - } - return respons; - } - - public static List wrapLogger(List logger) { - List respons = new ArrayList(); - for (LoggerTO l : logger) { - try { - respons.add(AuditLoggerName.fromLoggerName(l.getName())); - } catch (Exception e) { - //TODO log event - } + public static List unwrapJobClasses(final Collection jobClasses) { + List respons = new ArrayList(); + for (JobClassTO e : jobClasses) { + respons.add(e.getName()); } return respons; } - public static List unwrapJobClasses(List jobClasses) { - List respons = new ArrayList(); - for (JobClassTO e : jobClasses) { - respons.add(e.getName()); + public static Set wrapSyncActionClasses(final Collection classes) { + Set respons = new HashSet(); + for (String cl : classes) { + respons.add(SyncActionClassTO.instance(cl)); } return respons; } - public static List unwrapSyncActionClasses(List actions) { + public static List unwrapSyncActionClasses(final Collection actions) { List respons = new ArrayList(); for (SyncActionClassTO e : actions) { respons.add(e.getName()); @@ -171,7 +149,7 @@ public final class CollectionWrapper { return respons; } - public static Set wrapPropagationActionClasses(Set classes) { + public static Set wrapPropagationActionClasses(final Collection classes) { Set respons = new HashSet(); for (String cl : classes) { respons.add(PropagationActionClassTO.instance(cl)); @@ -179,7 +157,7 @@ public final class CollectionWrapper { return respons; } - public static List unwrapPropagationActionClasses(Set actions) { + public static List unwrapPropagationActionClasses(final Collection actions) { List respons = new ArrayList(); for (PropagationActionClassTO e : actions) { respons.add(e.getName()); @@ -187,7 +165,7 @@ public final class CollectionWrapper { return respons; } - public static Set wrapCorrelationRuleClasses(Set classes) { + public static Set wrapSyncCorrelationRuleClasses(final Collection classes) { Set respons = new HashSet(); for (String cl : classes) { respons.add(CorrelationRuleClassTO.instance(cl)); @@ -195,16 +173,11 @@ public final class CollectionWrapper { return respons; } - public static List unwrapCorrelationRuleClasses(Set actions) { + public static List unwrapSyncCorrelationRuleClasses(final Collection actions) { List respons = new ArrayList(); for (CorrelationRuleClassTO e : actions) { respons.add(e.getName()); } return respons; } - - @SuppressWarnings("unchecked") - public static List wrapStrings(final ModelAndView modelAndView) { - return (List) modelAndView.getModel().values().iterator().next(); - } } Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/AuthRestClient.java URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/AuthRestClient.java?rev=1459902&r1=1459901&r2=1459902&view=diff ============================================================================== --- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/AuthRestClient.java (original) +++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/AuthRestClient.java Fri Mar 22 17:05:41 2013 @@ -22,7 +22,6 @@ import java.util.ArrayList; import java.util.List; import org.apache.syncope.common.services.EntitlementService; -import org.apache.syncope.common.to.EntitlementTO; import org.apache.syncope.common.util.CollectionWrapper; import org.springframework.stereotype.Component; @@ -40,9 +39,8 @@ public class AuthRestClient extends Base * @return List */ public List getAllEntitlements() { - List entitlemens = new ArrayList(getService(EntitlementService.class) - .getAllEntitlements()); - return CollectionWrapper.unwrap(entitlemens); + return new ArrayList( + CollectionWrapper.unwrap(getService(EntitlementService.class).getAllEntitlements())); } /** @@ -51,8 +49,7 @@ public class AuthRestClient extends Base * @return List */ public List getOwnedEntitlements() { - List entitlemens = new ArrayList(getService(EntitlementService.class) - .getMyEntitlements()); - return CollectionWrapper.unwrap(entitlemens); + return new ArrayList( + CollectionWrapper.unwrap(getService(EntitlementService.class).getMyEntitlements())); } } Modified: syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java URL: http://svn.apache.org/viewvc/syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java?rev=1459902&r1=1459901&r2=1459902&view=diff ============================================================================== --- syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java (original) +++ syncope/trunk/console/src/main/java/org/apache/syncope/console/rest/PolicyRestClient.java Fri Mar 22 17:05:41 2013 @@ -89,8 +89,8 @@ public class PolicyRestClient extends Ba List rules = null; try { - rules = CollectionWrapper.unwrapCorrelationRuleClasses( - getService(PolicyService.class).getCorrelationRuleClasses(PolicyType.SYNC)); + rules = CollectionWrapper.unwrapSyncCorrelationRuleClasses( + getService(PolicyService.class).getSyncCorrelationRuleClasses(PolicyType.SYNC)); } catch (Exception e) { LOG.error("While getting all correlation rule classes", e); } Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ImplementationClassNamesLoader.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ImplementationClassNamesLoader.java?rev=1459902&r1=1459901&r2=1459902&view=diff ============================================================================== --- syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ImplementationClassNamesLoader.java (original) +++ syncope/trunk/core/src/main/java/org/apache/syncope/core/init/ImplementationClassNamesLoader.java Fri Mar 22 17:05:41 2013 @@ -31,7 +31,7 @@ import org.apache.syncope.core.propagati import org.apache.syncope.core.report.ReportJob; import org.apache.syncope.core.report.Reportlet; import org.apache.syncope.core.sync.SyncActions; -import org.apache.syncope.core.sync.SyncRule; +import org.apache.syncope.core.sync.SyncCorrelationRule; import org.apache.syncope.core.sync.impl.SyncJob; import org.quartz.Job; import org.slf4j.Logger; @@ -103,7 +103,7 @@ public class ImplementationClassNamesLoa classNames.get(Type.SYNC_ACTIONS).add(metadata.getClassName()); } - if (interfaces.contains(SyncRule.class) && !metadata.isAbstract()) { + if (interfaces.contains(SyncCorrelationRule.class) && !metadata.isAbstract()) { classNames.get(Type.SYNC_CORRELATION_RULES).add(metadata.getClassName()); } Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/PolicyController.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/PolicyController.java?rev=1459902&r1=1459901&r2=1459902&view=diff ============================================================================== --- syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/PolicyController.java (original) +++ syncope/trunk/core/src/main/java/org/apache/syncope/core/rest/controller/PolicyController.java Fri Mar 22 17:05:41 2013 @@ -237,8 +237,8 @@ public class PolicyController extends Ab } @PreAuthorize("hasRole('POLICY_LIST')") - @RequestMapping(method = RequestMethod.GET, value = "/correlationRuleClasses") - public ModelAndView getCorrelationRuleClasses() { + @RequestMapping(method = RequestMethod.GET, value = "/syncCorrelationRuleClasses") + public ModelAndView getSyncCorrelationRuleClasses() { final Set correlationRules = classNamesLoader.getClassNames(ImplementationClassNamesLoader.Type.SYNC_CORRELATION_RULES); Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConfigurationServiceImpl.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConfigurationServiceImpl.java?rev=1459902&r1=1459901&r2=1459902&view=diff ============================================================================== --- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConfigurationServiceImpl.java (original) +++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/ConfigurationServiceImpl.java Fri Mar 22 17:05:41 2013 @@ -79,13 +79,17 @@ public class ConfigurationServiceImpl im } @Override + @SuppressWarnings("unchecked") public Set getMailTemplates() { - return CollectionWrapper.wrapMailTemplates(configurationController.getMailTemplates()); + return CollectionWrapper.wrapMailTemplates( + (Set) configurationController.getMailTemplates().getModel().values().iterator().next()); } @Override + @SuppressWarnings("unchecked") public Set getValidators() { - return CollectionWrapper.wrapValidator(configurationController.getValidators()); + return CollectionWrapper.wrapValidators( + (Set) configurationController.getValidators().getModel().values().iterator().next()); } @Override Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/services/PolicyServiceImpl.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/services/PolicyServiceImpl.java?rev=1459902&r1=1459901&r2=1459902&view=diff ============================================================================== --- syncope/trunk/core/src/main/java/org/apache/syncope/core/services/PolicyServiceImpl.java (original) +++ syncope/trunk/core/src/main/java/org/apache/syncope/core/services/PolicyServiceImpl.java Fri Mar 22 17:05:41 2013 @@ -125,7 +125,7 @@ public class PolicyServiceImpl implement } @Override - public Set getCorrelationRuleClasses(final PolicyType type) { + public Set getSyncCorrelationRuleClasses(final PolicyType type) { Set result = null; switch (type) { @@ -133,9 +133,9 @@ public class PolicyServiceImpl implement case GLOBAL_SYNC: @SuppressWarnings("unchecked") - final Set classes = (Set) policyController.getCorrelationRuleClasses().getModel(). + final Set classes = (Set) policyController.getSyncCorrelationRuleClasses().getModel(). values().iterator().next(); - result = CollectionWrapper.wrapCorrelationRuleClasses(classes); + result = CollectionWrapper.wrapSyncCorrelationRuleClasses(classes); break; default: @@ -144,4 +144,4 @@ public class PolicyServiceImpl implement return result; } -} \ No newline at end of file +} Copied: syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/SyncCorrelationRule.java (from r1459775, syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/SyncRule.java) URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/SyncCorrelationRule.java?p2=syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/SyncCorrelationRule.java&p1=syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/SyncRule.java&r1=1459775&r2=1459902&rev=1459902&view=diff ============================================================================== --- syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/SyncRule.java (original) +++ syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/SyncCorrelationRule.java Fri Mar 22 17:05:41 2013 @@ -24,7 +24,7 @@ import org.identityconnectors.framework. /** * Interface for correlation rule to be evaluated during SyncJob execution. */ -public interface SyncRule { +public interface SyncCorrelationRule { /** * Return a search condition. @@ -32,5 +32,5 @@ public interface SyncRule { * @param connObj connector object. * @return search condition. */ - NodeCond getSearchCond(final ConnectorObject connObj); + NodeCond getSearchCond(ConnectorObject connObj); } Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java?rev=1459902&r1=1459901&r2=1459902&view=diff ============================================================================== --- syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java (original) +++ syncope/trunk/core/src/main/java/org/apache/syncope/core/sync/impl/SyncopeSyncResultHandler.java Fri Mar 22 17:05:41 2013 @@ -72,7 +72,7 @@ import org.apache.syncope.core.rest.data import org.apache.syncope.core.rest.data.UserDataBinder; import org.apache.syncope.core.sync.SyncActions; import org.apache.syncope.core.sync.SyncResult; -import org.apache.syncope.core.sync.SyncRule; +import org.apache.syncope.core.sync.SyncCorrelationRule; import org.apache.syncope.core.util.AttributableUtil; import org.apache.syncope.core.util.EntitlementUtil; import org.apache.syncope.core.workflow.WorkflowResult; @@ -343,7 +343,7 @@ public class SyncopeSyncResultHandler im } private List findByCorrelationRule( - final ConnectorObject connObj, final SyncRule rule, final AttributableUtil attrUtil) { + final ConnectorObject connObj, final SyncCorrelationRule rule, final AttributableUtil attrUtil) { return search(rule.getSearchCond(connObj), attrUtil); } @@ -441,7 +441,7 @@ public class SyncopeSyncResultHandler im syncPolicySpec = syncTask.getResource().getSyncPolicy().getSpecification(); } - SyncRule syncRule = null; + SyncCorrelationRule syncRule = null; List altSearchSchemas = null; if (syncPolicySpec != null) { Modified: syncope/trunk/core/src/main/java/org/apache/syncope/core/util/AttributableUtil.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/main/java/org/apache/syncope/core/util/AttributableUtil.java?rev=1459902&r1=1459901&r2=1459902&view=diff ============================================================================== --- syncope/trunk/core/src/main/java/org/apache/syncope/core/util/AttributableUtil.java (original) +++ syncope/trunk/core/src/main/java/org/apache/syncope/core/util/AttributableUtil.java Fri Mar 22 17:05:41 2013 @@ -69,7 +69,7 @@ import org.apache.syncope.core.persisten import org.apache.syncope.core.persistence.beans.user.USchema; import org.apache.syncope.core.persistence.beans.user.UVirAttr; import org.apache.syncope.core.persistence.beans.user.UVirSchema; -import org.apache.syncope.core.sync.SyncRule; +import org.apache.syncope.core.sync.SyncCorrelationRule; import org.identityconnectors.framework.common.objects.ObjectClass; import org.slf4j.LoggerFactory; @@ -625,7 +625,7 @@ public class AttributableUtil { return result; } - public SyncRule getCorrelationRule(final SyncPolicySpec policySpec) { + public SyncCorrelationRule getCorrelationRule(final SyncPolicySpec policySpec) { String clazz; @@ -641,11 +641,11 @@ public class AttributableUtil { clazz = null; } - SyncRule res = null; + SyncCorrelationRule res = null; if (StringUtils.isNotBlank(clazz)) { try { - res = (SyncRule) Class.forName(clazz).newInstance(); + res = (SyncCorrelationRule) Class.forName(clazz).newInstance(); } catch (Exception e) { LOG.error("Failure instantiating correlation rule class '{}'", clazz, e); } Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/PolicyTestITCase.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/PolicyTestITCase.java?rev=1459902&r1=1459901&r2=1459902&view=diff ============================================================================== --- syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/PolicyTestITCase.java (original) +++ syncope/trunk/core/src/test/java/org/apache/syncope/core/rest/PolicyTestITCase.java Fri Mar 22 17:05:41 2013 @@ -165,7 +165,7 @@ public class PolicyTestITCase extends Ab @Test public void getCorrelationRules() { - assertEquals(1, policyService.getCorrelationRuleClasses(PolicyType.SYNC).size()); + assertEquals(1, policyService.getSyncCorrelationRuleClasses(PolicyType.SYNC).size()); } private SyncPolicyTO buildSyncPolicyTO() { Modified: syncope/trunk/core/src/test/java/org/apache/syncope/core/sync/TestSyncRule.java URL: http://svn.apache.org/viewvc/syncope/trunk/core/src/test/java/org/apache/syncope/core/sync/TestSyncRule.java?rev=1459902&r1=1459901&r2=1459902&view=diff ============================================================================== --- syncope/trunk/core/src/test/java/org/apache/syncope/core/sync/TestSyncRule.java (original) +++ syncope/trunk/core/src/test/java/org/apache/syncope/core/sync/TestSyncRule.java Fri Mar 22 17:05:41 2013 @@ -22,7 +22,7 @@ import org.apache.syncope.common.search. import org.apache.syncope.common.search.NodeCond; import org.identityconnectors.framework.common.objects.ConnectorObject; -public class TestSyncRule implements SyncRule { +public class TestSyncRule implements SyncCorrelationRule { @Override public NodeCond getSearchCond(ConnectorObject connObj) {