syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [1/2] syncope git commit: [SYNCOPE-680] Implementation provided
Date Thu, 17 Dec 2015 14:08:29 GMT
Repository: syncope
Updated Branches:
  refs/heads/master 1358b3552 -> b37910513


[SYNCOPE-680] Implementation provided


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

Branch: refs/heads/master
Commit: 856830dcf870f2f182a51b366f09a0637e4fa7bd
Parents: 1358b35
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Thu Dec 17 14:59:21 2015 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Thu Dec 17 14:59:21 2015 +0100

----------------------------------------------------------------------
 .../notification/NotificationResultManager.java |  2 +-
 .../syncope/common/lib/to/NotificationTO.java   | 20 ++++++++---
 .../apache/syncope/common/lib/to/SyncopeTO.java |  9 +++++
 .../apache/syncope/core/logic/SyncopeLogic.java |  3 +-
 .../init/ClassPathScanImplementationLookup.java | 12 +++----
 .../persistence/api/ImplementationLookup.java   |  4 +--
 .../persistence/api/entity/Notification.java    |  8 +++--
 .../api/entity/task/NotificationTask.java       | 25 ++++++--------
 .../persistence/jpa/entity/JPANotification.java | 23 +++++++++----
 .../jpa/entity/task/JPANotificationTask.java    | 10 ------
 .../persistence/jpa/inner/NotificationTest.java |  6 ++--
 .../test/resources/domains/MasterContent.xml    |  2 +-
 .../NotificationRecipientsProvider.java         | 27 +++++++++++++++
 .../java/data/NotificationDataBinderImpl.java   |  5 +--
 .../notification/NotificationManagerImpl.java   | 19 +++++++++--
 .../TestNotificationRecipientsProvider.java     | 35 ++++++++++++++++++++
 .../fit/core/reference/NotificationITCase.java  |  4 +--
 .../core/reference/NotificationTaskITCase.java  |  8 +++--
 18 files changed, 161 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/856830dc/client/cli/src/main/java/org/apache/syncope/client/cli/commands/notification/NotificationResultManager.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/notification/NotificationResultManager.java
b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/notification/NotificationResultManager.java
index 739b8cf..951f1c1 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/notification/NotificationResultManager.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/notification/NotificationResultManager.java
@@ -36,7 +36,7 @@ public class NotificationResultManager extends CommonsResultManager {
         System.out.println("    events: " + notificationTO.getEvents());
         System.out.println("    sender: " + notificationTO.getSender());
         System.out.println("    subject: " + notificationTO.getSubject());
-        System.out.println("    recipients: " + notificationTO.getRecipients());
+        System.out.println("    recipients: " + notificationTO.getRecipientsFIQL());
         System.out.println("    recipient attribute name: " + notificationTO.getRecipientAttrName());
         System.out.println("    template: " + notificationTO.getTemplate());
         System.out.println("    abouts: " + notificationTO.getAbouts());

http://git-wip-us.apache.org/repos/asf/syncope/blob/856830dc/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTO.java
b/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTO.java
index 01f70d0..cd3f7ce 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTO.java
@@ -49,7 +49,7 @@ public class NotificationTO extends AbstractBaseBean {
     @JsonIgnore
     private final Map<String, String> abouts = new HashMap<>();
 
-    private String recipients;
+    private String recipientsFIQL;
 
     private final List<String> staticRecipients = new ArrayList<>();
 
@@ -59,6 +59,8 @@ public class NotificationTO extends AbstractBaseBean {
 
     private boolean selfAsRecipient;
 
+    private String recipientsProviderClassName;
+
     private String sender;
 
     private String subject;
@@ -97,12 +99,12 @@ public class NotificationTO extends AbstractBaseBean {
         this.key = key;
     }
 
-    public String getRecipients() {
-        return recipients;
+    public String getRecipientsFIQL() {
+        return recipientsFIQL;
     }
 
-    public void setRecipients(final String recipients) {
-        this.recipients = recipients;
+    public void setRecipientsFIQL(final String recipientsFIQL) {
+        this.recipientsFIQL = recipientsFIQL;
     }
 
     public String getRecipientAttrName() {
@@ -129,6 +131,14 @@ public class NotificationTO extends AbstractBaseBean {
         this.selfAsRecipient = selfAsRecipient;
     }
 
+    public String getRecipientsProviderClassName() {
+        return recipientsProviderClassName;
+    }
+
+    public void setRecipientsProviderClassName(final String recipientsProviderClassName)
{
+        this.recipientsProviderClassName = recipientsProviderClassName;
+    }
+
     public String getSender() {
         return sender;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/856830dc/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
index 85b75cd..56e518f 100644
--- 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
@@ -87,6 +87,8 @@ public class SyncopeTO extends AbstractBaseBean {
 
     private final Set<String> validators = new HashSet<>();
 
+    private final Set<String> notificationRecipientsProviders = new HashSet<>();
+
     private final Set<String> mailTemplates = new HashSet<>();
 
     public String getVersion() {
@@ -246,6 +248,13 @@ public class SyncopeTO extends AbstractBaseBean {
         return validators;
     }
 
+    @XmlElementWrapper(name = "notificationRecipientsProviders")
+    @XmlElement(name = "notificationRecipientsProvider")
+    @JsonProperty("notificationRecipientsProviders")
+    public Set<String> getNotificationRecipientsProviders() {
+        return notificationRecipientsProviders;
+    }
+
     @XmlElementWrapper(name = "mailTemplates")
     @XmlElement(name = "mailTemplate")
     @JsonProperty("mailTemplates")

http://git-wip-us.apache.org/repos/asf/syncope/blob/856830dc/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 f2a9c3b..e86db66 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
@@ -143,8 +143,9 @@ public class SyncopeLogic extends AbstractLogic<SyncopeTO> {
         syncopeTO.getSyncActions().addAll(implLookup.getClassNames(Type.SYNC_ACTIONS));
         syncopeTO.getPushActions().addAll(implLookup.getClassNames(Type.PUSH_ACTIONS));
         syncopeTO.getSyncCorrelationRules().addAll(implLookup.getClassNames(Type.SYNC_CORRELATION_RULE));
-        syncopeTO.getPushCorrelationRules().addAll(implLookup.getClassNames(Type.PUSH_CORRELATION_RULE));
         syncopeTO.getValidators().addAll(implLookup.getClassNames(Type.VALIDATOR));
+        syncopeTO.getNotificationRecipientsProviders().
+                addAll(implLookup.getClassNames(Type.NOTIFICATION_RECIPIENTS_PROVIDER));
 
         Set<String> htmlTemplates = new HashSet<>();
         Set<String> textTemplates = new HashSet<>();

http://git-wip-us.apache.org/repos/asf/syncope/blob/856830dc/core/logic/src/main/java/org/apache/syncope/core/logic/init/ClassPathScanImplementationLookup.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/init/ClassPathScanImplementationLookup.java
b/core/logic/src/main/java/org/apache/syncope/core/logic/init/ClassPathScanImplementationLookup.java
index 3fc4fc4..c544f68 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/init/ClassPathScanImplementationLookup.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/init/ClassPathScanImplementationLookup.java
@@ -40,6 +40,7 @@ import org.apache.syncope.core.persistence.api.dao.PasswordRuleConfClass;
 import org.apache.syncope.core.provisioning.api.LogicActions;
 import org.apache.syncope.core.provisioning.api.data.MappingItemTransformer;
 import org.apache.syncope.core.provisioning.api.job.SchedTaskJobDelegate;
+import org.apache.syncope.core.provisioning.api.notification.NotificationRecipientsProvider;
 import org.apache.syncope.core.provisioning.api.propagation.PropagationActions;
 import org.apache.syncope.core.provisioning.api.sync.PushActions;
 import org.apache.syncope.core.provisioning.api.sync.SyncActions;
@@ -100,9 +101,8 @@ public class ClassPathScanImplementationLookup implements ImplementationLookup
{
         scanner.addIncludeFilter(new AssignableTypeFilter(SyncActions.class));
         scanner.addIncludeFilter(new AssignableTypeFilter(PushActions.class));
         scanner.addIncludeFilter(new AssignableTypeFilter(SyncCorrelationRule.class));
-        // Remove once SYNCOPE-470 is done
-        //scanner.addIncludeFilter(new AssignableTypeFilter(PushCorrelationRule.class));
         scanner.addIncludeFilter(new AssignableTypeFilter(Validator.class));
+        scanner.addIncludeFilter(new AssignableTypeFilter(NotificationRecipientsProvider.class));
 
         for (BeanDefinition bd : scanner.findCandidateComponents(StringUtils.EMPTY)) {
             try {
@@ -170,13 +170,13 @@ public class ClassPathScanImplementationLookup implements ImplementationLookup
{
                     classNames.get(Type.SYNC_CORRELATION_RULE).add(bd.getBeanClassName());
                 }
 
-                // Uncomment when SYNCOPE-470 is done
-                /* if (PushCorrelationRule.class.isAssignableFrom(clazz) && !isAbsractClazz)
{
-                 * classNames.get(Type.PUSH_CORRELATION_RULES).add(metadata.getClassName());
-                 * } */
                 if (Validator.class.isAssignableFrom(clazz) && !isAbsractClazz) {
                     classNames.get(Type.VALIDATOR).add(bd.getBeanClassName());
                 }
+
+                if (NotificationRecipientsProvider.class.isAssignableFrom(clazz) &&
!isAbsractClazz) {
+                    classNames.get(Type.NOTIFICATION_RECIPIENTS_PROVIDER).add(bd.getBeanClassName());
+                }
             } catch (Throwable t) {
                 LOG.warn("Could not inspect class {}", bd.getBeanClassName(), t);
             }

http://git-wip-us.apache.org/repos/asf/syncope/blob/856830dc/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/ImplementationLookup.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/ImplementationLookup.java
b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/ImplementationLookup.java
index 6b84c99..ff7284a 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/ImplementationLookup.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/ImplementationLookup.java
@@ -41,8 +41,8 @@ public interface ImplementationLookup extends SyncopeLoader {
         SYNC_ACTIONS,
         PUSH_ACTIONS,
         SYNC_CORRELATION_RULE,
-        PUSH_CORRELATION_RULE,
-        VALIDATOR
+        VALIDATOR,
+        NOTIFICATION_RECIPIENTS_PROVIDER;
 
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/856830dc/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Notification.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Notification.java
b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Notification.java
index dbf8552..bb395fa 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Notification.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Notification.java
@@ -40,9 +40,13 @@ public interface Notification extends Entity<Long> {
 
     void setRecipientAttrType(IntMappingType recipientAttrType);
 
-    String getRecipients();
+    String getRecipientsFIQL();
 
-    void setRecipients(String recipients);
+    void setRecipientsFIQL(String recipientsFIQL);
+
+    String getRecipientsProviderClassName();
+
+    void setRecipientsProviderClassName(String recipientsProviderClassName);
 
     boolean add(AnyAbout about);
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/856830dc/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/NotificationTask.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/NotificationTask.java
b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/NotificationTask.java
index 754401b..71af61d 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/NotificationTask.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/NotificationTask.java
@@ -23,33 +23,30 @@ import org.apache.syncope.common.lib.types.TraceLevel;
 
 public interface NotificationTask extends Task {
 
-    String getHtmlBody();
-
-    Set<String> getRecipients();
+    void setSender(String sender);
 
     String getSender();
 
-    String getSubject();
+    Set<String> getRecipients();
 
-    String getTextBody();
+    String getSubject();
 
-    TraceLevel getTraceLevel();
+    void setSubject(String subject);
 
-    boolean isExecuted();
+    void setTextBody(String textBody);
 
-    void setExecuted(boolean executed);
+    String getTextBody();
 
     void setHtmlBody(String htmlBody);
 
-    boolean addRecipient(String recipient);
+    String getHtmlBody();
 
-    boolean removeRecipient(String recipient);
+    void setTraceLevel(TraceLevel traceLevel);
 
-    void setSender(String sender);
+    TraceLevel getTraceLevel();
 
-    void setSubject(String subject);
+    boolean isExecuted();
 
-    void setTextBody(String textBody);
+    void setExecuted(boolean executed);
 
-    void setTraceLevel(TraceLevel traceLevel);
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/856830dc/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPANotification.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPANotification.java
b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPANotification.java
index da253de..12555ea 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPANotification.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPANotification.java
@@ -68,7 +68,7 @@ public class JPANotification extends AbstractEntity<Long> implements
Notificatio
     @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER,
mappedBy = "notification")
     private List<JPAAnyAbout> abouts;
 
-    private String recipients;
+    private String recipientsFIQL;
 
     @ElementCollection(fetch = FetchType.EAGER)
     @CollectionTable(name = "Notification_staticRecipients",
@@ -84,6 +84,8 @@ public class JPANotification extends AbstractEntity<Long> implements
Notificatio
     @NotNull
     private String recipientAttrName;
 
+    private String recipientsProviderClassName;
+
     @NotNull
     @Basic
     @Min(0)
@@ -124,13 +126,13 @@ public class JPANotification extends AbstractEntity<Long> implements
Notificatio
     }
 
     @Override
-    public String getRecipients() {
-        return recipients;
+    public String getRecipientsFIQL() {
+        return recipientsFIQL;
     }
 
     @Override
-    public void setRecipients(final String recipients) {
-        this.recipients = recipients;
+    public void setRecipientsFIQL(final String recipientsFIQL) {
+        this.recipientsFIQL = recipientsFIQL;
     }
 
     @Override
@@ -149,12 +151,21 @@ public class JPANotification extends AbstractEntity<Long> implements
Notificatio
     }
 
     @Override
-
     public void setRecipientAttrType(final IntMappingType recipientAttrType) {
         this.recipientAttrType = recipientAttrType;
     }
 
     @Override
+    public String getRecipientsProviderClassName() {
+        return recipientsProviderClassName;
+    }
+
+    @Override
+    public void setRecipientsProviderClassName(final String recipientsProviderClassName)
{
+        this.recipientsProviderClassName = recipientsProviderClassName;
+    }
+
+    @Override
     public List<String> getEvents() {
         return events;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/856830dc/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPANotificationTask.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPANotificationTask.java
b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPANotificationTask.java
index f483a19..e1a2456 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPANotificationTask.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPANotificationTask.java
@@ -89,16 +89,6 @@ public class JPANotificationTask extends AbstractTask implements NotificationTas
     }
 
     @Override
-    public boolean addRecipient(final String recipient) {
-        return recipients.add(recipient);
-    }
-
-    @Override
-    public boolean removeRecipient(final String recipient) {
-        return recipients.remove(recipient);
-    }
-
-    @Override
     public String getSender() {
         return sender;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/856830dc/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/NotificationTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/NotificationTest.java
b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/NotificationTest.java
index b97cbd4..de1984c 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/NotificationTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/NotificationTest.java
@@ -49,7 +49,7 @@ public class NotificationTest extends AbstractTest {
         assertNotNull(notification.getEvents());
         assertFalse(notification.getEvents().isEmpty());
         assertNotNull(notification.getAbout(anyTypeDAO.findUser()));
-        assertNotNull(notification.getRecipients());
+        assertNotNull(notification.getRecipientsFIQL());
 
     }
 
@@ -71,7 +71,7 @@ public class NotificationTest extends AbstractTest {
         about.setAnyType(anyTypeDAO.findUser());
         about.set("fake search condition");
 
-        notification.setRecipients("fake recipients");
+        notification.setRecipientsFIQL("fake recipients");
 
         notification.setRecipientAttrName("email");
         notification.setRecipientAttrType(IntMappingType.UserPlainSchema);
@@ -102,7 +102,7 @@ public class NotificationTest extends AbstractTest {
         about.setAnyType(anyTypeDAO.findUser());
         about.set("fake search condition");
 
-        notification.setRecipients("fake search condition");
+        notification.setRecipientsFIQL("fake search condition");
 
         notification.setRecipientAttrName("email");
         notification.setRecipientAttrType(IntMappingType.UserPlainSchema);

http://git-wip-us.apache.org/repos/asf/syncope/blob/856830dc/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/resources/domains/MasterContent.xml b/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
index efe407e..63f0878 100644
--- a/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
+++ b/core/persistence-jpa/src/test/resources/domains/MasterContent.xml
@@ -1108,7 +1108,7 @@ under the License.
 
   <Notification id="10" sender="test@syncope.apache.org" subject="Test subject" template="test"
selfAsRecipient="0" 
                 traceLevel="FAILURES"
-                recipients="$groups==7"
+                recipientsFIQL="$groups==7"
                 recipientAttrType="UserPlainSchema" recipientAttrName="email" active="1"/>
   <AnyAbout id="10" anyType_name="USER" notification_id="10" about="fullname==*o*;fullname==*i*"/>
   <Notification_events Notification_id="10" event="[CUSTOM]:[]:[]:[unexisting1]:[FAILURE]"/>

http://git-wip-us.apache.org/repos/asf/syncope/blob/856830dc/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/notification/NotificationRecipientsProvider.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/notification/NotificationRecipientsProvider.java
b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/notification/NotificationRecipientsProvider.java
new file mode 100644
index 0000000..1b30768
--- /dev/null
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/notification/NotificationRecipientsProvider.java
@@ -0,0 +1,27 @@
+/*
+ * 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.core.provisioning.api.notification;
+
+import java.util.Set;
+import org.apache.syncope.core.persistence.api.entity.Notification;
+
+public interface NotificationRecipientsProvider {
+
+    Set<String> provideRecipients(Notification notification);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/856830dc/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/NotificationDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/NotificationDataBinderImpl.java
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/NotificationDataBinderImpl.java
index 0d7ee47..2b425c5 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/NotificationDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/NotificationDataBinderImpl.java
@@ -40,7 +40,7 @@ public class NotificationDataBinderImpl implements NotificationDataBinder
{
 
     private static final Logger LOG = LoggerFactory.getLogger(NotificationDataBinder.class);
 
-    private static final String[] IGNORE_PROPERTIES = { "key", "abouts", "recipients" };
+    private static final String[] IGNORE_PROPERTIES = { "key", "abouts" };
 
     @Autowired
     private AnyTypeDAO anyTypeDAO;
@@ -59,8 +59,6 @@ public class NotificationDataBinderImpl implements NotificationDataBinder
{
             result.getAbouts().put(about.getAnyType().getKey(), about.get());
         }
 
-        result.setRecipients(notification.getRecipients());
-
         return result;
     }
 
@@ -74,7 +72,6 @@ public class NotificationDataBinderImpl implements NotificationDataBinder
{
     @Override
     public void update(final Notification notification, final NotificationTO notificationTO)
{
         BeanUtils.copyProperties(notificationTO, notification, IGNORE_PROPERTIES);
-        notification.setRecipients(notificationTO.getRecipients());
 
         // 1. add or update all (valid) abouts from TO
         for (Map.Entry<String, String> entry : notificationTO.getAbouts().entrySet())
{

http://git-wip-us.apache.org/repos/asf/syncope/blob/856830dc/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java
index 9aa507a..82166dc 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/notification/NotificationManagerImpl.java
@@ -54,6 +54,7 @@ import org.apache.syncope.core.persistence.api.entity.user.User;
 import org.apache.syncope.core.provisioning.api.data.GroupDataBinder;
 import org.apache.syncope.core.provisioning.api.data.UserDataBinder;
 import org.apache.syncope.core.misc.search.SearchCondConverter;
+import org.apache.syncope.core.misc.spring.ApplicationContextProvider;
 import org.apache.syncope.core.persistence.api.dao.AnyObjectDAO;
 import org.apache.syncope.core.persistence.api.dao.AnySearchDAO;
 import org.apache.syncope.core.persistence.api.dao.DerSchemaDAO;
@@ -65,6 +66,7 @@ import org.apache.syncope.core.persistence.api.entity.DerSchema;
 import org.apache.syncope.core.persistence.api.entity.VirSchema;
 import org.apache.syncope.core.provisioning.api.DerAttrHandler;
 import org.apache.syncope.core.provisioning.api.VirAttrHandler;
+import org.apache.syncope.core.provisioning.api.notification.NotificationRecipientsProvider;
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.app.VelocityEngine;
 import org.apache.velocity.context.Context;
@@ -73,6 +75,7 @@ import org.apache.velocity.tools.ToolManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.support.AbstractBeanDefinition;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -188,9 +191,9 @@ public class NotificationManagerImpl implements NotificationManager {
 
         List<User> recipients = new ArrayList<>();
 
-        if (notification.getRecipients() != null) {
+        if (notification.getRecipientsFIQL() != null) {
             recipients.addAll(searchDAO.<User>search(
-                    SearchCondConverter.convert(notification.getRecipients()),
+                    SearchCondConverter.convert(notification.getRecipientsFIQL()),
                     Collections.<OrderByClause>emptyList(), AnyTypeKind.USER));
         }
 
@@ -217,6 +220,18 @@ public class NotificationManagerImpl implements NotificationManager {
             recipientEmails.addAll(notification.getStaticRecipients());
         }
 
+        if (notification.getRecipientsProviderClassName() != null) {
+            try {
+                NotificationRecipientsProvider recipientsProvider =
+                        (NotificationRecipientsProvider) ApplicationContextProvider.getBeanFactory().
+                        createBean(Class.forName(notification.getRecipientsProviderClassName()),
+                                AbstractBeanDefinition.AUTOWIRE_BY_NAME, false);
+                recipientEmails.addAll(recipientsProvider.provideRecipients(notification));
+            } catch (Exception e) {
+                LOG.error("Could not fetch recipients from {}", notification.getRecipientsProviderClassName(),
e);
+            }
+        }
+
         model.put("recipients", recipientTOs);
         model.put("syncopeConf", this.findAllSyncopeConfs());
         model.put("events", notification.getEvents());

http://git-wip-us.apache.org/repos/asf/syncope/blob/856830dc/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestNotificationRecipientsProvider.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestNotificationRecipientsProvider.java
b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestNotificationRecipientsProvider.java
new file mode 100644
index 0000000..178e399
--- /dev/null
+++ b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestNotificationRecipientsProvider.java
@@ -0,0 +1,35 @@
+/*
+ * 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.fit.core.reference;
+
+import java.util.Collections;
+import java.util.Set;
+import org.apache.syncope.core.persistence.api.entity.Notification;
+import org.apache.syncope.core.provisioning.api.notification.NotificationRecipientsProvider;
+import org.springframework.transaction.annotation.Transactional;
+
+public class TestNotificationRecipientsProvider implements NotificationRecipientsProvider
{
+
+    @Transactional(readOnly = true)
+    @Override
+    public Set<String> provideRecipients(final Notification notification) {
+        return Collections.singleton(getClass().getSimpleName() + "@syncope.apache.org");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/856830dc/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/NotificationITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/NotificationITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/NotificationITCase.java
index 09f40f9..f1c4c89 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/NotificationITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/NotificationITCase.java
@@ -77,7 +77,7 @@ public class NotificationITCase extends AbstractITCase {
     @Test
     public void create() {
         NotificationTO notificationTO = buildNotificationTO();
-        notificationTO.setRecipients(SyncopeClient.getUserSearchConditionBuilder().inGroups(7L).query());
+        notificationTO.setRecipientsFIQL(SyncopeClient.getUserSearchConditionBuilder().inGroups(7L).query());
 
         Response response = notificationService.create(notificationTO);
         NotificationTO actual = getObject(response.getLocation(), NotificationService.class,
NotificationTO.class);
@@ -91,7 +91,7 @@ public class NotificationITCase extends AbstractITCase {
     @Test
     public void update() {
         NotificationTO notificationTO = notificationService.read(10L);
-        notificationTO.setRecipients(SyncopeClient.getUserSearchConditionBuilder().inGroups(7L).query());
+        notificationTO.setRecipientsFIQL(SyncopeClient.getUserSearchConditionBuilder().inGroups(7L).query());
 
         notificationService.update(notificationTO);
         NotificationTO actual = notificationService.read(notificationTO.getKey());

http://git-wip-us.apache.org/repos/asf/syncope/blob/856830dc/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/NotificationTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/NotificationTaskITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/NotificationTaskITCase.java
index 0d18693..3ac567e 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/NotificationTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/NotificationTaskITCase.java
@@ -308,11 +308,12 @@ public class NotificationTaskITCase extends AbstractTaskITCase {
         notification.getAbouts().put(AnyTypeKind.GROUP.name(),
                 SyncopeClient.getGroupSearchConditionBuilder().is("name").equalTo(groupName).query());
 
-        notification.setRecipients(SyncopeClient.getUserSearchConditionBuilder().inGroups(8L).query());
+        notification.setRecipientsFIQL(SyncopeClient.getUserSearchConditionBuilder().inGroups(8L).query());
         notification.setSelfAsRecipient(false);
         notification.setRecipientAttrName("email");
         notification.setRecipientAttrType(IntMappingType.UserPlainSchema);
         notification.getStaticRecipients().add(MAIL_ADDRESS);
+        notification.setRecipientsProviderClassName(TestNotificationRecipientsProvider.class.getName());
 
         String sender = "syncopetest-" + getUUIDString() + "@syncope.apache.org";
         notification.setSender(sender);
@@ -324,6 +325,7 @@ public class NotificationTaskITCase extends AbstractTaskITCase {
         Response response = notificationService.create(notification);
         notification = getObject(response.getLocation(), NotificationService.class, NotificationTO.class);
         assertNotNull(notification);
+        assertEquals(TestNotificationRecipientsProvider.class.getName(), notification.getRecipientsProviderClassName());
 
         // 2. create group
         GroupTO groupTO = new GroupTO();
@@ -335,6 +337,8 @@ public class NotificationTaskITCase extends AbstractTaskITCase {
         // 3. verify
         NotificationTaskTO taskTO = findNotificationTaskBySender(sender);
         assertNotNull(taskTO);
+        assertTrue(taskTO.getRecipients().containsAll(
+                new TestNotificationRecipientsProvider().provideRecipients(null)));
 
         execNotificationTask(taskService, taskTO.getKey(), 50);
 
@@ -364,7 +368,7 @@ public class NotificationTaskITCase extends AbstractTaskITCase {
                     SyncopeClient.getUserSearchConditionBuilder().inGroups(7L).query());
         }
 
-        notification.setRecipients(SyncopeClient.getUserSearchConditionBuilder().inGroups(8L).query());
+        notification.setRecipientsFIQL(SyncopeClient.getUserSearchConditionBuilder().inGroups(8L).query());
         notification.setSelfAsRecipient(true);
         notification.setRecipientAttrName("email");
         notification.setRecipientAttrType(IntMappingType.UserPlainSchema);


Mime
View raw message