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 2015/01/12 17:31:51 UTC
[12/52] [abbrv] [partial] syncope git commit: [SYNCOPE-620] Unit
tests all in
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/cache/VirAttrCache.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/cache/VirAttrCache.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/cache/VirAttrCache.java
new file mode 100644
index 0000000..f75c82d
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/cache/VirAttrCache.java
@@ -0,0 +1,65 @@
+/*
+ * 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.server.provisioning.api.cache;
+
+import org.apache.syncope.common.lib.types.AttributableType;
+
+/**
+ * Virtual Attribute Value cache.
+ */
+public interface VirAttrCache {
+
+ /**
+ * Force entry expiring.
+ *
+ * @param type user or role
+ * @param id user or role id
+ * @param schemaName virtual attribute schema name
+ */
+ void expire(AttributableType type, Long id, String schemaName);
+
+ /**
+ * Retrieve cached value. Return null in case of virtual attribute not cached.
+ *
+ * @param type user or role
+ * @param id user or role id
+ * @param schemaName virtual attribute schema name.
+ * @return cached values or null if virtual attribute is not cached.
+ */
+ VirAttrCacheValue get(AttributableType type, Long id, String schemaName);
+
+ /**
+ * Cache entry is valid if and only if value exist and it is not expired.
+ *
+ * @param value cache entry value.
+ * @return TRUE if the value is valid; FALSE otherwise.
+ */
+ boolean isValidEntry(VirAttrCacheValue value);
+
+ /**
+ * Cache virtual attribute values.
+ *
+ * @param type user or role
+ * @param id user or role id
+ * @param schemaName virtual attribute name
+ * @param value virtual attribute values
+ */
+ void put(AttributableType type, Long id, String schemaName, VirAttrCacheValue value);
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/cache/VirAttrCacheKey.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/cache/VirAttrCacheKey.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/cache/VirAttrCacheKey.java
new file mode 100644
index 0000000..178e339
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/cache/VirAttrCacheKey.java
@@ -0,0 +1,79 @@
+/*
+ * 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.server.provisioning.api.cache;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import org.apache.syncope.common.lib.types.AttributableType;
+
+/**
+ * Cache entry key.
+ */
+public class VirAttrCacheKey {
+
+ /**
+ * Subject type.
+ */
+ private final AttributableType type;
+
+ /**
+ * Subject key.
+ */
+ private final transient Long key;
+
+ /**
+ * Virtual attribute schema name.
+ */
+ private final transient String virSchema;
+
+ public VirAttrCacheKey(final AttributableType type, final Long key, final String virSchema) {
+ this.type = type;
+ this.key = key;
+ this.virSchema = virSchema;
+ }
+
+ public AttributableType getType() {
+ return type;
+ }
+
+ public Long getKey() {
+ return key;
+ }
+
+ public String getVirSchema() {
+ return virSchema;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ return EqualsBuilder.reflectionEquals(this, obj, true);
+ }
+
+ @Override
+ public int hashCode() {
+ return HashCodeBuilder.reflectionHashCode(this, true);
+ }
+
+ @Override
+ public String toString() {
+ return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE, true);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/cache/VirAttrCacheValue.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/cache/VirAttrCacheValue.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/cache/VirAttrCacheValue.java
new file mode 100644
index 0000000..3cced91
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/cache/VirAttrCacheValue.java
@@ -0,0 +1,86 @@
+/*
+ * 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.server.provisioning.api.cache;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Cache entry value.
+ */
+public class VirAttrCacheValue {
+
+ /**
+ * Virtual attribute values.
+ */
+ private final Map<String, Set<String>> values;
+
+ /**
+ * Entry creation date.
+ */
+ private Date creationDate;
+
+ /**
+ * Entry access date.
+ */
+ private Date lastAccessDate;
+
+ public VirAttrCacheValue() {
+ this.creationDate = new Date();
+ this.lastAccessDate = new Date();
+ values = new HashMap<>();
+ }
+
+ public void setResourceValues(final String resourceName, final Set<String> values) {
+ this.values.put(resourceName, values);
+ }
+
+ public Date getCreationDate() {
+ return creationDate;
+ }
+
+ public void forceExpiring() {
+ creationDate = new Date(0);
+ }
+
+ public Set<String> getValues(final String resourceName) {
+ return values.get(resourceName);
+ }
+
+ public Set<String> getValues() {
+ final Set<String> res = new HashSet<>();
+
+ for (Set<String> value : values.values()) {
+ res.addAll(value);
+ }
+
+ return res;
+ }
+
+ public Date getLastAccessDate() {
+ return lastAccessDate;
+ }
+
+ void setLastAccessDate(final Date lastAccessDate) {
+ this.lastAccessDate = lastAccessDate;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/ConfigurationDataBinder.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/ConfigurationDataBinder.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/ConfigurationDataBinder.java
new file mode 100644
index 0000000..75a9ea7
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/ConfigurationDataBinder.java
@@ -0,0 +1,34 @@
+/*
+ * 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.server.provisioning.api.data;
+
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.common.lib.to.ConfTO;
+import org.apache.syncope.server.persistence.api.entity.conf.CPlainAttr;
+import org.apache.syncope.server.persistence.api.entity.conf.Conf;
+
+public interface ConfigurationDataBinder {
+
+ AttrTO getAttrTO(CPlainAttr attr);
+
+ ConfTO getConfTO(Conf conf);
+
+ CPlainAttr getAttribute(AttrTO attributeTO);
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/ConnInstanceDataBinder.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/ConnInstanceDataBinder.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/ConnInstanceDataBinder.java
new file mode 100644
index 0000000..f98f4f1
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/ConnInstanceDataBinder.java
@@ -0,0 +1,48 @@
+/*
+ * 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.server.provisioning.api.data;
+
+import java.util.Set;
+import org.apache.syncope.common.lib.to.ConnInstanceTO;
+import org.apache.syncope.common.lib.types.ConnConfPropSchema;
+import org.apache.syncope.common.lib.types.ConnConfProperty;
+import org.apache.syncope.server.persistence.api.entity.ConnInstance;
+import org.identityconnectors.framework.api.ConfigurationProperty;
+
+public interface ConnInstanceDataBinder {
+
+ ConnConfPropSchema buildConnConfPropSchema(ConfigurationProperty property);
+
+ ConnInstance getConnInstance(ConnInstanceTO connInstanceTO);
+
+ ConnInstanceTO getConnInstanceTO(ConnInstance connInstance);
+
+ /**
+ * Merge connector configuration properties avoiding repetition but giving priority to primary set.
+ *
+ * @param primary primary set.
+ * @param secondary secondary set.
+ * @return merged set.
+ */
+ Set<ConnConfProperty> mergeConnConfProperties(Set<ConnConfProperty> primary,
+ Set<ConnConfProperty> secondary);
+
+ ConnInstance updateConnInstance(long connInstanceId, ConnInstanceTO connInstanceTO);
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/NotificationDataBinder.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/NotificationDataBinder.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/NotificationDataBinder.java
new file mode 100644
index 0000000..2a393f0
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/NotificationDataBinder.java
@@ -0,0 +1,32 @@
+/*
+ * 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.server.provisioning.api.data;
+
+import org.apache.syncope.common.lib.to.NotificationTO;
+import org.apache.syncope.server.persistence.api.entity.Notification;
+
+public interface NotificationDataBinder {
+
+ NotificationTO getNotificationTO(Notification notification);
+
+ Notification create(NotificationTO notificationTO);
+
+ void update(Notification notification, NotificationTO notificationTO);
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/PolicyDataBinder.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/PolicyDataBinder.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/PolicyDataBinder.java
new file mode 100644
index 0000000..59cc7a4
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/PolicyDataBinder.java
@@ -0,0 +1,36 @@
+/*
+ * 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.server.provisioning.api.data;
+
+import org.apache.syncope.common.lib.to.AbstractPolicyTO;
+import org.apache.syncope.server.persistence.api.entity.Policy;
+
+public interface PolicyDataBinder {
+
+ <T extends Policy> T getPolicy(T policy, AbstractPolicyTO policyTO);
+
+ /**
+ * Get policy TO from policy bean.
+ *
+ * @param policy bean.
+ * @return policy TO.
+ */
+ <T extends AbstractPolicyTO> T getPolicyTO(Policy policy);
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/ReportDataBinder.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/ReportDataBinder.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/ReportDataBinder.java
new file mode 100644
index 0000000..3c8b607
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/ReportDataBinder.java
@@ -0,0 +1,34 @@
+/*
+ * 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.server.provisioning.api.data;
+
+import org.apache.syncope.common.lib.to.ReportExecTO;
+import org.apache.syncope.common.lib.to.ReportTO;
+import org.apache.syncope.server.persistence.api.entity.Report;
+import org.apache.syncope.server.persistence.api.entity.ReportExec;
+
+public interface ReportDataBinder {
+
+ void getReport(Report report, ReportTO reportTO);
+
+ ReportExecTO getReportExecTO(ReportExec execution);
+
+ ReportTO getReportTO(Report report);
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/ResourceDataBinder.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/ResourceDataBinder.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/ResourceDataBinder.java
new file mode 100644
index 0000000..e34a645
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/ResourceDataBinder.java
@@ -0,0 +1,39 @@
+/*
+ * 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.server.provisioning.api.data;
+
+import java.util.Collection;
+import java.util.List;
+import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.server.persistence.api.entity.ConnInstance;
+import org.apache.syncope.server.persistence.api.entity.ExternalResource;
+
+public interface ResourceDataBinder {
+
+ ExternalResource create(ResourceTO resourceTO);
+
+ ConnInstance getConnInstance(ResourceTO resourceTO);
+
+ ResourceTO getResourceTO(ExternalResource resource);
+
+ List<ResourceTO> getResourceTOs(Collection<? extends ExternalResource> resources);
+
+ ExternalResource update(ExternalResource resource, ResourceTO resourceTO);
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/RoleDataBinder.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/RoleDataBinder.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/RoleDataBinder.java
new file mode 100644
index 0000000..34e611f
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/RoleDataBinder.java
@@ -0,0 +1,36 @@
+/*
+ * 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.server.provisioning.api.data;
+
+import org.apache.syncope.common.lib.mod.RoleMod;
+import org.apache.syncope.common.lib.to.RoleTO;
+import org.apache.syncope.common.lib.types.PropagationByResource;
+import org.apache.syncope.server.persistence.api.entity.role.Role;
+
+public interface RoleDataBinder {
+
+ RoleTO getRoleTO(Long key);
+
+ RoleTO getRoleTO(Role role);
+
+ Role create(Role role, RoleTO roleTO);
+
+ PropagationByResource update(Role role, RoleMod roleMod);
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/SchemaDataBinder.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/SchemaDataBinder.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/SchemaDataBinder.java
new file mode 100644
index 0000000..40f627b
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/SchemaDataBinder.java
@@ -0,0 +1,49 @@
+/*
+ * 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.server.provisioning.api.data;
+
+import org.apache.syncope.common.lib.to.DerSchemaTO;
+import org.apache.syncope.common.lib.to.PlainSchemaTO;
+import org.apache.syncope.common.lib.to.VirSchemaTO;
+import org.apache.syncope.server.persistence.api.entity.AttributableUtil;
+import org.apache.syncope.server.persistence.api.entity.DerSchema;
+import org.apache.syncope.server.persistence.api.entity.PlainSchema;
+import org.apache.syncope.server.persistence.api.entity.VirSchema;
+
+public interface SchemaDataBinder {
+
+ <T extends PlainSchema> void create(PlainSchemaTO schemaTO, T schema);
+
+ <T extends DerSchema> T create(DerSchemaTO derSchemaTO, T derSchema);
+
+ <T extends VirSchema> T create(VirSchemaTO virSchemaTO, T virSchema);
+
+ <T extends DerSchema> DerSchemaTO getDerSchemaTO(T derSchema);
+
+ <T extends PlainSchema> PlainSchemaTO getSchemaTO(T schema, AttributableUtil attributableUtil);
+
+ <T extends VirSchema> VirSchemaTO getVirSchemaTO(T virSchema);
+
+ <T extends PlainSchema> void update(PlainSchemaTO schemaTO, T schema, AttributableUtil attributableUtil);
+
+ <T extends DerSchema> T update(DerSchemaTO derSchemaTO, T derSchema);
+
+ <T extends VirSchema> T update(VirSchemaTO virSchemaTO, T virSchema);
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/SecurityQuestionDataBinder.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/SecurityQuestionDataBinder.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/SecurityQuestionDataBinder.java
new file mode 100644
index 0000000..74502be
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/SecurityQuestionDataBinder.java
@@ -0,0 +1,32 @@
+/*
+ * 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.server.provisioning.api.data;
+
+import org.apache.syncope.common.lib.to.SecurityQuestionTO;
+import org.apache.syncope.server.persistence.api.entity.user.SecurityQuestion;
+
+public interface SecurityQuestionDataBinder {
+
+ SecurityQuestion create(SecurityQuestionTO securityQuestionTO);
+
+ SecurityQuestionTO getSecurityQuestionTO(SecurityQuestion securityQuestion);
+
+ void update(SecurityQuestion securityQuestion, SecurityQuestionTO securityQuestionTO);
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/TaskDataBinder.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/TaskDataBinder.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/TaskDataBinder.java
new file mode 100644
index 0000000..e4cce41
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/TaskDataBinder.java
@@ -0,0 +1,39 @@
+/*
+ * 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.server.provisioning.api.data;
+
+import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.syncope.common.lib.to.TaskExecTO;
+import org.apache.syncope.server.persistence.api.entity.task.SchedTask;
+import org.apache.syncope.server.persistence.api.entity.task.Task;
+import org.apache.syncope.server.persistence.api.entity.task.TaskExec;
+import org.apache.syncope.server.persistence.api.entity.task.TaskUtil;
+
+public interface TaskDataBinder {
+
+ SchedTask createSchedTask(SchedTaskTO taskTO, TaskUtil taskUtil);
+
+ TaskExecTO getTaskExecTO(TaskExec execution);
+
+ <T extends AbstractTaskTO> T getTaskTO(Task task, TaskUtil taskUtil);
+
+ void updateSchedTask(SchedTask task, SchedTaskTO taskTO, TaskUtil taskUtil);
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/UserDataBinder.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/UserDataBinder.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/UserDataBinder.java
new file mode 100644
index 0000000..9bd1e6b
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/data/UserDataBinder.java
@@ -0,0 +1,43 @@
+/*
+ * 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.server.provisioning.api.data;
+
+import org.apache.syncope.common.lib.mod.UserMod;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.common.lib.types.PropagationByResource;
+import org.apache.syncope.server.persistence.api.entity.user.User;
+
+public interface UserDataBinder {
+
+ UserTO getAuthenticatedUserTO();
+
+ UserTO getUserTO(String username);
+
+ UserTO getUserTO(Long key);
+
+ UserTO getUserTO(User user);
+
+ void create(User user, UserTO userTO, boolean storePassword);
+
+ PropagationByResource update(User toBeUpdated, UserMod userMod);
+
+ boolean verifyPassword(String username, String password);
+
+ boolean verifyPassword(User user, String password);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/JobNamer.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/JobNamer.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/JobNamer.java
new file mode 100644
index 0000000..49b19fa
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/JobNamer.java
@@ -0,0 +1,72 @@
+/*
+ * 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.server.provisioning.api.job;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.apache.syncope.server.persistence.api.entity.Report;
+import org.apache.syncope.server.persistence.api.entity.task.Task;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public final class JobNamer {
+
+ private static final Logger LOG = LoggerFactory.getLogger(JobNamer.class);
+
+ private static Long getIdFromJobName(final String name, final String pattern, final int prefixLength) {
+ Long result = null;
+
+ Matcher jobMatcher = Pattern.compile(pattern).matcher(name);
+ if (jobMatcher.matches()) {
+ try {
+ result = Long.valueOf(name.substring(prefixLength));
+ } catch (NumberFormatException e) {
+ LOG.error("Unparsable id: {}", name.substring(prefixLength), e);
+ }
+ }
+
+ return result;
+ }
+
+ public static Long getTaskIdFromJobName(final String name) {
+ return getIdFromJobName("taskJob[0-9]+", name, 7);
+ }
+
+ public static Long getReportIdFromJobName(final String name) {
+ return getIdFromJobName("reportJob[0-9]+", name, 9);
+ }
+
+ public static String getJobName(final Task task) {
+ return task == null
+ ? "taskNotificationJob"
+ : "taskJob" + task.getKey();
+ }
+
+ public static String getJobName(final Report report) {
+ return "reportJob" + report.getKey();
+ }
+
+ public static String getTriggerName(final String jobName) {
+ return "Trigger_" + jobName;
+ }
+
+ private JobNamer() {
+ // private constructor for static utility class
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/ProvisioningJob.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/ProvisioningJob.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/ProvisioningJob.java
new file mode 100644
index 0000000..9ad2189
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/ProvisioningJob.java
@@ -0,0 +1,28 @@
+/*
+ * 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.server.provisioning.api.job;
+
+import java.util.List;
+import org.apache.syncope.server.persistence.api.entity.task.ProvisioningTask;
+import org.apache.syncope.server.provisioning.api.sync.ProvisioningActions;
+
+public interface ProvisioningJob<T extends ProvisioningTask, A extends ProvisioningActions> extends TaskJob {
+
+ void setActions(List<A> actions);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/PushJob.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/PushJob.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/PushJob.java
new file mode 100644
index 0000000..9ce212c
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/PushJob.java
@@ -0,0 +1,26 @@
+/*
+ * 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.server.provisioning.api.job;
+
+import org.apache.syncope.server.persistence.api.entity.task.PushTask;
+import org.apache.syncope.server.provisioning.api.sync.PushActions;
+
+public interface PushJob extends ProvisioningJob<PushTask, PushActions> {
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/SyncJob.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/SyncJob.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/SyncJob.java
new file mode 100644
index 0000000..10789c4
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/SyncJob.java
@@ -0,0 +1,26 @@
+/*
+ * 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.server.provisioning.api.job;
+
+import org.apache.syncope.server.persistence.api.entity.task.SyncTask;
+import org.apache.syncope.server.provisioning.api.sync.SyncActions;
+
+public interface SyncJob extends ProvisioningJob<SyncTask, SyncActions> {
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/TaskJob.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/TaskJob.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/TaskJob.java
new file mode 100644
index 0000000..d264a43
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/job/TaskJob.java
@@ -0,0 +1,43 @@
+/*
+ * 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.server.provisioning.api.job;
+
+import org.quartz.DisallowConcurrentExecution;
+import org.quartz.Job;
+
+/**
+ * Interface for Quartz jobs bound to a given Task.
+ */
+@DisallowConcurrentExecution
+public interface TaskJob extends Job {
+
+ public static final String DRY_RUN_JOBDETAIL_KEY = "dryRun";
+
+ /**
+ * Task execution status.
+ */
+ public enum Status {
+
+ SUCCESS,
+ FAILURE
+
+ }
+
+ void setTaskId(Long taskId);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationActions.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationActions.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationActions.java
new file mode 100644
index 0000000..d7d7978
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationActions.java
@@ -0,0 +1,30 @@
+/*
+ * 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.server.provisioning.api.propagation;
+
+import org.apache.syncope.server.persistence.api.entity.task.PropagationTask;
+import org.apache.syncope.server.persistence.api.entity.task.TaskExec;
+import org.identityconnectors.framework.common.objects.ConnectorObject;
+
+public interface PropagationActions {
+
+ void before(PropagationTask task, ConnectorObject beforeObj);
+
+ void after(PropagationTask task, TaskExec execution, ConnectorObject afterObj);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationException.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationException.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationException.java
new file mode 100644
index 0000000..a60af8b
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationException.java
@@ -0,0 +1,51 @@
+/*
+ * 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.server.provisioning.api.propagation;
+
+/**
+ * Bear stacktrace received during propagation towards a certain resource.
+ */
+public class PropagationException extends RuntimeException {
+
+ private static final long serialVersionUID = -4828426289616526116L;
+
+ /**
+ * The resource involved in this exception.
+ */
+ private final String resourceName;
+
+ /**
+ * Create a new instance based on resource name and original stacktrace received during propagation.
+ *
+ * @param resourceName name of resource involved in this exception
+ * @param stackTrace original stacktrace
+ */
+ public PropagationException(final String resourceName, final String stackTrace) {
+ super("Exception during provision on resource " + resourceName + "\n" + stackTrace);
+
+ this.resourceName = resourceName;
+ }
+
+ /**
+ * @return name of resource involved in this exception
+ */
+ public String getResourceName() {
+ return resourceName;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationManager.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationManager.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationManager.java
new file mode 100644
index 0000000..444bfcc
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationManager.java
@@ -0,0 +1,249 @@
+/*
+ * 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.server.provisioning.api.propagation;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.apache.syncope.common.lib.mod.AttrMod;
+import org.apache.syncope.common.lib.mod.MembershipMod;
+import org.apache.syncope.common.lib.mod.UserMod;
+import org.apache.syncope.common.lib.to.AttrTO;
+import org.apache.syncope.common.lib.to.MembershipTO;
+import org.apache.syncope.common.lib.types.PropagationByResource;
+import org.apache.syncope.server.persistence.api.entity.Subject;
+import org.apache.syncope.server.persistence.api.entity.task.PropagationTask;
+import org.apache.syncope.server.persistence.api.entity.user.User;
+import org.apache.syncope.server.provisioning.api.WorkflowResult;
+
+public interface PropagationManager {
+
+ /**
+ * Create the role on every associated resource.
+ *
+ * @param wfResult user to be propagated (and info associated), as per result from workflow
+ * @param vAttrs virtual attributes to be set
+ * @return list of propagation tasks
+ */
+ List<PropagationTask> getRoleCreateTaskIds(WorkflowResult<Long> wfResult, List<AttrTO> vAttrs);
+
+ /**
+ * Create the role on every associated resource.
+ *
+ * @param wfResult role to be propagated (and info associated), as per result from workflow
+ * @param vAttrs virtual attributes to be set
+ * @param noPropResourceNames external resources performing not to be considered for propagation
+ * @return list of propagation tasks
+ */
+ List<PropagationTask> getRoleCreateTaskIds(
+ WorkflowResult<Long> wfResult, Collection<AttrTO> vAttrs, Collection<String> noPropResourceNames);
+
+ /**
+ * Create the role on every associated resource.
+ *
+ * @param key role id
+ * @param vAttrs virtual attributes to be set
+ * @param propByRes operation to be performed per resource
+ * @param noPropResourceNames external resources performing not to be considered for propagation
+ * @return list of propagation tasks
+ */
+ List<PropagationTask> getRoleCreateTaskIds(Long key, Collection<AttrTO> vAttrs, PropagationByResource propByRes,
+ Collection<String> noPropResourceNames);
+
+ /**
+ * Perform delete on each resource associated to the role. It is possible to ask for a mandatory provisioning for
+ * some resources specifying a set of resource names. Exceptions won't be ignored and the process will be stopped if
+ * the creation fails onto a mandatory resource.
+ *
+ * @param roleId to be deleted
+ * @return list of propagation tasks
+ */
+ List<PropagationTask> getRoleDeleteTaskIds(Long roleId);
+
+ /**
+ * Perform delete on each resource associated to the role. It is possible to ask for a mandatory provisioning for
+ * some resources specifying a set of resource names. Exceptions won't be ignored and the process will be stopped if
+ * the creation fails onto a mandatory resource.
+ *
+ * @param roleId to be deleted
+ * @param noPropResourceName name of external resource not to be considered for propagation
+ * @return list of propagation tasks
+ */
+ List<PropagationTask> getRoleDeleteTaskIds(Long roleId, String noPropResourceName);
+
+ /**
+ * Perform delete on each resource associated to the user. It is possible to ask for a mandatory provisioning for
+ * some resources specifying a set of resource names. Exceptions won't be ignored and the process will be stopped if
+ * the creation fails onto a mandatory resource.
+ *
+ * @param roleId to be deleted
+ * @param noPropResourceNames name of external resources not to be considered for propagation
+ * @return list of propagation tasks
+ */
+ List<PropagationTask> getRoleDeleteTaskIds(Long roleId, Collection<String> noPropResourceNames);
+
+ /**
+ * Perform delete on each resource associated to the user. It is possible to ask for a mandatory provisioning for
+ * some resources specifying a set of resource names. Exceptions won't be ignored and the process will be stopped if
+ * the creation fails onto a mandatory resource.
+ *
+ * @param roleId to be deleted
+ * @param noPropResourceNames name of external resources not to be considered for propagation
+ * @return list of propagation tasks
+ */
+ List<PropagationTask> getRoleDeleteTaskIds(
+ Long roleId, Set<String> resourceNames, Collection<String> noPropResourceNames);
+
+ /**
+ * Performs update on each resource associated to the role.
+ *
+ * @param wfResult role to be propagated (and info associated), as per result from workflow
+ * @param vAttrsToBeRemoved virtual attributes to be removed
+ * @param vAttrsToBeUpdated virtual attributes to be added
+ * @return list of propagation tasks
+ */
+ List<PropagationTask> getRoleUpdateTaskIds(WorkflowResult<Long> wfResult, Set<String> vAttrsToBeRemoved,
+ Set<AttrMod> vAttrsToBeUpdated);
+
+ /**
+ * Performs update on each resource associated to the role.
+ *
+ * @param wfResult role to be propagated (and info associated), as per result from workflow
+ * @param vAttrsToBeRemoved virtual attributes to be removed
+ * @param vAttrsToBeUpdated virtual attributes to be added
+ * @param noPropResourceNames external resource names not to be considered for propagation
+ * @return list of propagation tasks
+ */
+ List<PropagationTask> getRoleUpdateTaskIds(WorkflowResult<Long> wfResult, Set<String> vAttrsToBeRemoved,
+ Set<AttrMod> vAttrsToBeUpdated, Set<String> noPropResourceNames);
+
+ List<PropagationTask> getUpdateTaskIds(Subject<?, ?, ?> subject, String password, boolean changePwd,
+ Boolean enable, Set<String> vAttrsToBeRemoved, Set<AttrMod> vAttrsToBeUpdated,
+ PropagationByResource propByRes, Collection<String> noPropResourceNames,
+ Set<MembershipMod> membershipsToAdd);
+
+ /**
+ * Create the user on every associated resource.
+ *
+ * @param wfResult user to be propagated (and info associated), as per result from workflow
+ * @param password to be set
+ * @param vAttrs virtual attributes to be set
+ * @param membershipTOs user memberships
+ * @return list of propagation tasks
+ */
+ List<PropagationTask> getUserCreateTaskIds(WorkflowResult<Map.Entry<Long, Boolean>> wfResult,
+ String password, List<AttrTO> vAttrs, List<MembershipTO> membershipTOs);
+
+ /**
+ * Create the user on every associated resource.
+ *
+ * @param wfResult user to be propagated (and info associated), as per result from workflow
+ * @param password to be set
+ * @param vAttrs virtual attributes to be set
+ * @param noPropResourceNames external resources not to be considered for propagation
+ * @param membershipTOs user memberships
+ * @return list of propagation tasks
+ */
+ List<PropagationTask> getUserCreateTaskIds(WorkflowResult<Map.Entry<Long, Boolean>> wfResult,
+ String password, Collection<AttrTO> vAttrs, Set<String> noPropResourceNames,
+ List<MembershipTO> membershipTOs);
+
+ List<PropagationTask> getUserCreateTaskIds(Long key, Boolean enabled,
+ PropagationByResource propByRes, String password, Collection<AttrTO> vAttrs,
+ Collection<MembershipTO> membershipTOs, Collection<String> noPropResourceNames);
+
+ /**
+ * Perform delete on each resource associated to the user. It is possible to ask for a mandatory provisioning for
+ * some resources specifying a set of resource names. Exceptions won't be ignored and the process will be stopped if
+ * the creation fails onto a mandatory resource.
+ *
+ * @param userKey to be deleted
+ * @return list of propagation tasks
+ */
+ List<PropagationTask> getUserDeleteTaskIds(Long userKey);
+
+ /**
+ * Perform delete on each resource associated to the user. It is possible to ask for a mandatory provisioning for
+ * some resources specifying a set of resource names. Exceptions won't be ignored and the process will be stopped if
+ * the creation fails onto a mandatory resource.
+ *
+ * @param userKey to be deleted
+ * @param noPropResourceName name of external resource not to be considered for propagation
+ * @return list of propagation tasks
+ */
+ List<PropagationTask> getUserDeleteTaskIds(Long userKey, String noPropResourceName);
+
+ /**
+ * Perform delete on each resource associated to the user. It is possible to ask for a mandatory provisioning for
+ * some resources specifying a set of resource names. Exceptions won't be ignored and the process will be stopped if
+ * the creation fails onto a mandatory resource.
+ *
+ * @param userKey to be deleted
+ * @param noPropResourceNames name of external resources not to be considered for propagation
+ * @return list of propagation tasks
+ */
+ List<PropagationTask> getUserDeleteTaskIds(Long userKey, Collection<String> noPropResourceNames);
+
+ /**
+ * Perform delete on each resource associated to the user. It is possible to ask for a mandatory provisioning for
+ * some resources specifying a set of resource names. Exceptions won't be ignored and the process will be stopped if
+ * the creation fails onto a mandatory resource.
+ *
+ * @param userKey to be deleted
+ * @param noPropResourceNames name of external resources not to be considered for propagation
+ * @return list of propagation tasks
+ */
+ List<PropagationTask> getUserDeleteTaskIds(
+ Long userKey, Set<String> resourceNames, Collection<String> noPropResourceNames);
+
+ /**
+ * Perform delete on each resource associated to the user. It is possible to ask for a mandatory provisioning for
+ * some resources specifying a set of resource names. Exceptions won't be ignored and the process will be stopped if
+ * the creation fails onto a mandatory resource.
+ *
+ * @param wfResult user to be propagated (and info associated), as per result from workflow
+ * @return list of propagation tasks
+ */
+ List<PropagationTask> getUserDeleteTaskIds(WorkflowResult<Long> wfResult);
+
+ /**
+ * Performs update on each resource associated to the user excluding the specified into 'resourceNames' parameter.
+ *
+ * @param user to be propagated
+ * @param enable whether user must be enabled or not
+ * @param noPropResourceNames external resource names not to be considered for propagation
+ * @return list of propagation tasks
+ */
+ List<PropagationTask> getUserUpdateTaskIds(User user, Boolean enable, Set<String> noPropResourceNames);
+
+ /**
+ * Performs update on each resource associated to the user.
+ *
+ * @param wfResult user to be propagated (and info associated), as per result from workflow
+ * @param changePwd whether password should be included for propagation attributes or not
+ * @param noPropResourceNames external resources not to be considered for propagation
+ * @return list of propagation tasks
+ */
+ List<PropagationTask> getUserUpdateTaskIds(WorkflowResult<Map.Entry<UserMod, Boolean>> wfResult,
+ boolean changePwd, Collection<String> noPropResourceNames);
+
+ List<PropagationTask> getUserUpdateTaskIds(WorkflowResult<Map.Entry<UserMod, Boolean>> wfResult);
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationReporter.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationReporter.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationReporter.java
new file mode 100644
index 0000000..2434e38
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationReporter.java
@@ -0,0 +1,58 @@
+/*
+ * 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.server.provisioning.api.propagation;
+
+import java.util.List;
+import org.apache.syncope.common.lib.to.PropagationStatus;
+import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
+import org.apache.syncope.server.persistence.api.entity.task.PropagationTask;
+import org.identityconnectors.framework.common.objects.ConnectorObject;
+
+/**
+ * Report propagation status after executions.
+ */
+public interface PropagationReporter {
+
+ /**
+ * Report propagation status after executions in case of success or non-blocking failure
+ * (e.g. on secondary resources).
+ *
+ * @param resourceName resource name.
+ * @param execStatus propagation execution status.
+ * @param failureReason propagation execution failure message.
+ * @param beforeObj retrieved connector object before operation execution.
+ * @param afterObj retrieved connector object after operation execution.
+ */
+ void onSuccessOrSecondaryResourceFailures(String resourceName, PropagationTaskExecStatus execStatus,
+ String failureReason, ConnectorObject beforeObj, ConnectorObject afterObj);
+
+ /**
+ * Report propagation status after executions in case blocking failure (e.g. on primary resources).
+ *
+ * @param tasks propagation tasks performed before failure
+ */
+ void onPrimaryResourceFailure(List<PropagationTask> tasks);
+
+ /**
+ * Returns the list of propagation statuses.
+ *
+ * @return the list of propagation statuses
+ */
+ List<PropagationStatus> getStatuses();
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationTaskExecutor.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationTaskExecutor.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationTaskExecutor.java
new file mode 100644
index 0000000..967b711
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/propagation/PropagationTaskExecutor.java
@@ -0,0 +1,77 @@
+/*
+ * 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.server.provisioning.api.propagation;
+
+import java.util.Collection;
+import org.apache.syncope.server.persistence.api.entity.task.PropagationTask;
+import org.apache.syncope.server.persistence.api.entity.task.TaskExec;
+
+/**
+ * Execute propagation tasks.
+ *
+ * @see PropagationTask
+ */
+public interface PropagationTaskExecutor {
+
+ /**
+ * Name for special propagation attribute used to indicate whether there are attributes, marked as mandatory in the
+ * mapping but not to be propagated.
+ */
+ String MANDATORY_MISSING_ATTR_NAME = "__MANDATORY_MISSING__";
+
+ /**
+ * Name for special propagation attribute used to indicate whether there are attributes, marked as mandatory in the
+ * mapping but about to be propagated as null or empty.
+ */
+ String MANDATORY_NULL_OR_EMPTY_ATTR_NAME = "__MANDATORY_NULL_OR_EMPTY__";
+
+ /**
+ * Execute the given PropagationTask and returns the generated TaskExec.
+ *
+ * @param task to be executed
+ * @return the generated TaskExec
+ */
+ TaskExec execute(PropagationTask task);
+
+ /**
+ * Execute the given PropagationTask, invoke the given handler and returns the generated TaskExec.
+ *
+ * @param task to be executed
+ * @param reporter to report propagation execution status
+ * @return the generated TaskExec
+ */
+ TaskExec execute(PropagationTask task, PropagationReporter reporter);
+
+ /**
+ * Execute a collection of PropagationTask objects.
+ * The process is interrupted as soon as the result of the communication with a primary resource is in error.
+ *
+ * @param tasks to be executed
+ */
+ void execute(Collection<PropagationTask> tasks);
+
+ /**
+ * Execute a collection of PropagationTask objects and invoke the given handler on each of these.
+ * The process is interrupted as soon as the result of the communication with a primary resource is in error.
+ *
+ * @param tasks to be execute, in given order
+ * @param reporter to report propagation execution status
+ */
+ void execute(Collection<PropagationTask> tasks, PropagationReporter reporter);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/sync/ProvisioningActions.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/sync/ProvisioningActions.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/sync/ProvisioningActions.java
new file mode 100644
index 0000000..f7b1663
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/sync/ProvisioningActions.java
@@ -0,0 +1,43 @@
+/*
+ * 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.server.provisioning.api.sync;
+
+import java.util.List;
+import org.quartz.JobExecutionException;
+
+public interface ProvisioningActions {
+
+ /**
+ * Action to be executed before to start the synchronization task execution.
+ *
+ * @param profile sync profile
+ * @throws JobExecutionException in case of generic failure
+ */
+ void beforeAll(final ProvisioningProfile<?, ?> profile) throws JobExecutionException;
+
+ /**
+ * Action to be executed after the synchronization task completion.
+ *
+ * @param profile sync profile
+ * @param results synchronization result
+ * @throws JobExecutionException in case of generic failure
+ */
+ void afterAll(final ProvisioningProfile<?, ?> profile, final List<ProvisioningResult> results)
+ throws JobExecutionException;
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/sync/ProvisioningProfile.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/sync/ProvisioningProfile.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/sync/ProvisioningProfile.java
new file mode 100644
index 0000000..cac75c3
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/sync/ProvisioningProfile.java
@@ -0,0 +1,81 @@
+/*
+ * 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.server.provisioning.api.sync;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.apache.syncope.common.lib.types.ConflictResolutionAction;
+import org.apache.syncope.server.persistence.api.entity.task.ProvisioningTask;
+import org.apache.syncope.server.provisioning.api.Connector;
+
+public class ProvisioningProfile<T extends ProvisioningTask, A extends ProvisioningActions> {
+
+ /**
+ * Syncing connector.
+ */
+ private final Connector connector;
+
+ private final T task;
+
+ private final List<ProvisioningResult> results = new ArrayList<>();
+
+ private boolean dryRun;
+
+ private ConflictResolutionAction resAct;
+
+ private List<A> actions = new ArrayList<>();
+
+ public ProvisioningProfile(final Connector connector, final T task) {
+ this.connector = connector;
+ this.task = task;
+ }
+
+ public Connector getConnector() {
+ return connector;
+ }
+
+ public T getTask() {
+ return task;
+ }
+
+ public Collection<ProvisioningResult> getResults() {
+ return results;
+ }
+
+ public boolean isDryRun() {
+ return dryRun;
+ }
+
+ public void setDryRun(final boolean dryRun) {
+ this.dryRun = dryRun;
+ }
+
+ public ConflictResolutionAction getResAct() {
+ return resAct;
+ }
+
+ public void setResAct(final ConflictResolutionAction resAct) {
+ this.resAct = resAct;
+ }
+
+ public List<A> getActions() {
+ return actions;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/sync/ProvisioningResult.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/sync/ProvisioningResult.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/sync/ProvisioningResult.java
new file mode 100644
index 0000000..eb4e92d
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/sync/ProvisioningResult.java
@@ -0,0 +1,140 @@
+/*
+ * 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.server.provisioning.api.sync;
+
+import java.util.Collection;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.ResourceOperation;
+import org.apache.syncope.common.lib.types.TraceLevel;
+
+public class ProvisioningResult {
+
+ public enum Status {
+
+ SUCCESS,
+ FAILURE
+
+ }
+
+ private String message;
+
+ private Status status;
+
+ private AttributableType subjectType;
+
+ private ResourceOperation operation;
+
+ private Long id;
+
+ private String name;
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(final String message) {
+ this.message = message;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(final Long id) {
+ this.id = id;
+ }
+
+ public Status getStatus() {
+ return status;
+ }
+
+ public void setStatus(final Status status) {
+ this.status = status;
+ }
+
+ public AttributableType getSubjectType() {
+ return subjectType;
+ }
+
+ public void setSubjectType(final AttributableType subjectType) {
+ this.subjectType = subjectType;
+ }
+
+ public ResourceOperation getOperation() {
+ return operation;
+ }
+
+ public void setOperation(final ResourceOperation operation) {
+ this.operation = operation;
+ }
+
+ @Override
+ public String toString() {
+ return new ReflectionToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).toString();
+ }
+
+ /**
+ * Human readable report string, using the given trace level.
+ *
+ * @param level trace level
+ * @return String for certain levels, null for level NONE
+ */
+ public String getReportString(final TraceLevel level) {
+ if (level == TraceLevel.SUMMARY) {
+ // No per entry log in this case.
+ return null;
+ } else if (level == TraceLevel.FAILURES && status == Status.FAILURE) {
+ // only report failures
+ return String.format("Failed %s (id/name): %d/%s with message: %s", operation, id, name, message);
+ } else {
+ // All
+ return String.format("%s %s (id/name): %d/%s %s", operation, status, id, name,
+ StringUtils.isBlank(message)
+ ? ""
+ : "with message: " + message);
+ }
+ }
+
+ /**
+ * Helper method to invoke logging per synchronization result for the given trace level.
+ *
+ * @param results synchronization result
+ * @param level trace level
+ * @return report as string
+ */
+ public static String produceReport(final Collection<ProvisioningResult> results, final TraceLevel level) {
+ StringBuilder sb = new StringBuilder();
+ for (ProvisioningResult result : results) {
+ sb.append(result.getReportString(level)).append("\n");
+ }
+ return sb.toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/sync/PushActions.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/sync/PushActions.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/sync/PushActions.java
new file mode 100644
index 0000000..ab698ff
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/sync/PushActions.java
@@ -0,0 +1,137 @@
+/*
+ * 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.server.provisioning.api.sync;
+
+import org.apache.syncope.server.persistence.api.entity.Subject;
+import org.quartz.JobExecutionException;
+
+/**
+ * Interface for actions to be performed during PushJob execution.
+ */
+public interface PushActions extends ProvisioningActions {
+
+ /**
+ * Action to be executed before to assign (link & provision) a synchronized user / role to the resource.
+ *
+ * @param profile profile of the synchronization being executed.
+ * @param subject user / role to be created.
+ * @return subject.
+ * @throws JobExecutionException in case of generic failure
+ */
+ <T extends Subject<?, ?, ?>> T beforeAssign(
+ final ProvisioningProfile<?, ?> profile,
+ final T subject) throws JobExecutionException;
+
+ /**
+ * Action to be executed before to provision a synchronized user / role to the resource.
+ *
+ * @param profile profile of the synchronization being executed.
+ * @param subject user / role to be created.
+ * @return subject.
+ * @throws JobExecutionException in case of generic failure
+ */
+ <T extends Subject<?, ?, ?>> T beforeProvision(
+ final ProvisioningProfile<?, ?> profile,
+ final T subject) throws JobExecutionException;
+
+ /**
+ * Action to be executed before to update a synchronized user / role on the resource.
+ *
+ * @param profile profile of the synchronization being executed.
+ * @param subject user / role to be updated.
+ * @return subject.
+ * @throws JobExecutionException in case of generic failure
+ */
+ <T extends Subject<?, ?, ?>> T beforeUpdate(
+ final ProvisioningProfile<?, ?> profile,
+ final T subject) throws JobExecutionException;
+
+ /**
+ * Action to be executed before to link a synchronized user / role to the resource.
+ *
+ * @param profile profile of the synchronization being executed.
+ * @param subject user / role to be created.
+ * @return subject.
+ * @throws JobExecutionException in case of generic failure
+ */
+ <T extends Subject<?, ?, ?>> T beforeLink(
+ final ProvisioningProfile<?, ?> profile,
+ final T subject) throws JobExecutionException;
+
+ /**
+ * Action to be executed before to unlink a synchronized user / role from the resource.
+ *
+ * @param profile profile of the synchronization being executed.
+ * @param subject user / role to be created.
+ * @return subject.
+ * @throws JobExecutionException in case of generic failure
+ */
+ <T extends Subject<?, ?, ?>> T beforeUnlink(
+ final ProvisioningProfile<?, ?> profile,
+ final T subject) throws JobExecutionException;
+
+ /**
+ * Action to be executed before to unassign a synchronized user / role from the resource.
+ *
+ * @param profile profile of the synchronization being executed.
+ * @param subject user / role to be created.
+ * @return subject.
+ * @throws JobExecutionException in case of generic failure
+ */
+ <T extends Subject<?, ?, ?>> T beforeUnassign(
+ final ProvisioningProfile<?, ?> profile,
+ final T subject) throws JobExecutionException;
+
+ /**
+ * Action to be executed before to unassign a synchronized user / role from the resource.
+ *
+ * @param profile profile of the synchronization being executed.
+ * @param subject user / role to be created.
+ * @return subject.
+ * @throws JobExecutionException in case of generic failure
+ */
+ <T extends Subject<?, ?, ?>> T beforeDeprovision(
+ final ProvisioningProfile<?, ?> profile,
+ final T subject) throws JobExecutionException;
+
+ /**
+ * Action to be executed before delete a synchronized user / role locally and from the resource.
+ *
+ * @param profile profile of the synchronization being executed.
+ * @param subject user / role to be created.
+ * @return subject.
+ * @throws JobExecutionException in case of generic failure
+ */
+ <T extends Subject<?, ?, ?>> T beforeDelete(
+ final ProvisioningProfile<?, ?> profile,
+ final T subject) throws JobExecutionException;
+
+ /**
+ * Action to be executed after each local user / role synchronization.
+ *
+ * @param profile profile of the synchronization being executed.
+ * @param subject synchronized user / role.
+ * @param result operation result.
+ * @throws JobExecutionException in case of generic failure
+ */
+ <T extends Subject<?, ?, ?>> void after(
+ final ProvisioningProfile<?, ?> profile,
+ final T subject,
+ final ProvisioningResult result) throws JobExecutionException;
+}