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 2014/12/23 17:56:57 UTC

[1/6] syncope git commit: Setting version to 2.0.0-SNAPSHOT

Repository: syncope
Updated Branches:
  refs/heads/2_0_X [created] c73a73b09


Setting version to 2.0.0-SNAPSHOT


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

Branch: refs/heads/2_0_X
Commit: 91352e515bb71f09cc85560006be0abb3052d78a
Parents: 86cbfe4
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Mon Dec 22 16:12:09 2014 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Mon Dec 22 16:12:09 2014 +0100

----------------------------------------------------------------------
 archetype/pom.xml     |  2 +-
 build-tools/pom.xml   |  2 +-
 client/pom.xml        |  2 +-
 common/pom.xml        |  2 +-
 console/pom.xml       | 11 ++++-------
 core-upgrader/pom.xml |  2 +-
 core/pom.xml          |  2 +-
 deb/console/pom.xml   |  2 +-
 deb/core/pom.xml      |  2 +-
 deb/pom.xml           |  2 +-
 installer/pom.xml     |  2 +-
 pom.xml               |  2 +-
 standalone/pom.xml    |  2 +-
 13 files changed, 16 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/91352e51/archetype/pom.xml
----------------------------------------------------------------------
diff --git a/archetype/pom.xml b/archetype/pom.xml
index 5edddbc..905e45b 100644
--- a/archetype/pom.xml
+++ b/archetype/pom.xml
@@ -24,7 +24,7 @@ under the License.
   <parent>
     <groupId>org.apache.syncope</groupId>
     <artifactId>syncope</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
 
   <name>Apache Syncope Archetype</name>

http://git-wip-us.apache.org/repos/asf/syncope/blob/91352e51/build-tools/pom.xml
----------------------------------------------------------------------
diff --git a/build-tools/pom.xml b/build-tools/pom.xml
index dbd4ed3..1ea51ce 100644
--- a/build-tools/pom.xml
+++ b/build-tools/pom.xml
@@ -24,7 +24,7 @@ under the License.
   <parent>
     <groupId>org.apache.syncope</groupId>
     <artifactId>syncope</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
 
   <name>Apache Syncope Build Tools</name>

http://git-wip-us.apache.org/repos/asf/syncope/blob/91352e51/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index b0ea6ed..f618315 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -24,7 +24,7 @@ under the License.
   <parent>
     <groupId>org.apache.syncope</groupId>
     <artifactId>syncope</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
 
   <name>Apache Syncope Client</name>

http://git-wip-us.apache.org/repos/asf/syncope/blob/91352e51/common/pom.xml
----------------------------------------------------------------------
diff --git a/common/pom.xml b/common/pom.xml
index 46c9eee..de1f31e 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -24,7 +24,7 @@ under the License.
   <parent>
     <groupId>org.apache.syncope</groupId>
     <artifactId>syncope</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
 
   <name>Apache Syncope Common</name>

http://git-wip-us.apache.org/repos/asf/syncope/blob/91352e51/console/pom.xml
----------------------------------------------------------------------
diff --git a/console/pom.xml b/console/pom.xml
index 5fddb31..5444b94 100644
--- a/console/pom.xml
+++ b/console/pom.xml
@@ -24,7 +24,7 @@ under the License.
   <parent>
     <groupId>org.apache.syncope</groupId>
     <artifactId>syncope</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
 
   <name>Apache Syncope Console</name>
@@ -213,8 +213,7 @@ under the License.
             <phase>process-resources</phase>
             <configuration>
               <target>
-                <unzip src="${settings.localRepository}/org/activiti/activiti-webapp-explorer2/${activiti.version}/activiti-webapp-explorer2-${activiti.version}.war" 
-                       dest="${project.build.directory}/activiti-webapp-explorer2" />
+                <unzip src="${settings.localRepository}/org/activiti/activiti-webapp-explorer2/${activiti.version}/activiti-webapp-explorer2-${activiti.version}.war" dest="${project.build.directory}/activiti-webapp-explorer2" />
                 
                 <mkdir dir="${activiti-modeler.directory}" />
                 
@@ -224,10 +223,8 @@ under the License.
                     <exclude name="oryx.js" />
                   </fileset>
                 </copy>
-                <copy file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/plugins.xml" 
-                      todir="${activiti-modeler.directory}/editor" />
-                <copy file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/stencilset.json" 
-                      todir="${activiti-modeler.directory}/editor" />
+                <copy file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/plugins.xml" todir="${activiti-modeler.directory}/editor" />
+                <copy file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/stencilset.json" todir="${activiti-modeler.directory}/editor" />
                 
                 <mkdir dir="${activiti-modeler.directory}/explorer" />
                 <copy todir="${activiti-modeler.directory}/explorer">

http://git-wip-us.apache.org/repos/asf/syncope/blob/91352e51/core-upgrader/pom.xml
----------------------------------------------------------------------
diff --git a/core-upgrader/pom.xml b/core-upgrader/pom.xml
index 1be5ba4..a728761 100644
--- a/core-upgrader/pom.xml
+++ b/core-upgrader/pom.xml
@@ -23,7 +23,7 @@ under the License.
   <parent>
     <groupId>org.apache.syncope</groupId>
     <artifactId>syncope</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
  
   <groupId>org.apache.syncope</groupId>

http://git-wip-us.apache.org/repos/asf/syncope/blob/91352e51/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index d9ab5a6..7cc63e5 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -24,7 +24,7 @@ under the License.
   <parent>
     <groupId>org.apache.syncope</groupId>
     <artifactId>syncope</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
 
   <name>Apache Syncope Core</name>

http://git-wip-us.apache.org/repos/asf/syncope/blob/91352e51/deb/console/pom.xml
----------------------------------------------------------------------
diff --git a/deb/console/pom.xml b/deb/console/pom.xml
index c5229d2..84812da 100644
--- a/deb/console/pom.xml
+++ b/deb/console/pom.xml
@@ -24,7 +24,7 @@ under the License.
   <parent>
     <groupId>org.apache.syncope</groupId>
     <artifactId>syncope-deb</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
 
   <name>Apache Syncope Deb Console</name>

http://git-wip-us.apache.org/repos/asf/syncope/blob/91352e51/deb/core/pom.xml
----------------------------------------------------------------------
diff --git a/deb/core/pom.xml b/deb/core/pom.xml
index c84f297..5fd3602 100644
--- a/deb/core/pom.xml
+++ b/deb/core/pom.xml
@@ -24,7 +24,7 @@ under the License.
   <parent>
     <groupId>org.apache.syncope</groupId>
     <artifactId>syncope-deb</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
 
   <name>Apache Syncope Deb Core</name>

http://git-wip-us.apache.org/repos/asf/syncope/blob/91352e51/deb/pom.xml
----------------------------------------------------------------------
diff --git a/deb/pom.xml b/deb/pom.xml
index be5f8f3..f11ba9f 100644
--- a/deb/pom.xml
+++ b/deb/pom.xml
@@ -24,7 +24,7 @@ under the License.
   <parent>
     <groupId>org.apache.syncope</groupId>
     <artifactId>syncope</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
 
   <name>Apache Syncope Deb</name>

http://git-wip-us.apache.org/repos/asf/syncope/blob/91352e51/installer/pom.xml
----------------------------------------------------------------------
diff --git a/installer/pom.xml b/installer/pom.xml
index 888d563..96b6689 100644
--- a/installer/pom.xml
+++ b/installer/pom.xml
@@ -24,7 +24,7 @@ under the License.
   <parent>
     <groupId>org.apache.syncope</groupId>
     <artifactId>syncope</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
 
   <name>Apache Syncope Installer</name>

http://git-wip-us.apache.org/repos/asf/syncope/blob/91352e51/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index be705ca..a2ff5d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,7 @@ under the License.
 
   <groupId>org.apache.syncope</groupId>
   <artifactId>syncope</artifactId>
-  <version>1.3.0-SNAPSHOT</version>
+  <version>2.0.0-SNAPSHOT</version>
   <packaging>pom</packaging>
 
   <parent>

http://git-wip-us.apache.org/repos/asf/syncope/blob/91352e51/standalone/pom.xml
----------------------------------------------------------------------
diff --git a/standalone/pom.xml b/standalone/pom.xml
index 5ae5e1b..e83e6de 100644
--- a/standalone/pom.xml
+++ b/standalone/pom.xml
@@ -24,7 +24,7 @@ under the License.
   <parent>
     <groupId>org.apache.syncope</groupId>
     <artifactId>syncope</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>2.0.0-SNAPSHOT</version>
   </parent>
 
   <name>Apache Syncope Standalone Distribution</name>


[4/6] syncope git commit: [SYNCOPE-620] persistence-api and common-lib

Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/OrderByClause.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/OrderByClause.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/OrderByClause.java
new file mode 100644
index 0000000..854f75e
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/OrderByClause.java
@@ -0,0 +1,69 @@
+/*
+ * 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.persistence.api.dao.search;
+
+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;
+
+public class OrderByClause {
+
+    public enum Direction {
+
+        ASC,
+        DESC
+
+    }
+
+    private String field;
+
+    private Direction direction;
+
+    public String getField() {
+        return field;
+    }
+
+    public void setField(final String field) {
+        this.field = field;
+    }
+
+    public Direction getDirection() {
+        return direction == null ? Direction.ASC : direction;
+    }
+
+    public void setDirection(final Direction direction) {
+        this.direction = direction;
+    }
+
+    @Override
+    public boolean equals(final Object obj) {
+        return EqualsBuilder.reflectionEquals(this, obj);
+    }
+
+    @Override
+    public int hashCode() {
+        return HashCodeBuilder.reflectionHashCode(this);
+    }
+
+    @Override
+    public String toString() {
+        return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/ResourceCond.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/ResourceCond.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/ResourceCond.java
new file mode 100644
index 0000000..fb2a08c
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/ResourceCond.java
@@ -0,0 +1,42 @@
+/*
+ * 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.persistence.api.dao.search;
+
+/**
+ * Search condition to be applied when searching for associated resources.
+ */
+public class ResourceCond extends AbstractSearchCond {
+
+    private static final long serialVersionUID = 466054166309460002L;
+
+    private String resourceName;
+
+    public String getResourceName() {
+        return resourceName;
+    }
+
+    public void setResourceName(final String resourceName) {
+        this.resourceName = resourceName;
+    }
+
+    @Override
+    public final boolean isValid() {
+        return resourceName != null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/SearchCond.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/SearchCond.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/SearchCond.java
new file mode 100644
index 0000000..3e9a591
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/SearchCond.java
@@ -0,0 +1,254 @@
+/*
+ * 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.persistence.api.dao.search;
+
+import java.util.List;
+
+public class SearchCond extends AbstractSearchCond {
+
+    private static final long serialVersionUID = 661560782247499526L;
+
+    public enum Type {
+
+        LEAF,
+        NOT_LEAF,
+        AND,
+        OR
+
+    }
+
+    private Type type;
+
+    private SubjectCond subjectCond;
+
+    private AttributeCond attributeCond;
+
+    private MembershipCond membershipCond;
+
+    private ResourceCond resourceCond;
+
+    private EntitlementCond entitlementCond;
+
+    private SearchCond leftNodeCond;
+
+    private SearchCond rightNodeCond;
+
+    public static SearchCond getLeafCond(final AttributeCond attributeCond) {
+        SearchCond nodeCond = new SearchCond();
+
+        nodeCond.type = Type.LEAF;
+        if (attributeCond instanceof SubjectCond) {
+            nodeCond.subjectCond = (SubjectCond) attributeCond;
+        } else {
+            nodeCond.attributeCond = attributeCond;
+        }
+
+        return nodeCond;
+    }
+
+    public static SearchCond getLeafCond(final MembershipCond membershipCond) {
+        SearchCond nodeCond = new SearchCond();
+
+        nodeCond.type = Type.LEAF;
+        nodeCond.membershipCond = membershipCond;
+
+        return nodeCond;
+    }
+
+    public static SearchCond getLeafCond(final ResourceCond resourceCond) {
+        SearchCond nodeCond = new SearchCond();
+
+        nodeCond.type = Type.LEAF;
+        nodeCond.resourceCond = resourceCond;
+
+        return nodeCond;
+    }
+
+    public static SearchCond getLeafCond(final EntitlementCond entitlementCond) {
+        SearchCond nodeCond = new SearchCond();
+
+        nodeCond.type = Type.LEAF;
+        nodeCond.entitlementCond = entitlementCond;
+
+        return nodeCond;
+    }
+
+    public static SearchCond getNotLeafCond(final AttributeCond attributeCond) {
+        SearchCond nodeCond = getLeafCond(attributeCond);
+        nodeCond.type = Type.NOT_LEAF;
+        return nodeCond;
+    }
+
+    public static SearchCond getNotLeafCond(final MembershipCond membershipCond) {
+        SearchCond nodeCond = getLeafCond(membershipCond);
+        nodeCond.type = Type.NOT_LEAF;
+        return nodeCond;
+    }
+
+    public static SearchCond getNotLeafCond(final ResourceCond resourceCond) {
+        SearchCond nodeCond = getLeafCond(resourceCond);
+        nodeCond.type = Type.NOT_LEAF;
+        return nodeCond;
+    }
+
+    public static SearchCond getNotLeafCond(final EntitlementCond entitlementCond) {
+        SearchCond nodeCond = getLeafCond(entitlementCond);
+        nodeCond.type = Type.NOT_LEAF;
+        return nodeCond;
+    }
+
+    public static SearchCond getNotLeafCond(final SearchCond nodeCond) {
+        nodeCond.type = Type.NOT_LEAF;
+        return nodeCond;
+    }
+
+    public static SearchCond getAndCond(final SearchCond leftCond, final SearchCond rightCond) {
+        SearchCond nodeCond = new SearchCond();
+
+        nodeCond.type = Type.AND;
+        nodeCond.leftNodeCond = leftCond;
+        nodeCond.rightNodeCond = rightCond;
+
+        return nodeCond;
+    }
+
+    public static SearchCond getAndCond(final List<SearchCond> conditions) {
+        if (conditions.size() > 2) {
+            SearchCond removed = conditions.remove(0);
+            return getAndCond(removed, getAndCond(conditions));
+        } else {
+            return getAndCond(conditions.get(0), conditions.get(1));
+        }
+    }
+
+    public static SearchCond getOrCond(final SearchCond leftCond, final SearchCond rightCond) {
+        SearchCond nodeCond = new SearchCond();
+
+        nodeCond.type = Type.OR;
+        nodeCond.leftNodeCond = leftCond;
+        nodeCond.rightNodeCond = rightCond;
+
+        return nodeCond;
+    }
+
+    public static SearchCond getOrCond(final List<SearchCond> conditions) {
+        if (conditions.size() > 2) {
+            SearchCond removed = conditions.remove(0);
+            return getOrCond(removed, getOrCond(conditions));
+        } else {
+            return getOrCond(conditions.get(0), conditions.get(1));
+        }
+    }
+
+    public SubjectCond getSubjectCond() {
+        return subjectCond;
+    }
+
+    public void setSubjectCond(final SubjectCond subjectCond) {
+        this.subjectCond = subjectCond;
+    }
+
+    public AttributeCond getAttributeCond() {
+        return attributeCond;
+    }
+
+    public void setAttributeCond(final AttributeCond attributeCond) {
+        this.attributeCond = attributeCond;
+    }
+
+    public MembershipCond getMembershipCond() {
+        return membershipCond;
+    }
+
+    public void setMembershipCond(final MembershipCond membershipCond) {
+        this.membershipCond = membershipCond;
+    }
+
+    public ResourceCond getResourceCond() {
+        return resourceCond;
+    }
+
+    public void setResourceCond(final ResourceCond resourceCond) {
+        this.resourceCond = resourceCond;
+    }
+
+    public EntitlementCond getEntitlementCond() {
+        return entitlementCond;
+    }
+
+    public void setEntitlementCond(final EntitlementCond entitlementCond) {
+        this.entitlementCond = entitlementCond;
+    }
+
+    public SearchCond getLeftNodeCond() {
+        return leftNodeCond;
+    }
+
+    public void setLeftNodeCond(final SearchCond leftNodeCond) {
+        this.leftNodeCond = leftNodeCond;
+    }
+
+    public SearchCond getRightNodeCond() {
+        return rightNodeCond;
+    }
+
+    public void setRightNodeCond(final SearchCond rightNodeCond) {
+        this.rightNodeCond = rightNodeCond;
+    }
+
+    public Type getType() {
+        return type;
+    }
+
+    public void setType(final Type type) {
+        this.type = type;
+    }
+
+    public boolean isValid() {
+        boolean isValid = false;
+
+        if (type == null) {
+            return isValid;
+        }
+
+        switch (type) {
+            case LEAF:
+            case NOT_LEAF:
+                isValid = (subjectCond != null || attributeCond != null || membershipCond != null
+                        || resourceCond != null || entitlementCond != null)
+                        && (subjectCond == null || subjectCond.isValid())
+                        && (attributeCond == null || attributeCond.isValid())
+                        && (membershipCond == null || membershipCond.isValid())
+                        && (resourceCond == null || resourceCond.isValid())
+                        && (entitlementCond == null || entitlementCond.isValid());
+                break;
+
+            case AND:
+            case OR:
+                isValid = (leftNodeCond == null || rightNodeCond == null)
+                        ? false
+                        : leftNodeCond.isValid() && rightNodeCond.isValid();
+                break;
+
+            default:
+        }
+
+        return isValid;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/SubjectCond.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/SubjectCond.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/SubjectCond.java
new file mode 100644
index 0000000..c20b83a
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/SubjectCond.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.persistence.api.dao.search;
+
+/**
+ * Search condition to be applied when comparing bean field values.
+ */
+public class SubjectCond extends AttributeCond {
+
+    private static final long serialVersionUID = -1880319220462653955L;
+
+    public SubjectCond() {
+    }
+
+    public SubjectCond(final Type conditionType) {
+        super(conditionType);
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/validation/InvalidEntityException.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/validation/InvalidEntityException.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/validation/InvalidEntityException.java
new file mode 100644
index 0000000..1961173
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/validation/InvalidEntityException.java
@@ -0,0 +1,129 @@
+/*
+ * 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.persistence.api.dao.validation;
+
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import javax.validation.ConstraintViolation;
+import javax.validation.ValidationException;
+import org.apache.syncope.common.lib.types.EntityViolationType;
+
+/**
+ * Exception thrown when any JPA entity fails bean validation.
+ */
+public class InvalidEntityException extends ValidationException {
+
+    private static final long serialVersionUID = 3249297275444409691L;
+
+    private final String entityClassSimpleName;
+
+    private final Map<Class<?>, Set<EntityViolationType>> violations = new HashMap<>();
+
+    /**
+     * Constructs a singleton map of violations from given parameters.
+     *
+     * @param entityClass class of invalid entity
+     * @param entityViolationType type of violation found
+     * @param message message to be associated to the violation
+     */
+    public InvalidEntityException(final Class<?> entityClass,
+            final EntityViolationType entityViolationType, final String message) {
+
+        super();
+
+        this.entityClassSimpleName = entityClass.getSimpleName();
+
+        entityViolationType.setMessage(message.trim());
+
+        this.violations.put(entityClass, EnumSet.noneOf(EntityViolationType.class));
+        this.violations.get(entityClass).add(entityViolationType);
+    }
+
+    /**
+     * Constructs a map of violations out of given <tt>ConstraintViolation</tt> set.
+     *
+     * @param entityClassSimpleName simple class name of invalid entity
+     * @param violations as returned by bean validation
+     */
+    public InvalidEntityException(final String entityClassSimpleName,
+            final Set<ConstraintViolation<Object>> violations) {
+
+        super();
+
+        this.entityClassSimpleName = entityClassSimpleName;
+
+        for (ConstraintViolation<Object> violation : violations) {
+            int firstComma = violation.getMessageTemplate().indexOf(';');
+
+            final String key = violation.getMessageTemplate().substring(
+                    0, firstComma > 0 ? firstComma : violation.getMessageTemplate().length());
+
+            final String message = violation.getMessageTemplate().substring(firstComma > 0 ? firstComma + 1 : 0);
+
+            EntityViolationType entityViolationType;
+
+            try {
+                entityViolationType = EntityViolationType.valueOf(key.trim());
+            } catch (IllegalArgumentException e) {
+                entityViolationType = EntityViolationType.Standard;
+            }
+
+            entityViolationType.setMessage(message.trim());
+
+            if (!this.violations.containsKey(violation.getLeafBean().getClass())) {
+                this.violations.put(violation.getLeafBean().getClass(), EnumSet.noneOf(EntityViolationType.class));
+            }
+
+            this.violations.get(violation.getLeafBean().getClass()).add(entityViolationType);
+        }
+    }
+
+    public final boolean hasViolation(final EntityViolationType type) {
+        boolean found = false;
+        for (Class<?> entity : violations.keySet()) {
+            if (violations.get(entity).contains(type)) {
+                found = true;
+            }
+        }
+
+        return found;
+    }
+
+    public String getEntityClassSimpleName() {
+        return entityClassSimpleName;
+    }
+
+    public final Map<Class<?>, Set<EntityViolationType>> getViolations() {
+        return violations;
+    }
+
+    @Override
+    public String getMessage() {
+        StringBuilder sb = new StringBuilder();
+
+        for (Class<?> entity : violations.keySet()) {
+            sb.append(entity.getSimpleName()).append(" ").append(violations.get(entity).toString()).append(", ");
+        }
+        sb.delete(sb.lastIndexOf(", "), sb.length());
+
+        return sb.toString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/validation/InvalidNormAttrValueException.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/validation/InvalidNormAttrValueException.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/validation/InvalidNormAttrValueException.java
new file mode 100644
index 0000000..6afcd13
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/validation/InvalidNormAttrValueException.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.persistence.api.dao.validation;
+
+import javax.validation.ValidationException;
+import org.apache.syncope.persistence.api.entity.NormAttrValue;
+
+public class InvalidNormAttrValueException extends ValidationException {
+
+    private static final long serialVersionUID = -5023202610580202148L;
+
+    public InvalidNormAttrValueException(final String errorMessage) {
+        super(errorMessage);
+    }
+
+    public InvalidNormAttrValueException(final String errorMessage, final Throwable cause) {
+        super(errorMessage, cause);
+    }
+
+    public InvalidNormAttrValueException(final NormAttrValue value) {
+        this("Could not validate " + value.getValue());
+    }
+
+    public InvalidNormAttrValueException(final NormAttrValue value, Throwable cause) {
+        this("Could not validate " + value.getValue(), cause);
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/validation/ParsingValidationException.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/validation/ParsingValidationException.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/validation/ParsingValidationException.java
new file mode 100644
index 0000000..056bfb9
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/validation/ParsingValidationException.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.persistence.api.dao.validation;
+
+import javax.validation.ValidationException;
+
+public class ParsingValidationException extends ValidationException {
+
+    private static final long serialVersionUID = 5669262895008285522L;
+
+    public ParsingValidationException(final String message, final Throwable cause) {
+        super(message, cause);
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/validation/Validator.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/validation/Validator.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/validation/Validator.java
new file mode 100644
index 0000000..3d439a7
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/validation/Validator.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.persistence.api.dao.validation;
+
+import org.apache.syncope.persistence.api.entity.NormAttrValue;
+
+public interface Validator {
+
+    void validate(String value, NormAttrValue attrValue) throws ParsingValidationException, InvalidNormAttrValueException;
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/AccountPolicy.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/AccountPolicy.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/AccountPolicy.java
new file mode 100644
index 0000000..2570f20
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/AccountPolicy.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.persistence.api.entity;
+
+import java.util.Collection;
+import java.util.Set;
+
+public interface AccountPolicy extends Policy {
+
+    Set<String> getResourceNames();
+
+    Set<ExternalResource> getResources();
+
+    boolean addResource(ExternalResource resource);
+
+    boolean removeResource(ExternalResource resource);
+
+    void setResources(Collection<ExternalResource> resources);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/AnnotatedEntity.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/AnnotatedEntity.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/AnnotatedEntity.java
new file mode 100644
index 0000000..80a610d
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/AnnotatedEntity.java
@@ -0,0 +1,40 @@
+/*
+ * 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.persistence.api.entity;
+
+import java.util.Date;
+
+public interface AnnotatedEntity<KEY> extends Entity<KEY> {
+
+    Date getCreationDate();
+
+    String getCreator();
+
+    Date getLastChangeDate();
+
+    String getLastModifier();
+
+    void setCreationDate(Date creationDate);
+
+    void setCreator(String creator);
+
+    void setLastChangeDate(Date lastChangeDate);
+
+    void setLastModifier(String lastModifier);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Attr.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Attr.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Attr.java
new file mode 100644
index 0000000..7a54213
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Attr.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.persistence.api.entity;
+
+public interface Attr<S extends Schema> extends Entity<Long> {
+
+    Attributable<?, ?, ?> getOwner();
+
+    void setOwner(Attributable<?, ?, ?> owner);
+
+    S getSchema();
+    
+    void setSchema(S schema);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/AttrTemplate.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/AttrTemplate.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/AttrTemplate.java
new file mode 100644
index 0000000..0055b69
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/AttrTemplate.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.persistence.api.entity;
+
+import org.apache.syncope.persistence.api.entity.role.Role;
+
+public interface AttrTemplate<T extends Schema> extends Entity<Long> {
+
+    Role getOwner();
+
+    void setOwner(Role role);
+
+    T getSchema();
+
+    void setSchema(T schema);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Attributable.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Attributable.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Attributable.java
new file mode 100644
index 0000000..31eb9a4
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Attributable.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.persistence.api.entity;
+
+import java.util.List;
+
+public interface Attributable<N extends NormAttr, D extends DerAttr, V extends VirAttr> extends AnnotatedEntity<Long> {
+
+    boolean addNormAttr(N attr);
+
+    boolean addDerAttr(D attr);
+
+    boolean addVirAttr(V attr);
+
+    N getNormAttr(String normSchemaName);
+
+    List<N> getNormAttrs();
+
+    D getDerAttr(String derSchemaName);
+
+    List<D> getDerAttrs();
+
+    V getVirAttr(String virSchemaName);
+
+    List<V> getVirAttrs();
+
+    boolean removeNormAttr(N attr);
+
+    boolean removeDerAttr(D derAttr);
+
+    boolean removeVirAttr(V virAttr);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/AttributableUtil.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/AttributableUtil.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/AttributableUtil.java
new file mode 100644
index 0000000..58205fd
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/AttributableUtil.java
@@ -0,0 +1,85 @@
+/*
+ * 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.persistence.api.entity;
+
+import java.util.List;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.IntMappingType;
+import org.apache.syncope.common.lib.types.MappingPurpose;
+
+public interface AttributableUtil {
+
+    AttributableType getType();
+
+    <T extends Attributable> Class<T> attributableClass();
+
+    <T extends NormSchema> Class<T> normSchemaClass();
+
+    <T extends NormAttr> Class<T> normAttrClass();
+
+    <T extends NormAttr> T newNormAttr();
+
+    <T extends NormAttrValue> Class<T> attrUniqueValueClass();
+
+    <T extends NormAttrValue> T newNormAttrUniqueValue();
+
+    <T extends NormAttrValue> Class<T> attrValueClass();
+
+    <T extends NormAttrValue> T newNormAttrValue();
+
+    <T extends AttrTemplate<NormSchema>> Class<T> normAttrTemplateClass();
+
+    <T extends DerSchema> Class<T> derSchemaClass();
+
+    <T extends DerSchema> T newDerSchema();
+
+    <T extends DerAttr> Class<T> derAttrClass();
+
+    <T extends DerAttr> T newDerAttr();
+
+    <T extends AttrTemplate<DerSchema>> Class<T> derAttrTemplateClass();
+
+    <T extends VirSchema> Class<T> virSchemaClass();
+
+    <T extends VirSchema> T newVirSchema();
+
+    <T extends VirAttr> Class<T> virAttrClass();
+
+    <T extends VirAttr> T newVirAttr();
+
+    <T extends AttrTemplate<VirSchema>> Class<T> virAttrTemplateClass();
+
+    <T extends MappingItem> T getAccountIdItem(ExternalResource resource);
+
+    String getAccountLink(ExternalResource resource);
+
+    <T extends MappingItem> List<T> getMappingItems(ExternalResource resource, MappingPurpose purpose);
+
+    <T extends MappingItem> List<T> getUidToMappingItems(
+            ExternalResource resource, MappingPurpose purpose, AttributableType type);
+
+    IntMappingType intMappingType();
+
+    IntMappingType derIntMappingType();
+
+    IntMappingType virIntMappingType();
+
+    <T extends MappingItem> Class<T> mappingItemClass();
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/ConnInstance.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/ConnInstance.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/ConnInstance.java
new file mode 100644
index 0000000..e582779
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/ConnInstance.java
@@ -0,0 +1,75 @@
+/*
+ * 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.persistence.api.entity;
+
+import java.util.List;
+import java.util.Set;
+import org.apache.syncope.common.lib.types.ConnConfProperty;
+import org.apache.syncope.common.lib.types.ConnectorCapability;
+
+public interface ConnInstance extends Entity<Long> {
+
+    boolean addCapability(ConnectorCapability capabitily);
+
+    boolean addResource(ExternalResource resource);
+
+    String getBundleName();
+
+    Set<ConnectorCapability> getCapabilities();
+
+    Set<ConnConfProperty> getConfiguration();
+
+    Integer getConnRequestTimeout();
+
+    String getConnectorName();
+
+    String getDisplayName();
+
+    String getLocation();
+
+    ConnPoolConf getPoolConf();
+
+    List<ExternalResource> getResources();
+
+    String getVersion();
+
+    boolean removeCapability(ConnectorCapability capabitily);
+
+    boolean removeResource(ExternalResource resource);
+
+    void setBundleName(String bundleName);
+
+    void setCapabilities(Set<ConnectorCapability> capabilities);
+
+    void setConfiguration(Set<ConnConfProperty> configuration);
+
+    void setConnRequestTimeout(Integer connRequestTimeout);
+
+    void setConnectorName(String connectorName);
+
+    void setDisplayName(String displayName);
+
+    void setLocation(String location);
+
+    void setPoolConf(ConnPoolConf poolConf);
+
+    void setResources(List<ExternalResource> resources);
+
+    void setVersion(String version);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/ConnPoolConf.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/ConnPoolConf.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/ConnPoolConf.java
new file mode 100644
index 0000000..bd86024
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/ConnPoolConf.java
@@ -0,0 +1,42 @@
+/*
+ * 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.persistence.api.entity;
+
+public interface ConnPoolConf {
+
+    Integer getMaxObjects();
+
+    void setMaxObjects(Integer maxObjects);
+
+    Integer getMinIdle();
+
+    void setMinIdle(Integer minIdle);
+
+    Integer getMaxIdle();
+
+    void setMaxIdle(Integer maxIdle);
+
+    Long getMaxWait();
+
+    void setMaxWait(Long maxWait);
+
+    Long getMinEvictableIdleTimeMillis();
+
+    void setMinEvictableIdleTimeMillis(Long minEvictableIdleTimeMillis);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/DerAttr.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/DerAttr.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/DerAttr.java
new file mode 100644
index 0000000..7a6812e
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/DerAttr.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.persistence.api.entity;
+
+import java.util.Collection;
+
+public interface DerAttr<N extends NormAttr> extends Attr<DerSchema> {
+
+    String getValue(Collection<N> attrs);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/DerSchema.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/DerSchema.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/DerSchema.java
new file mode 100644
index 0000000..e8e9e50
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/DerSchema.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.persistence.api.entity;
+
+public interface DerSchema extends Schema {
+
+    String getExpression();
+
+    void setExpression(String expression);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Entitlement.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Entitlement.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Entitlement.java
new file mode 100644
index 0000000..4e6ace9
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Entitlement.java
@@ -0,0 +1,29 @@
+/*
+ * 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.persistence.api.entity;
+
+public interface Entitlement extends Entity<String> {
+
+    String getDescription();
+
+    void setKey(String key);
+
+    void setDescription(String description);
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Entity.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Entity.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Entity.java
new file mode 100644
index 0000000..b1b4e00
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Entity.java
@@ -0,0 +1,24 @@
+/*
+ * 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.persistence.api.entity;
+
+public interface Entity<KEY> {
+
+    KEY getKey();
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Exec.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Exec.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Exec.java
new file mode 100644
index 0000000..c54729a
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Exec.java
@@ -0,0 +1,45 @@
+/*
+ * 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.persistence.api.entity;
+
+import java.util.Date;
+
+public interface Exec extends Entity<Long> {
+
+    Date getEndDate();
+
+    String getMessage();
+
+    Date getStartDate();
+
+    String getStatus();
+
+    void setEndDate(Date endDate);
+
+    /**
+     * Set a message for this execution, taking care of replacing every null character with newline.
+     *
+     * @param message the message to set for this execution
+     */
+    void setMessage(String message);
+
+    void setStartDate(Date startDate);
+
+    void setStatus(String status);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/ExternalResource.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/ExternalResource.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/ExternalResource.java
new file mode 100644
index 0000000..3e96e13
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/ExternalResource.java
@@ -0,0 +1,115 @@
+/*
+ * 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.persistence.api.entity;
+
+import org.apache.syncope.persistence.api.entity.user.UMapping;
+import org.apache.syncope.persistence.api.entity.role.RMapping;
+import java.util.List;
+import java.util.Set;
+import org.apache.syncope.common.lib.types.ConnConfProperty;
+import org.apache.syncope.common.lib.types.PropagationMode;
+import org.apache.syncope.common.lib.types.TraceLevel;
+import org.identityconnectors.framework.common.objects.SyncToken;
+
+public interface ExternalResource extends Entity<String> {
+
+    AccountPolicy getAccountPolicy();
+
+    PasswordPolicy getPasswordPolicy();
+
+    SyncPolicy getSyncPolicy();
+
+    Set<ConnConfProperty> getConnInstanceConfiguration();
+
+    ConnInstance getConnector();
+
+    TraceLevel getCreateTraceLevel();
+
+    TraceLevel getUpdateTraceLevel();
+
+    TraceLevel getDeleteTraceLevel();
+
+    TraceLevel getSyncTraceLevel();
+
+    List<String> getPropagationActionsClassNames();
+
+    PropagationMode getPropagationMode();
+
+    Integer getPropagationPriority();
+
+    UMapping getUmapping();
+
+    RMapping getRmapping();
+
+    SyncToken getUsyncToken();
+
+    String getSerializedUSyncToken();
+
+    SyncToken getRsyncToken();
+
+    String getSerializedRSyncToken();
+
+    boolean isEnforceMandatoryCondition();
+
+    boolean isPropagationPrimary();
+
+    boolean isRandomPwdIfNotProvided();
+
+    void setKey(String name);
+
+    void setAccountPolicy(AccountPolicy accountPolicy);
+
+    void setPasswordPolicy(PasswordPolicy passwordPolicy);
+
+    void setSyncPolicy(SyncPolicy syncPolicy);
+
+    void setConnInstanceConfiguration(Set<ConnConfProperty> properties);
+
+    void setConnector(ConnInstance connector);
+
+    void setCreateTraceLevel(TraceLevel createTraceLevel);
+
+    void setUpdateTraceLevel(TraceLevel updateTraceLevel);
+
+    void setDeleteTraceLevel(TraceLevel deleteTraceLevel);
+
+    void setSyncTraceLevel(TraceLevel syncTraceLevel);
+
+    void setPropagationMode(PropagationMode propagationMode);
+
+    void setPropagationPriority(Integer priority);
+
+    void setUmapping(UMapping umapping);
+
+    void setRmapping(RMapping rmapping);
+
+    void setSerializedUSyncToken(String token);
+
+    void setSerializedRSyncToken(String token);
+
+    void setEnforceMandatoryCondition(boolean enforce);
+
+    void setPropagationPrimary(boolean condition);
+
+    void setRandomPwdIfNotProvided(boolean condition);
+
+    void setUsyncToken(SyncToken syncToken);
+
+    void setRsyncToken(SyncToken syncToken);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Logger.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Logger.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Logger.java
new file mode 100644
index 0000000..ca6e17b
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Logger.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.persistence.api.entity;
+
+import org.apache.syncope.common.lib.types.LoggerLevel;
+import org.apache.syncope.common.lib.types.LoggerType;
+
+public interface Logger extends Entity<String> {
+
+    void setName(String name);
+
+    LoggerLevel getLevel();
+
+    void setLevel(LoggerLevel level);
+
+    LoggerType getType();
+
+    void setType(LoggerType type);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Mapping.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Mapping.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Mapping.java
new file mode 100644
index 0000000..9e538a6
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Mapping.java
@@ -0,0 +1,44 @@
+/*
+ * 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.persistence.api.entity;
+
+import java.util.List;
+
+public interface Mapping<T extends MappingItem> extends Entity<Long> {
+
+    T getAccountIdItem();
+
+    String getAccountLink();
+
+    List<T> getItems();
+
+    ExternalResource getResource();
+
+    boolean addItem(T item);
+
+    boolean removeItem(T item);
+
+    void setAccountIdItem(T item);
+
+    void setAccountLink(String accountLink);
+
+    void setItems(List<T> items);
+
+    void setResource(ExternalResource resource);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/MappingItem.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/MappingItem.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/MappingItem.java
new file mode 100644
index 0000000..33d3127
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/MappingItem.java
@@ -0,0 +1,57 @@
+/*
+ * 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.persistence.api.entity;
+
+import org.apache.syncope.common.lib.types.IntMappingType;
+import org.apache.syncope.common.lib.types.MappingPurpose;
+
+public interface MappingItem extends Entity<Long> {
+
+    String getExtAttrName();
+
+    String getIntAttrName();
+
+    IntMappingType getIntMappingType();
+
+    String getMandatoryCondition();
+
+    <T extends MappingItem> Mapping<T> getMapping();
+
+    MappingPurpose getPurpose();
+
+    boolean isAccountid();
+
+    boolean isPassword();
+
+    void setAccountid(boolean accountid);
+
+    void setExtAttrName(String extAttrName);
+
+    void setIntAttrName(String intAttrName);
+
+    void setIntMappingType(IntMappingType intMappingType);
+
+    void setMandatoryCondition(String condition);
+
+    void setMapping(Mapping mapping);
+
+    void setPassword(boolean password);
+
+    void setPurpose(MappingPurpose purpose);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/NormAttr.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/NormAttr.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/NormAttr.java
new file mode 100644
index 0000000..c5bbccb
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/NormAttr.java
@@ -0,0 +1,37 @@
+/*
+ * 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.persistence.api.entity;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.dao.validation.InvalidNormAttrValueException;
+
+public interface NormAttr extends Attr<NormSchema> {
+
+    void addValue(String value, AttributableUtil attributableUtil) throws InvalidNormAttrValueException;
+
+    NormAttrValue getUniqueValue();
+
+    List<? extends NormAttrValue> getValues();
+
+    List<String> getValuesAsStrings();
+
+    boolean removeValue(NormAttrValue attrValue);
+
+    void setUniqueValue(NormAttrValue uniqueValue);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/NormAttrValue.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/NormAttrValue.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/NormAttrValue.java
new file mode 100644
index 0000000..3873c70
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/NormAttrValue.java
@@ -0,0 +1,62 @@
+/*
+ * 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.persistence.api.entity;
+
+import java.util.Date;
+import org.apache.syncope.common.lib.types.AttrSchemaType;
+import org.apache.syncope.persistence.api.dao.validation.ParsingValidationException;
+
+public interface NormAttrValue extends Entity<Long> {
+
+    NormAttr getNormAttr();
+
+    byte[] getBinaryValue();
+
+    Boolean getBooleanValue();
+
+    Date getDateValue();
+
+    Double getDoubleValue();
+
+    Long getLongValue();
+
+    String getStringValue();
+
+    <V> V getValue();
+
+    String getValueAsString();
+
+    String getValueAsString(AttrSchemaType type);
+
+    void parseValue(NormSchema schema, String value) throws ParsingValidationException;
+
+    void setNormAttr(NormAttr attr);
+
+    void setBinaryValue(byte[] binaryValue);
+
+    void setBooleanValue(Boolean booleanValue);
+
+    void setDateValue(Date dateValue);
+
+    void setDoubleValue(Double doubleValue);
+
+    void setLongValue(Long longValue);
+
+    void setStringValue(String stringValue);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/NormSchema.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/NormSchema.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/NormSchema.java
new file mode 100644
index 0000000..53072ad
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/NormSchema.java
@@ -0,0 +1,56 @@
+/*
+ * 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.persistence.api.entity;
+
+import org.apache.syncope.common.lib.types.CipherAlgorithm;
+import org.apache.syncope.persistence.api.dao.validation.Validator;
+
+public interface NormSchema extends Schema {
+
+    CipherAlgorithm getCipherAlgorithm();
+
+    String getConversionPattern();
+
+    String getEnumerationKeys();
+
+    String getEnumerationValues();
+
+    String getMimeType();
+
+    String getSecretKey();
+
+    Validator getValidator();
+
+    String getValidatorClass();
+
+    void setCipherAlgorithm(CipherAlgorithm cipherAlgorithm);
+
+    void setConversionPattern(String conversionPattern);
+
+    void setEnumerationKeys(String enumerationKeys);
+
+    void setEnumerationValues(String enumerationValues);
+
+    void setMimeType(String mimeType);
+
+    void setSecretKey(String secretKey);
+
+    void setValidatorClass(String validatorClass);
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Notification.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Notification.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Notification.java
new file mode 100644
index 0000000..d4aaaa9
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Notification.java
@@ -0,0 +1,88 @@
+/*
+ * 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.persistence.api.entity;
+
+import java.util.List;
+import org.apache.syncope.common.lib.types.IntMappingType;
+import org.apache.syncope.common.lib.types.TraceLevel;
+
+public interface Notification extends Entity<Long> {
+
+    boolean addEvent(String event);
+
+    boolean addStaticRecipient(String staticRecipient);
+
+    List<String> getEvents();
+
+    Long getId();
+
+    String getRecipientAttrName();
+
+    IntMappingType getRecipientAttrType();
+
+    String getRecipients();
+
+    String getRoleAbout();
+
+    String getSender();
+
+    List<String> getStaticRecipients();
+
+    String getSubject();
+
+    String getTemplate();
+
+    TraceLevel getTraceLevel();
+
+    String getUserAbout();
+
+    boolean isActive();
+
+    boolean isSelfAsRecipient();
+
+    boolean removeEvent(String event);
+
+    boolean removeStaticRecipient(String staticRecipient);
+
+    void setActive(boolean active);
+
+    void setEvents(List<String> events);
+
+    void setRecipientAttrName(String recipientAttrName);
+
+    void setRecipientAttrType(IntMappingType recipientAttrType);
+
+    void setRecipients(String recipients);
+
+    void setRoleAbout(String roleAbout);
+
+    void setSelfAsRecipient(boolean selfAsRecipient);
+
+    void setSender(String sender);
+
+    void setStaticRecipients(List<String> staticRecipients);
+
+    void setSubject(String subject);
+
+    void setTemplate(String template);
+
+    void setTraceLevel(TraceLevel traceLevel);
+
+    void setUserAbout(String userAbout);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/PasswordPolicy.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/PasswordPolicy.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/PasswordPolicy.java
new file mode 100644
index 0000000..cc82917
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/PasswordPolicy.java
@@ -0,0 +1,23 @@
+/*
+ * 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.persistence.api.entity;
+
+public interface PasswordPolicy extends Policy {
+    
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Policy.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Policy.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Policy.java
new file mode 100644
index 0000000..dc501e1
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Policy.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.persistence.api.entity;
+
+import org.apache.syncope.common.lib.types.PolicySpec;
+import org.apache.syncope.common.lib.types.PolicyType;
+
+public interface Policy extends Entity<Long> {
+
+    String getDescription();
+
+    <T extends PolicySpec> T getSpecification(Class<T> reference);
+
+    PolicyType getType();
+
+    void setDescription(String description);
+
+    void setSpecification(PolicySpec policy);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Report.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Report.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Report.java
new file mode 100644
index 0000000..f158743
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Report.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.persistence.api.entity;
+
+import java.util.List;
+import org.apache.syncope.common.lib.report.ReportletConf;
+
+public interface Report extends Entity<Long> {
+
+    String getName();
+
+    boolean addExec(ReportExec exec);
+
+    boolean addReportletConf(ReportletConf reportletConf);
+
+    String getCronExpression();
+
+    List<ReportExec> getExecs();
+
+    List<ReportletConf> getReportletConfs();
+
+    boolean removeExec(ReportExec exec);
+
+    boolean removeReportletConf(ReportletConf reportletConf);
+
+    void setCronExpression(String cronExpression);
+
+    void setExecs(List<ReportExec> executions);
+
+    void setName(String name);
+
+    void setReportletConfs(List<ReportletConf> reportletConfs);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/ReportExec.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/ReportExec.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/ReportExec.java
new file mode 100644
index 0000000..1cbd6b3
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/ReportExec.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.persistence.api.entity;
+
+import org.apache.syncope.common.lib.types.ReportExecStatus;
+
+public interface ReportExec extends Exec {
+
+    byte[] getExecResult();
+
+    Report getReport();
+
+    void setExecResult(byte[] execResult);
+
+    void setReport(Report report);
+
+    void setStatus(ReportExecStatus status);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Schema.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Schema.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Schema.java
new file mode 100644
index 0000000..d05f8ec
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Schema.java
@@ -0,0 +1,47 @@
+/*
+ * 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.persistence.api.entity;
+
+import org.apache.syncope.common.lib.types.AttrSchemaType;
+
+public interface Schema extends Entity<String> {
+
+    AttrSchemaType getType();
+
+    String getMandatoryCondition();
+
+    boolean isMultivalue();
+
+    boolean isReadonly();
+
+    boolean isUniqueConstraint();
+
+    void setName(String name);
+
+    void setType(AttrSchemaType type);
+
+    void setMandatoryCondition(String condition);
+
+    void setMultivalue(boolean multivalue);
+
+    void setReadonly(boolean readonly);
+
+    void setUniqueConstraint(boolean uniquevalue);
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Subject.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Subject.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Subject.java
new file mode 100644
index 0000000..d75bcfa
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/Subject.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.persistence.api.entity;
+
+import java.util.Set;
+
+public interface Subject<N extends NormAttr, D extends DerAttr<N>, V extends VirAttr> extends Attributable<N, D, V> {
+
+    boolean addResource(ExternalResource resource);
+
+    boolean removeResource(ExternalResource resource);
+
+    Set<String> getResourceNames();
+
+    Set<ExternalResource> getResources();
+
+    void setResources(Set<ExternalResource> resources);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/SyncPolicy.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/SyncPolicy.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/SyncPolicy.java
new file mode 100644
index 0000000..8f15dbc
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/SyncPolicy.java
@@ -0,0 +1,23 @@
+/*
+ * 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.persistence.api.entity;
+
+public interface SyncPolicy extends Policy {
+    
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/VirAttr.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/VirAttr.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/VirAttr.java
new file mode 100644
index 0000000..ce39d36
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/VirAttr.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.persistence.api.entity;
+
+import java.util.List;
+
+public interface VirAttr extends Attr<VirSchema> {
+
+    List<String> getValues();
+
+    boolean addValue(String value);
+
+    boolean removeValue(String value);
+
+    void setValues(List<String> values);
+}


[5/6] syncope git commit: [SYNCOPE-620] persistence-api and common-lib

Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/common/pom.xml b/syncope620/common/pom.xml
new file mode 100644
index 0000000..0045a54
--- /dev/null
+++ b/syncope620/common/pom.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.syncope</groupId>
+    <artifactId>syncope</artifactId>
+    <version>2.0.0-SNAPSHOT</version>
+  </parent>
+
+  <name>Apache Syncope Common</name>
+  <description>Apache Syncope Common</description>
+  <groupId>org.apache.syncope</groupId>
+  <artifactId>syncope-common</artifactId>
+  <packaging>pom</packaging>
+
+  <modules>
+    <module>lib</module>
+  </modules>
+
+</project>

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/pom.xml b/syncope620/pom.xml
new file mode 100644
index 0000000..368c76e
--- /dev/null
+++ b/syncope620/pom.xml
@@ -0,0 +1,401 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <name>Apache Syncope</name>
+  <description>Apache Syncope parent POM</description>
+
+  <groupId>org.apache.syncope</groupId>
+  <artifactId>syncope</artifactId>
+  <version>2.0.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <parent>
+    <groupId>org.apache</groupId>
+    <artifactId>apache</artifactId>
+    <version>16</version>
+    <relativePath />
+  </parent>
+
+  <url>http://syncope.apache.org/</url>
+
+  <inceptionYear>2010</inceptionYear>
+
+  <licenses>
+    <license>
+      <name>The Apache Software License, Version 2.0</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+      <distribution>repo</distribution>
+    </license>
+  </licenses>
+
+  <scm>
+    <connection>scm:git:https://git-wip-us.apache.org/repos/asf/syncope.git</connection>
+    <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/syncope.git</developerConnection>
+    <url>https://git-wip-us.apache.org/repos/asf?p=syncope.git</url>
+  </scm>
+
+  <issueManagement>
+    <system>jira</system>
+    <url>https://issues.apache.org/jira/browse/SYNCOPE</url>
+  </issueManagement>
+
+  <ciManagement>
+    <system>Jenkins</system>
+    <url>https://builds.apache.org/view/S-Z/view/Syncope/</url>
+  </ciManagement>
+
+  <distributionManagement>
+    <site>
+      <id>syncope.website</id>
+      <name>Apache Syncope website</name>
+      <url>${site.deploymentBaseUrl}</url>
+    </site>
+  </distributionManagement>
+
+  <mailingLists>
+    <mailingList>
+      <name>Syncope User List</name>
+      <subscribe>user-subscribe@syncope.apache.org</subscribe>
+      <unsubscribe>user-unsubscribe@syncope.apache.org</unsubscribe>
+      <post>user@syncope.apache.org</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/syncope-user/</archive>
+      <otherArchives>
+        <otherArchive>http://syncope.markmail.org/</otherArchive>
+        <otherArchive>http://syncope-user.1051894.n5.nabble.com/</otherArchive>
+        <otherArchive>http://www.mail-archive.com/user@syncope.apache.org/</otherArchive>
+      </otherArchives>
+    </mailingList>
+    <mailingList>
+      <name>Syncope Developer List</name>
+      <subscribe>dev-subscribe@syncope.apache.org</subscribe>
+      <unsubscribe>dev-unsubscribe@syncope.apache.org</unsubscribe>
+      <post>dev@syncope.apache.org</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/syncope-dev/</archive>
+      <otherArchives>
+        <otherArchive>http://syncope.markmail.org/</otherArchive>
+        <otherArchive>http://syncope-dev.1063484.n5.nabble.com/</otherArchive>
+        <otherArchive>http://www.mail-archive.com/dev@syncope.apache.org/</otherArchive>
+      </otherArchives>
+    </mailingList>
+    <mailingList>
+      <name>Syncope Commits List</name>
+      <subscribe>commits-subscribe@syncope.apache.org</subscribe>
+      <unsubscribe>commits-unsubscribe@syncope.apache.org</unsubscribe>
+      <post>commits@syncope.apache.org</post>
+      <archive>http://mail-archives.apache.org/mod_mbox/syncope-commits/</archive>
+      <otherArchives>
+        <otherArchive>http://syncope.markmail.org/</otherArchive>
+        <otherArchive>http://www.mail-archive.com/commits@syncope.apache.org/</otherArchive>
+      </otherArchives>
+    </mailingList>
+  </mailingLists>
+
+  <developers>
+    <developer>
+      <id>ilgrosso</id>
+      <email>ilgrosso@apache.org</email>
+      <name>Francesco Chicchiriccò</name>
+      <organization>Tirasa</organization>
+      <organizationUrl>http://www.tirasa.net/</organizationUrl>
+      <roles>
+        <role>ASF member</role>
+        <role>PMC chair</role>
+      </roles>
+      <url>http://people.apache.org/~ilgrosso/</url>
+    </developer>
+    <developer>
+      <id>fmartelli</id>
+      <name>Fabio Martelli</name>
+      <organization>Tirasa</organization>
+      <organizationUrl>http://www.tirasa.net/</organizationUrl>
+      <roles>
+        <role>PMC member</role>
+      </roles>
+      <url>http://people.apache.org/~fmartelli/</url>
+    </developer>
+    <developer>
+      <id>mdisabatino</id>
+      <name>Marco Di Sabatino Di Diodoro</name>
+      <organization>Tirasa</organization>
+      <organizationUrl>http://www.tirasa.net/</organizationUrl>
+      <roles>
+        <role>PMC member</role>
+      </roles>
+      <url>http://people.apache.org/~mdisabatino/</url>
+    </developer>
+    <developer>
+      <id>massi</id>
+      <name>Massimiliano Perrone</name>
+      <organization>Tirasa</organization>
+      <organizationUrl>http://www.tirasa.net/</organizationUrl>
+      <roles>
+        <role>PMC member</role>
+      </roles>
+      <url>http://people.apache.org/~massi/</url>
+    </developer>    
+    <developer>
+      <id>rene</id>
+      <name>René Mulder</name>
+      <organization>Everett</organization>
+      <organizationUrl>http://www.everett.nl/</organizationUrl>
+      <roles>
+        <role>committer</role>
+      </roles>
+      <url>http://people.apache.org/~rene/</url>
+    </developer>
+    <developer>
+      <id>simonetripodi</id>
+      <name>Simone Tripodi</name>
+      <organization>The Apache Software Foundation</organization>
+      <organizationUrl>http://www.apache.org/</organizationUrl>
+      <roles>
+        <role>ASF member</role>
+        <role>PMC member</role>
+      </roles>
+      <url>http://people.apache.org/~simonetripodi/</url>
+    </developer>
+    <developer>
+      <id>elecharny</id>
+      <name>Emmanuel Lecharny</name>
+      <organization>The Apache Software Foundation</organization>
+      <organizationUrl>http://www.apache.org/</organizationUrl>
+      <roles>
+        <role>ASF member</role>
+        <role>PMC member</role>
+      </roles>
+      <url>http://people.apache.org/~elecharny/</url>
+    </developer>
+    <developer>
+      <id>anzelld</id>
+      <name>Dino Anzellotti</name>
+      <organization>Everett Italia</organization>
+      <organizationUrl>http://www.everett.it/</organizationUrl>
+      <roles>
+        <role>committer</role>
+      </roles>
+      <url>http://people.apache.org/~anzelld/</url>
+    </developer>
+    <developer>
+      <id>coheigea</id>
+      <name>Colm O hEigeartaigh</name>
+      <organization>Talend</organization>
+      <organizationUrl>http://www.talend.com/</organizationUrl>
+      <roles>
+        <role>ASF member</role>
+        <role>PMC member</role>
+      </roles>
+      <url>http://people.apache.org/~coheigea/</url>
+    </developer>
+    <developer>
+      <id>jbonofre</id>
+      <name>Jean-Baptiste Onofré</name>
+      <organization>Talend</organization>
+      <organizationUrl>http://www.talend.com/</organizationUrl>
+      <roles>
+        <role>ASF member</role>
+        <role>PMC member</role>
+      </roles>
+      <url>http://people.apache.org/~jbonofre/</url>
+    </developer>
+    <developer>
+      <id>jbernhardt</id>
+      <name>Jan Bernhardt</name>
+      <organization>Talend</organization>
+      <organizationUrl>http://www.talend.com/</organizationUrl>
+      <roles>
+        <role>PMC member</role>
+      </roles>
+      <url>http://people.apache.org/~jbernhardt/</url>
+    </developer>
+    <developer>
+      <id>ashakirin</id>
+      <name>Andrei Shakirin</name>
+      <organization>Talend</organization>
+      <organizationUrl>http://www.talend.com/</organizationUrl>
+      <roles>
+        <role>committer</role>
+      </roles>
+      <url>http://ashakirin.blogspot.de/</url>
+    </developer>
+    <developer>
+      <id>cschneider</id>
+      <name>Christian Schneider</name>
+      <organization>Talend</organization>
+      <organizationUrl>http://www.talend.com/</organizationUrl>
+      <roles>
+        <role>committer</role>
+      </roles>
+      <url>http://www.liquid-reality.de/</url>
+      <email>chris@die-schneider.net</email>
+    </developer>
+    <developer>
+      <id>gwimmel</id>
+      <name>Guido Wimmel</name>
+      <organization>Stadtwerke München Services GmbH</organization>
+      <organizationUrl>http://www.swm.de/</organizationUrl>
+      <roles>
+        <role>PMC member</role>
+      </roles>
+      <url>http://people.apache.org/~gwimmel/</url>
+      <email>gwimmel@apache.org</email>
+    </developer>
+    <developer>
+      <id>andreapatricelli</id>
+      <name>Andrea Patricelli</name>
+      <organization>Tirasa</organization>
+      <organizationUrl>http://www.tirasa.net/</organizationUrl>
+      <roles>
+        <role>committer</role>
+      </roles>
+      <url>http://people.apache.org/~andreapatricelli/</url>
+      <email>andreapatricelli@apache.org</email>
+    </developer>
+  </developers>
+
+  <contributors>
+    <contributor>
+      <name>Denis Signoretto</name>
+      <email>denis.signoretto@intesys.it</email>
+      <organization>Intesys</organization>
+      <organizationUrl>http://www.intesys.it/</organizationUrl>
+    </contributor>
+    <contributor>
+      <name>Bob Lannoy</name>
+      <email>bob.lannoy@smals.be</email>
+      <organization>Smals</organization>
+      <organizationUrl>http://www.smals.be/</organizationUrl>
+      <url>http://blogresearch.smalsrech.be/</url>
+    </contributor>
+    <contributor>
+      <name>Bruno Rogério de Moura</name>
+      <email>brunormoura@gmail.com</email>
+      <organization>Exprivia</organization>
+      <organizationUrl>http://www.exprivia.it/home</organizationUrl>
+      <url>http://br.linkedin.com/pub/bruno-moura/1b/2a/806</url>
+    </contributor>
+  </contributors>
+
+  <prerequisites>
+    <maven>[3.0.3,)</maven>
+  </prerequisites>
+
+  <properties>
+    <syncope.version>${project.version}</syncope.version>
+
+    <connid.version>1.4.0.0</connid.version>
+
+    <jackson.version>2.4.4</jackson.version>
+
+    <log4j.version>2.1</log4j.version>
+
+    <commons-lang.version>3.3.2</commons-lang.version>
+
+    <targetJdk>1.7</targetJdk>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <dependencyManagement>
+
+    <dependencies>
+      <dependency>
+        <groupId>javax.validation</groupId>
+        <artifactId>validation-api</artifactId>
+        <version>1.1.0.Final</version>
+      </dependency>
+      
+      <dependency>
+        <groupId>com.fasterxml.jackson.core</groupId>
+        <artifactId>jackson-annotations</artifactId>
+        <version>${jackson.version}</version>
+      </dependency>
+      
+      <dependency>
+        <groupId>org.apache.commons</groupId>
+        <artifactId>commons-lang3</artifactId>
+        <version>${commons-lang.version}</version>
+      </dependency>
+      
+      <dependency>
+        <groupId>net.tirasa.connid</groupId>
+        <artifactId>connector-framework</artifactId>
+        <version>${connid.version}</version>
+      </dependency>
+      
+      <dependency>
+        <groupId>org.apache.logging.log4j</groupId>
+        <artifactId>log4j-api</artifactId>
+        <version>${log4j.version}</version>
+      </dependency>
+    </dependencies>
+
+  </dependencyManagement>
+
+  <repositories>
+    <repository>
+      <id>sonatype</id>
+      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+      <releases>
+        <enabled>false</enabled>
+      </releases>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+    </repository>
+  </repositories>
+
+  <pluginRepositories>
+    <pluginRepository>
+      <id>apache.snapshots</id>
+      <url>http://repository.apache.org/snapshots</url>
+    </pluginRepository>
+  </pluginRepositories>
+
+  <build>
+    <defaultGoal>clean verify</defaultGoal>
+
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>3.2</version> 
+          <configuration>
+            <source>${targetJdk}</source>
+            <target>${targetJdk}</target>
+            <showWarnings>true</showWarnings>
+            <showDeprecation>true</showDeprecation>
+            <!--<compilerArgument>-Xlint:unchecked</compilerArgument>-->
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+
+    <plugins>
+    </plugins>
+  </build>
+
+  <modules>
+    <module>common</module>
+    <module>server</module>
+  </modules>
+</project>

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/pom.xml b/syncope620/server/persistence-api/pom.xml
new file mode 100644
index 0000000..5f88243
--- /dev/null
+++ b/syncope620/server/persistence-api/pom.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.syncope</groupId>
+    <artifactId>syncope-server</artifactId>
+    <version>2.0.0-SNAPSHOT</version>
+  </parent>
+
+  <name>Apache Syncope Server Persistence API</name>
+  <description>Apache Syncope Server Persistence API</description>
+  <groupId>org.apache.syncope.server</groupId>
+  <artifactId>syncope-persistence-api</artifactId>
+  <packaging>jar</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>javax.validation</groupId>
+      <artifactId>validation-api</artifactId>
+    </dependency>
+      
+    <dependency>
+      <groupId>net.tirasa.connid</groupId>
+      <artifactId>connector-framework</artifactId>
+    </dependency>
+      
+    <dependency>
+      <groupId>org.apache.syncope.common</groupId>
+      <artifactId>syncope-lib</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/AttrTemplateDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/AttrTemplateDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/AttrTemplateDAO.java
new file mode 100644
index 0000000..85b00b4
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/AttrTemplateDAO.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.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.entity.AttrTemplate;
+import org.apache.syncope.persistence.api.entity.NormSchema;
+
+public interface AttrTemplateDAO<K extends NormSchema> extends DAO<AttrTemplate<K>> {
+
+    <T extends AttrTemplate<K>> T find(Long key, Class<T> reference);
+
+    <T extends AttrTemplate<K>> List<Number> findBySchemaName(String schemaName, Class<T> reference);
+
+    <T extends AttrTemplate<K>> void delete(Long key, Class<T> reference);
+
+    <T extends AttrTemplate<K>> void delete(T attrTemplate);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/ConfDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/ConfDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/ConfDAO.java
new file mode 100644
index 0000000..2b9d978
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/ConfDAO.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.persistence.api.dao;
+
+import org.apache.syncope.persistence.api.entity.conf.CNormAttr;
+import org.apache.syncope.persistence.api.entity.conf.Conf;
+
+public interface ConfDAO extends DAO<Conf> {
+
+    CNormAttr find(String key);
+
+    CNormAttr find(String key, String defaultValue);
+
+    Conf get();
+
+    Conf save(CNormAttr attr);
+
+    Conf delete(String key);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/DAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/DAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/DAO.java
new file mode 100644
index 0000000..54e9404
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/DAO.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.persistence.api.dao;
+
+import org.apache.syncope.persistence.api.entity.Entity;
+
+public interface DAO<T extends Entity> {
+
+    void refresh(T entity);
+
+    void detach(T entity);
+
+    void flush();
+
+    void clear();
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/DerAttrDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/DerAttrDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/DerAttrDAO.java
new file mode 100644
index 0000000..2c81734
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/DerAttrDAO.java
@@ -0,0 +1,37 @@
+/*
+ * 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.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.dao.validation.InvalidEntityException;
+import org.apache.syncope.persistence.api.entity.DerAttr;
+import org.apache.syncope.persistence.api.entity.NormAttr;
+
+public interface DerAttrDAO<K extends NormAttr> extends DAO<DerAttr<K>> {
+
+    <T extends DerAttr<K>> T find(Long key, Class<T> reference);
+
+    <T extends DerAttr<K>> List<T> findAll(Class<T> reference);
+
+    <T extends DerAttr<K>> T save(T derAttr) throws InvalidEntityException;
+
+    <T extends DerAttr<K>> void delete(Long key, Class<T> reference);
+
+    <T extends DerAttr<K>> void delete(T derAttr);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/DerSchemaDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/DerSchemaDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/DerSchemaDAO.java
new file mode 100644
index 0000000..3d39d38
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/DerSchemaDAO.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.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.dao.validation.InvalidEntityException;
+import org.apache.syncope.persistence.api.entity.AttributableUtil;
+import org.apache.syncope.persistence.api.entity.DerAttr;
+import org.apache.syncope.persistence.api.entity.DerSchema;
+import org.apache.syncope.persistence.api.entity.NormAttr;
+
+public interface DerSchemaDAO extends DAO<DerSchema> {
+
+    <T extends DerSchema> T find(String name, Class<T> reference);
+
+    <T extends DerSchema> List<T> findAll(Class<T> reference);
+
+    <T extends DerAttr<K>, K extends NormAttr> List<T> findAttrs(DerSchema schema, Class<T> reference);
+
+    <T extends DerSchema> T save(T derSchema) throws InvalidEntityException;
+
+    void delete(String name, AttributableUtil attributableUtil);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/EntitlementDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/EntitlementDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/EntitlementDAO.java
new file mode 100644
index 0000000..c38076e
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/EntitlementDAO.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.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.dao.validation.InvalidEntityException;
+import org.apache.syncope.persistence.api.entity.Entitlement;
+import org.apache.syncope.persistence.api.entity.role.Role;
+
+public interface EntitlementDAO extends DAO<Entitlement> {
+
+    Entitlement find(String key);
+
+    List<Entitlement> findAll();
+
+    Entitlement save(Entitlement entitlement) throws InvalidEntityException;
+
+    Entitlement saveEntitlementRole(Role role);
+
+    void delete(String key);
+
+    void delete(Entitlement entitlement);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/ExternalResourceDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/ExternalResourceDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/ExternalResourceDAO.java
new file mode 100644
index 0000000..3d03505
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/ExternalResourceDAO.java
@@ -0,0 +1,47 @@
+/*
+ * 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.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.common.lib.types.IntMappingType;
+import org.apache.syncope.common.lib.types.PolicyType;
+import org.apache.syncope.persistence.api.dao.validation.InvalidEntityException;
+import org.apache.syncope.persistence.api.entity.ExternalResource;
+import org.apache.syncope.persistence.api.entity.MappingItem;
+import org.apache.syncope.persistence.api.entity.Policy;
+
+public interface ExternalResourceDAO extends DAO<ExternalResource> {
+
+    ExternalResource find(String key);
+
+    List<ExternalResource> findByPolicy(Policy policy);
+
+    List<ExternalResource> findWithoutPolicy(PolicyType type);
+
+    List<ExternalResource> findAll();
+
+    List<ExternalResource> findAllByPriority();
+
+    ExternalResource save(ExternalResource resource) throws InvalidEntityException;
+
+    <T extends MappingItem> void deleteMapping(
+            String schemaName, IntMappingType intMappingType, Class<T> reference);
+
+    void delete(String key);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/LoggerDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/LoggerDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/LoggerDAO.java
new file mode 100644
index 0000000..bcf0ac2
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/LoggerDAO.java
@@ -0,0 +1,37 @@
+/*
+ * 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.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.common.lib.types.LoggerType;
+import org.apache.syncope.persistence.api.dao.validation.InvalidEntityException;
+import org.apache.syncope.persistence.api.entity.Logger;
+
+public interface LoggerDAO extends DAO<Logger> {
+
+    Logger find(String key);
+
+    List<Logger> findAll(LoggerType type);
+
+    Logger save(Logger logger) throws InvalidEntityException;
+
+    void delete(String key);
+
+    void delete(Logger logger);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/MembershipDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/MembershipDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/MembershipDAO.java
new file mode 100644
index 0000000..a586aae
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/MembershipDAO.java
@@ -0,0 +1,38 @@
+/*
+ * 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.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.dao.validation.InvalidEntityException;
+import org.apache.syncope.persistence.api.entity.membership.Membership;
+import org.apache.syncope.persistence.api.entity.role.Role;
+import org.apache.syncope.persistence.api.entity.user.User;
+
+public interface MembershipDAO extends DAO<Membership> {
+
+    Membership find(Long key);
+
+    Membership find(User user, Role role);
+
+    List<Membership> findAll();
+
+    Membership save(Membership membership) throws InvalidEntityException;
+
+    void delete(Long key);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NormAttrDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NormAttrDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NormAttrDAO.java
new file mode 100644
index 0000000..2748c34
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NormAttrDAO.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.persistence.api.dao;
+
+import org.apache.syncope.persistence.api.entity.NormAttr;
+
+public interface NormAttrDAO extends DAO<NormAttr> {
+
+    <T extends NormAttr> T find(Long key, Class<T> reference);
+
+    <T extends NormAttr> void delete(Long key, Class<T> reference);
+
+    <T extends NormAttr> void delete(T attr);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NormAttrValueDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NormAttrValueDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NormAttrValueDAO.java
new file mode 100644
index 0000000..4066913
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NormAttrValueDAO.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.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.dao.validation.InvalidEntityException;
+import org.apache.syncope.persistence.api.entity.NormAttrValue;
+
+public interface NormAttrValueDAO extends DAO<NormAttrValue> {
+
+    <T extends NormAttrValue> T find(Long key, Class<T> reference);
+
+    <T extends NormAttrValue> List<T> findAll(Class<T> reference);
+
+    <T extends NormAttrValue> T save(T attributeValue) throws InvalidEntityException;
+
+    <T extends NormAttrValue> void delete(Long key, Class<T> reference);
+
+    <T extends NormAttrValue> void delete(T attributeValue);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NormSchemaDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NormSchemaDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NormSchemaDAO.java
new file mode 100644
index 0000000..88de3e1
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NormSchemaDAO.java
@@ -0,0 +1,38 @@
+/*
+ * 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.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.dao.validation.InvalidEntityException;
+import org.apache.syncope.persistence.api.entity.AttributableUtil;
+import org.apache.syncope.persistence.api.entity.NormAttr;
+import org.apache.syncope.persistence.api.entity.NormSchema;
+
+public interface NormSchemaDAO extends DAO<NormSchema> {
+
+    <T extends NormSchema> T find(String key, Class<T> reference);
+
+    <T extends NormSchema> List<T> findAll(Class<T> reference);
+
+    <T extends NormAttr> List<T> findAttrs(NormSchema schema, Class<T> reference);
+
+    <T extends NormSchema> T save(T schema) throws InvalidEntityException;
+
+    void delete(String name, AttributableUtil attributableUtil);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NotFoundException.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NotFoundException.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NotFoundException.java
new file mode 100644
index 0000000..2d9326d
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NotFoundException.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.persistence.api.dao;
+
+/**
+ * Thrown when something is not found.
+ */
+public class NotFoundException extends RuntimeException {
+
+    private static final long serialVersionUID = 4810651769126663581L;
+
+    public NotFoundException(final String msg) {
+        super(msg);
+    }
+
+    public NotFoundException(final String msg, final Exception cause) {
+        super(msg, cause);
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NotificationDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NotificationDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NotificationDAO.java
new file mode 100644
index 0000000..3488303
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/NotificationDAO.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.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.dao.validation.InvalidEntityException;
+import org.apache.syncope.persistence.api.entity.Notification;
+
+public interface NotificationDAO extends DAO<Notification> {
+
+    Notification find(Long key);
+
+    List<Notification> findAll();
+
+    Notification save(Notification notification) throws InvalidEntityException;
+
+    void delete(Long key);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/PolicyDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/PolicyDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/PolicyDAO.java
new file mode 100644
index 0000000..27f4edf
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/PolicyDAO.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.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.common.lib.types.PolicyType;
+import org.apache.syncope.persistence.api.entity.AccountPolicy;
+import org.apache.syncope.persistence.api.entity.ExternalResource;
+import org.apache.syncope.persistence.api.entity.PasswordPolicy;
+import org.apache.syncope.persistence.api.entity.Policy;
+import org.apache.syncope.persistence.api.entity.SyncPolicy;
+
+public interface PolicyDAO extends DAO<Policy> {
+
+    <T extends Policy> T find(Long key);
+
+    <T extends Policy> List<T> find(PolicyType type);
+
+    List<AccountPolicy> findByResource(ExternalResource resource);
+
+    PasswordPolicy getGlobalPasswordPolicy();
+
+    AccountPolicy getGlobalAccountPolicy();
+
+    SyncPolicy getGlobalSyncPolicy();
+
+    List<Policy> findAll();
+
+    <T extends Policy> T save(T policy);
+
+    <T extends Policy> void delete(T policy);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/ReportDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/ReportDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/ReportDAO.java
new file mode 100644
index 0000000..eef08f7
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/ReportDAO.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.dao.search.OrderByClause;
+import org.apache.syncope.persistence.api.dao.validation.InvalidEntityException;
+import org.apache.syncope.persistence.api.entity.Report;
+
+public interface ReportDAO extends DAO<Report> {
+
+    Report find(Long key);
+
+    List<Report> findAll();
+
+    List<Report> findAll(int page, int itemsPerPage, List<OrderByClause> orderByClauses);
+
+    int count();
+
+    Report save(Report report) throws InvalidEntityException;
+
+    void delete(Long key);
+
+    void delete(Report report);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/ReportExecDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/ReportExecDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/ReportExecDAO.java
new file mode 100644
index 0000000..1cad2c3
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/ReportExecDAO.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.dao.validation.InvalidEntityException;
+import org.apache.syncope.persistence.api.entity.Report;
+import org.apache.syncope.persistence.api.entity.ReportExec;
+
+public interface ReportExecDAO extends DAO<ReportExec> {
+
+    ReportExec find(Long key);
+
+    ReportExec findLatestStarted(Report report);
+
+    ReportExec findLatestEnded(Report report);
+
+    List<ReportExec> findAll();
+
+    ReportExec save(ReportExec execution) throws InvalidEntityException;
+
+    void delete(Long key);
+
+    void delete(ReportExec execution);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/RoleDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/RoleDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/RoleDAO.java
new file mode 100644
index 0000000..a45b676
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/RoleDAO.java
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.common.lib.types.PolicyType;
+import org.apache.syncope.persistence.api.dao.search.OrderByClause;
+import org.apache.syncope.persistence.api.dao.validation.InvalidEntityException;
+import org.apache.syncope.persistence.api.entity.Entitlement;
+import org.apache.syncope.persistence.api.entity.ExternalResource;
+import org.apache.syncope.persistence.api.entity.Policy;
+import org.apache.syncope.persistence.api.entity.membership.Membership;
+import org.apache.syncope.persistence.api.entity.role.RDerAttr;
+import org.apache.syncope.persistence.api.entity.role.RNormAttr;
+import org.apache.syncope.persistence.api.entity.role.RNormAttrValue;
+import org.apache.syncope.persistence.api.entity.role.RVirAttr;
+import org.apache.syncope.persistence.api.entity.role.Role;
+
+public interface RoleDAO extends SubjectDAO<RNormAttr, RDerAttr, RVirAttr> {
+
+    Role find(Long key);
+
+    List<Role> find(String name);
+
+    Role find(String name, Long parent);
+
+    List<Role> findOwnedByUser(Long userId);
+
+    List<Role> findOwnedByRole(Long roleId);
+
+    List<Role> findByEntitlement(Entitlement entitlement);
+
+    List<Role> findByPolicy(Policy policy);
+
+    List<Role> findWithoutPolicy(PolicyType type);
+
+    List<Role> findAncestors(Role role);
+
+    List<Role> findChildren(Role role);
+
+    List<Role> findDescendants(Role role);
+
+    List<Role> findByDerAttrValue(String schemaName, String value);
+
+    List<Role> findByAttrValue(String schemaName, RNormAttrValue attrValue);
+
+    Role findByAttrUniqueValue(String schemaName, RNormAttrValue attrUniqueValue);
+
+    List<Role> findByResource(ExternalResource resource);
+
+    List<Role> findAll();
+
+    List<Role> findAll(int page, int itemsPerPage, List<OrderByClause> orderBy);
+
+    List<Membership> findMemberships(Role role);
+
+    int count();
+
+    Role save(Role syncopeRole) throws InvalidEntityException;
+
+    void delete(Role role);
+
+    void delete(Long key);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/SecurityQuestionDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/SecurityQuestionDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/SecurityQuestionDAO.java
new file mode 100644
index 0000000..a1ce799
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/SecurityQuestionDAO.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.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.dao.validation.InvalidEntityException;
+import org.apache.syncope.persistence.api.entity.user.SecurityQuestion;
+
+public interface SecurityQuestionDAO extends DAO<SecurityQuestion> {
+
+    SecurityQuestion find(Long key);
+
+    List<SecurityQuestion> findAll();
+
+    SecurityQuestion save(SecurityQuestion securityQuestion) throws InvalidEntityException;
+
+    void delete(Long key);
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/SubjectDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/SubjectDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/SubjectDAO.java
new file mode 100644
index 0000000..9f8dccc
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/SubjectDAO.java
@@ -0,0 +1,42 @@
+/*
+ * 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.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.entity.AttributableUtil;
+import org.apache.syncope.persistence.api.entity.DerAttr;
+import org.apache.syncope.persistence.api.entity.ExternalResource;
+import org.apache.syncope.persistence.api.entity.NormAttr;
+import org.apache.syncope.persistence.api.entity.NormAttrValue;
+import org.apache.syncope.persistence.api.entity.Subject;
+import org.apache.syncope.persistence.api.entity.VirAttr;
+
+public interface SubjectDAO<N extends NormAttr, D extends DerAttr<N>, V extends VirAttr> extends DAO<Subject<N, D, V>> {
+
+    <T extends Subject<N, D, V>> List<T> findByAttrValue(String schemaName,
+            NormAttrValue attrValue, AttributableUtil attrUtil);
+
+    <T extends Subject<N, D, V>> T findByAttrUniqueValue(String schemaName,
+            NormAttrValue attrUniqueValue, AttributableUtil attrUtil);
+
+    <T extends Subject<N, D, V>> List<T> findByDerAttrValue(
+            String schemaName, String value, AttributableUtil attrUtil);
+
+    <T extends Subject<N, D, V>> List<T> findByResource(ExternalResource resource, Class<T> reference);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/SubjectSearchDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/SubjectSearchDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/SubjectSearchDAO.java
new file mode 100644
index 0000000..b9cc194
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/SubjectSearchDAO.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.persistence.api.dao;
+
+import java.util.List;
+import java.util.Set;
+import org.apache.syncope.common.lib.types.SubjectType;
+import org.apache.syncope.persistence.api.dao.search.OrderByClause;
+import org.apache.syncope.persistence.api.dao.search.SearchCond;
+import org.apache.syncope.persistence.api.entity.Subject;
+
+public interface SubjectSearchDAO extends DAO<Subject<?, ?, ?>> {
+
+    /**
+     * @param adminRoles the set of admin roles owned by the caller
+     * @param searchCondition the search condition
+     * @param type user or role
+     * @return size of search result
+     */
+    int count(Set<Long> adminRoles, SearchCond searchCondition, SubjectType type);
+
+    /**
+     * @param adminRoles the set of admin roles owned by the caller
+     * @param searchCondition the search condition
+     * @param type user or role
+     * @param <T> user/role
+     * @return the list of users/roles matching the given search condition
+     */
+    <T extends Subject<?, ?, ?>> List<T> search(Set<Long> adminRoles, SearchCond searchCondition, SubjectType type);
+
+    /**
+     * @param adminRoles the set of admin roles owned by the caller
+     * @param searchCondition the search condition
+     * @param orderBy list of ordering clauses
+     * @param type user or role
+     * @param <T> user/role
+     * @return the list of users/roles matching the given search condition
+     */
+    <T extends Subject<?, ?, ?>> List<T> search(Set<Long> adminRoles, SearchCond searchCondition,
+            List<OrderByClause> orderBy, SubjectType type);
+
+    /**
+     * @param adminRoles the set of admin roles owned by the caller
+     * @param searchCondition the search condition
+     * @param page position of the first result, start from 1
+     * @param itemsPerPage number of results per page
+     * @param orderBy list of ordering clauses
+     * @param type user or role
+     * @param <T> user/role
+     * @return the list of users/roles matching the given search condition (in the given page)
+     */
+    <T extends Subject<?, ?, ?>> List<T> search(Set<Long> adminRoles, SearchCond searchCondition,
+            int page, int itemsPerPage, List<OrderByClause> orderBy, SubjectType type);
+
+    /**
+     * Verify if user/role matches the given search condition.
+     *
+     * @param subject to be checked
+     * @param searchCondition to be verified
+     * @param type user or role
+     * @param <T> user/role
+     * @return true if user/role matches searchCondition
+     */
+    <T extends Subject<?, ?, ?>> boolean matches(T subject, SearchCond searchCondition, SubjectType type);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/TaskDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/TaskDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/TaskDAO.java
new file mode 100644
index 0000000..5ab5b6a
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/TaskDAO.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.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.dao.search.OrderByClause;
+import org.apache.syncope.persistence.api.dao.validation.InvalidEntityException;
+import org.apache.syncope.persistence.api.entity.ExternalResource;
+import org.apache.syncope.persistence.api.entity.task.Task;
+
+public interface TaskDAO extends DAO<Task> {
+
+    <T extends Task> T find(Long key);
+
+    <T extends Task> List<T> findToExec(Class<T> reference);
+
+    <T extends Task> List<T> findAll(ExternalResource resource, Class<T> reference);
+
+    <T extends Task> List<T> findAll(Class<T> reference);
+
+    <T extends Task> List<T> findAll(
+            int page, int itemsPerPage, List<OrderByClause> orderByClauses, Class<T> reference);
+
+    <T extends Task> int count(Class<T> reference);
+
+    <T extends Task> T save(T task) throws InvalidEntityException;
+
+    <T extends Task> void delete(Long key);
+
+    <T extends Task> void delete(T task);
+
+    <T extends Task> void deleteAll(ExternalResource resource, Class<T> reference);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/TaskExecDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/TaskExecDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/TaskExecDAO.java
new file mode 100644
index 0000000..05224b4
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/TaskExecDAO.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.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.dao.validation.InvalidEntityException;
+import org.apache.syncope.persistence.api.entity.task.Task;
+import org.apache.syncope.persistence.api.entity.task.TaskExec;
+
+public interface TaskExecDAO extends DAO<TaskExec> {
+
+    TaskExec find(Long key);
+
+    <T extends Task> TaskExec findLatestStarted(T task);
+
+    <T extends Task> TaskExec findLatestEnded(T task);
+
+    <T extends Task> List<TaskExec> findAll(Class<T> reference);
+
+    TaskExec save(TaskExec execution) throws InvalidEntityException;
+
+    void saveAndAdd(Long taskId, TaskExec execution) throws InvalidEntityException;
+
+    void delete(Long key);
+
+    void delete(TaskExec execution);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/UserDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/UserDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/UserDAO.java
new file mode 100644
index 0000000..f70be0a
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/UserDAO.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.persistence.api.dao;
+
+import java.util.List;
+import java.util.Set;
+import org.apache.syncope.persistence.api.dao.search.OrderByClause;
+import org.apache.syncope.persistence.api.dao.validation.InvalidEntityException;
+import org.apache.syncope.persistence.api.entity.ExternalResource;
+import org.apache.syncope.persistence.api.entity.user.SecurityQuestion;
+import org.apache.syncope.persistence.api.entity.user.UDerAttr;
+import org.apache.syncope.persistence.api.entity.user.UNormAttr;
+import org.apache.syncope.persistence.api.entity.user.UNormAttrValue;
+import org.apache.syncope.persistence.api.entity.user.UVirAttr;
+import org.apache.syncope.persistence.api.entity.user.User;
+
+public interface UserDAO extends SubjectDAO<UNormAttr, UDerAttr, UVirAttr> {
+
+    User find(Long key);
+
+    User find(String username);
+
+    User findByWorkflowId(String workflowId);
+
+    User findByToken(String token);
+
+    List<User> findBySecurityQuestion(SecurityQuestion securityQuestion);
+
+    List<User> findByDerAttrValue(String schemaName, String value);
+
+    List<User> findByAttrValue(String schemaName, UNormAttrValue attrValue);
+
+    User findByAttrUniqueValue(String schemaName, UNormAttrValue attrUniqueValue);
+
+    List<User> findByResource(ExternalResource resource);
+
+    List<User> findAll(Set<Long> adminRoles, int page, int itemsPerPage);
+
+    List<User> findAll(Set<Long> adminRoles, int page, int itemsPerPage, List<OrderByClause> orderBy);
+
+    int count(Set<Long> adminRoles);
+
+    User save(User user) throws InvalidEntityException;
+
+    void delete(Long key);
+
+    void delete(User user);
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/VirAttrDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/VirAttrDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/VirAttrDAO.java
new file mode 100644
index 0000000..7cae917
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/VirAttrDAO.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.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.dao.validation.InvalidEntityException;
+import org.apache.syncope.persistence.api.entity.VirAttr;
+
+public interface VirAttrDAO extends DAO<VirAttr> {
+
+    <T extends VirAttr> T find(Long key, Class<T> reference);
+
+    <T extends VirAttr> List<T> findAll(Class<T> reference);
+
+    <T extends VirAttr> T save(T virtualAttribute) throws InvalidEntityException;
+
+    <T extends VirAttr> void delete(Long key, Class<T> reference);
+
+    <T extends VirAttr> void delete(T virAttr);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/VirSchemaDAO.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/VirSchemaDAO.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/VirSchemaDAO.java
new file mode 100644
index 0000000..a53a9b7
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/VirSchemaDAO.java
@@ -0,0 +1,37 @@
+/*
+ * 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.persistence.api.dao;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.dao.validation.InvalidEntityException;
+import org.apache.syncope.persistence.api.entity.AttributableUtil;
+import org.apache.syncope.persistence.api.entity.VirSchema;
+
+public interface VirSchemaDAO extends DAO<VirSchema> {
+
+    <T extends VirSchema> T find(String key, Class<T> reference);
+
+    <T extends VirSchema> List<T> findAll(Class<T> reference);
+
+    <T extends VirSchema> List<T> findAttrs(VirSchema virSchema, Class<T> reference);
+
+    <T extends VirSchema> T save(T virSchema) throws InvalidEntityException;
+
+    void delete(String key, AttributableUtil attributableUtil);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/AbstractSearchCond.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/AbstractSearchCond.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/AbstractSearchCond.java
new file mode 100644
index 0000000..096f2b7
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/AbstractSearchCond.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.persistence.api.dao.search;
+
+import java.io.Serializable;
+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;
+
+public abstract class AbstractSearchCond implements Serializable {
+
+    private static final long serialVersionUID = 5376869884544910804L;
+
+    @Override
+    public boolean equals(final Object obj) {
+        return EqualsBuilder.reflectionEquals(this, obj);
+    }
+
+    @Override
+    public int hashCode() {
+        return HashCodeBuilder.reflectionHashCode(this);
+    }
+
+    @Override
+    public String toString() {
+        return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+    }
+
+    public abstract boolean isValid();
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/AttributeCond.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/AttributeCond.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/AttributeCond.java
new file mode 100644
index 0000000..7ca3a30
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/AttributeCond.java
@@ -0,0 +1,84 @@
+/*
+ * 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.persistence.api.dao.search;
+
+/**
+ * Search condition to be applied when comparing attribute values.
+ */
+public class AttributeCond extends AbstractSearchCond {
+
+    private static final long serialVersionUID = 3275277728404021417L;
+
+    public enum Type {
+
+        LIKE,
+        EQ,
+        GT,
+        LT,
+        GE,
+        LE,
+        ISNULL,
+        ISNOTNULL
+
+    }
+
+    private Type type;
+
+    private String schema;
+
+    private String expression;
+
+    public AttributeCond() {
+        super();
+    }
+
+    public AttributeCond(final Type conditionType) {
+        super();
+        this.type = conditionType;
+    }
+
+    public final String getExpression() {
+        return expression;
+    }
+
+    public final void setExpression(final String conditionExpression) {
+        this.expression = conditionExpression;
+    }
+
+    public final String getSchema() {
+        return schema;
+    }
+
+    public final void setSchema(final String conditionSchema) {
+        this.schema = conditionSchema;
+    }
+
+    public final Type getType() {
+        return type;
+    }
+
+    public final void setType(final Type conditionType) {
+        this.type = conditionType;
+    }
+
+    @Override
+    public final boolean isValid() {
+        return type != null && schema != null && (type == Type.ISNULL || type == Type.ISNOTNULL || expression != null);
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/EntitlementCond.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/EntitlementCond.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/EntitlementCond.java
new file mode 100644
index 0000000..809e275
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/EntitlementCond.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.persistence.api.dao.search;
+
+public class EntitlementCond extends AbstractSearchCond {
+
+    private static final long serialVersionUID = -4077781080368377428L;
+
+    private String expression;
+
+    public String getExpression() {
+        return expression;
+    }
+
+    public void setExpression(final String expression) {
+        this.expression = expression;
+    }
+
+    @Override
+    public boolean isValid() {
+        return expression != null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/MembershipCond.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/MembershipCond.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/MembershipCond.java
new file mode 100644
index 0000000..0036b1b
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/dao/search/MembershipCond.java
@@ -0,0 +1,46 @@
+/*
+ * 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.persistence.api.dao.search;
+
+/**
+ * Search condition to be applied when searching for memberships.
+ */
+public class MembershipCond extends AbstractSearchCond {
+
+    private static final long serialVersionUID = -728155256293925989L;
+
+    private Long roleId;
+
+    public MembershipCond() {
+        super();
+    }
+
+    public Long getRoleId() {
+        return roleId;
+    }
+
+    public void setRoleId(final Long roleId) {
+        this.roleId = roleId;
+    }
+
+    @Override
+    public final boolean isValid() {
+        return roleId != null;
+    }
+}


[6/6] syncope git commit: [SYNCOPE-620] persistence-api and common-lib

Posted by il...@apache.org.
[SYNCOPE-620] persistence-api and common-lib


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

Branch: refs/heads/2_0_X
Commit: c73a73b0977f51033c9690cda570d6f02a047b73
Parents: 8fe7f5c
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Dec 23 17:56:19 2014 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Dec 23 17:56:19 2014 +0100

----------------------------------------------------------------------
 syncope620/common/lib/pom.xml                   |  52 +++
 .../common/lib/annotation/ClassList.java        |  26 ++
 .../common/lib/annotation/SchemaList.java       |  28 ++
 .../common/lib/report/ReportletConf.java        |  32 ++
 .../lib/types/AbstractCommonsLangType.java      |  47 +++
 .../common/lib/types/AccountPolicySpec.java     | 188 +++++++++
 .../common/lib/types/AttrSchemaType.java        |  51 +++
 .../common/lib/types/AttributableType.java      |  31 ++
 .../common/lib/types/CipherAlgorithm.java       |  54 +++
 .../lib/types/ConflictResolutionAction.java     |  34 ++
 .../common/lib/types/ConnConfPropSchema.java    | 122 ++++++
 .../common/lib/types/ConnConfProperty.java      |  69 ++++
 .../common/lib/types/ConnectorCapability.java   |  39 ++
 .../common/lib/types/EntityViolationType.java   |  72 ++++
 .../common/lib/types/IntMappingType.java        | 201 ++++++++++
 .../syncope/common/lib/types/LoggerLevel.java   |  49 +++
 .../syncope/common/lib/types/LoggerType.java    |  46 +++
 .../common/lib/types/MappingPurpose.java        |  28 ++
 .../syncope/common/lib/types/MatchingRule.java  |  54 +++
 .../common/lib/types/PasswordPolicySpec.java    | 367 +++++++++++++++++
 .../syncope/common/lib/types/PolicySpec.java    |  23 ++
 .../syncope/common/lib/types/PolicyType.java    |  61 +++
 .../common/lib/types/PropagationMode.java       |  29 ++
 .../common/lib/types/ReportExecStatus.java      |  34 ++
 .../common/lib/types/ResourceOperation.java     |  31 ++
 .../syncope/common/lib/types/SubjectType.java   |  34 ++
 .../common/lib/types/SyncPolicySpec.java        |  97 +++++
 .../syncope/common/lib/types/TraceLevel.java    |  43 ++
 .../common/lib/types/UnmatchingRule.java        |  47 +++
 syncope620/common/pom.xml                       |  40 ++
 syncope620/pom.xml                              | 401 +++++++++++++++++++
 syncope620/server/persistence-api/pom.xml       |  54 +++
 .../persistence/api/dao/AttrTemplateDAO.java    |  34 ++
 .../syncope/persistence/api/dao/ConfDAO.java    |  35 ++
 .../apache/syncope/persistence/api/dao/DAO.java |  32 ++
 .../syncope/persistence/api/dao/DerAttrDAO.java |  37 ++
 .../persistence/api/dao/DerSchemaDAO.java       |  39 ++
 .../persistence/api/dao/EntitlementDAO.java     |  39 ++
 .../api/dao/ExternalResourceDAO.java            |  47 +++
 .../syncope/persistence/api/dao/LoggerDAO.java  |  37 ++
 .../persistence/api/dao/MembershipDAO.java      |  38 ++
 .../persistence/api/dao/NormAttrDAO.java        |  30 ++
 .../persistence/api/dao/NormAttrValueDAO.java   |  36 ++
 .../persistence/api/dao/NormSchemaDAO.java      |  38 ++
 .../persistence/api/dao/NotFoundException.java  |  35 ++
 .../persistence/api/dao/NotificationDAO.java    |  34 ++
 .../syncope/persistence/api/dao/PolicyDAO.java  |  48 +++
 .../syncope/persistence/api/dao/ReportDAO.java  |  41 ++
 .../persistence/api/dao/ReportExecDAO.java      |  41 ++
 .../syncope/persistence/api/dao/RoleDAO.java    |  80 ++++
 .../api/dao/SecurityQuestionDAO.java            |  35 ++
 .../syncope/persistence/api/dao/SubjectDAO.java |  42 ++
 .../persistence/api/dao/SubjectSearchDAO.java   |  81 ++++
 .../syncope/persistence/api/dao/TaskDAO.java    |  49 +++
 .../persistence/api/dao/TaskExecDAO.java        |  43 ++
 .../syncope/persistence/api/dao/UserDAO.java    |  65 +++
 .../syncope/persistence/api/dao/VirAttrDAO.java |  36 ++
 .../persistence/api/dao/VirSchemaDAO.java       |  37 ++
 .../api/dao/search/AbstractSearchCond.java      |  48 +++
 .../api/dao/search/AttributeCond.java           |  84 ++++
 .../api/dao/search/EntitlementCond.java         |  39 ++
 .../api/dao/search/MembershipCond.java          |  46 +++
 .../api/dao/search/OrderByClause.java           |  69 ++++
 .../api/dao/search/ResourceCond.java            |  42 ++
 .../persistence/api/dao/search/SearchCond.java  | 254 ++++++++++++
 .../persistence/api/dao/search/SubjectCond.java |  34 ++
 .../dao/validation/InvalidEntityException.java  | 129 ++++++
 .../InvalidNormAttrValueException.java          |  43 ++
 .../validation/ParsingValidationException.java  |  30 ++
 .../api/dao/validation/Validator.java           |  26 ++
 .../persistence/api/entity/AccountPolicy.java   |  35 ++
 .../persistence/api/entity/AnnotatedEntity.java |  40 ++
 .../syncope/persistence/api/entity/Attr.java    |  30 ++
 .../persistence/api/entity/AttrTemplate.java    |  32 ++
 .../persistence/api/entity/Attributable.java    |  48 +++
 .../api/entity/AttributableUtil.java            |  85 ++++
 .../persistence/api/entity/ConnInstance.java    |  75 ++++
 .../persistence/api/entity/ConnPoolConf.java    |  42 ++
 .../syncope/persistence/api/entity/DerAttr.java |  26 ++
 .../persistence/api/entity/DerSchema.java       |  26 ++
 .../persistence/api/entity/Entitlement.java     |  29 ++
 .../syncope/persistence/api/entity/Entity.java  |  24 ++
 .../syncope/persistence/api/entity/Exec.java    |  45 +++
 .../api/entity/ExternalResource.java            | 115 ++++++
 .../syncope/persistence/api/entity/Logger.java  |  35 ++
 .../syncope/persistence/api/entity/Mapping.java |  44 ++
 .../persistence/api/entity/MappingItem.java     |  57 +++
 .../persistence/api/entity/NormAttr.java        |  37 ++
 .../persistence/api/entity/NormAttrValue.java   |  62 +++
 .../persistence/api/entity/NormSchema.java      |  56 +++
 .../persistence/api/entity/Notification.java    |  88 ++++
 .../persistence/api/entity/PasswordPolicy.java  |  23 ++
 .../syncope/persistence/api/entity/Policy.java  |  35 ++
 .../syncope/persistence/api/entity/Report.java  |  49 +++
 .../persistence/api/entity/ReportExec.java      |  34 ++
 .../syncope/persistence/api/entity/Schema.java  |  47 +++
 .../syncope/persistence/api/entity/Subject.java |  34 ++
 .../persistence/api/entity/SyncPolicy.java      |  23 ++
 .../syncope/persistence/api/entity/VirAttr.java |  32 ++
 .../persistence/api/entity/VirSchema.java       |  23 ++
 .../persistence/api/entity/conf/CNormAttr.java  |  25 ++
 .../persistence/api/entity/conf/Conf.java       |  39 ++
 .../api/entity/membership/MDerAttr.java         |  28 ++
 .../api/entity/membership/MDerAttrTemplate.java |  26 ++
 .../api/entity/membership/MNormAttr.java        |  28 ++
 .../entity/membership/MNormAttrTemplate.java    |  26 ++
 .../api/entity/membership/MNormAttrValue.java   |  25 ++
 .../api/entity/membership/MVirAttr.java         |  28 ++
 .../api/entity/membership/MVirAttrTemplate.java |  26 ++
 .../api/entity/membership/Membership.java       |  71 ++++
 .../persistence/api/entity/role/RDerAttr.java   |  28 ++
 .../api/entity/role/RDerAttrTemplate.java       |  26 ++
 .../persistence/api/entity/role/RMapping.java   |  25 ++
 .../api/entity/role/RMappingItem.java           |  25 ++
 .../persistence/api/entity/role/RNormAttr.java  |  28 ++
 .../api/entity/role/RNormAttrTemplate.java      |  26 ++
 .../api/entity/role/RNormAttrValue.java         |  25 ++
 .../persistence/api/entity/role/RVirAttr.java   |  28 ++
 .../api/entity/role/RVirAttrTemplate.java       |  26 ++
 .../persistence/api/entity/role/Role.java       | 170 ++++++++
 .../api/entity/task/NotificationTask.java       |  57 +++
 .../api/entity/task/PropagationTask.java        |  65 +++
 .../api/entity/task/ProvisioningTask.java       |  58 +++
 .../persistence/api/entity/task/PushTask.java   |  30 ++
 .../persistence/api/entity/task/SchedTask.java  |  38 ++
 .../persistence/api/entity/task/SyncTask.java   |  34 ++
 .../persistence/api/entity/task/Task.java       |  33 ++
 .../persistence/api/entity/task/TaskExec.java   |  28 ++
 .../api/entity/user/SecurityQuestion.java       |  28 ++
 .../persistence/api/entity/user/UDerAttr.java   |  25 ++
 .../persistence/api/entity/user/UMapping.java   |  28 ++
 .../api/entity/user/UMappingItem.java           |  25 ++
 .../persistence/api/entity/user/UNormAttr.java  |  25 ++
 .../api/entity/user/UNormAttrValue.java         |  25 ++
 .../persistence/api/entity/user/UVirAttr.java   |  25 ++
 .../persistence/api/entity/user/User.java       | 152 +++++++
 syncope620/server/pom.xml                       |  41 ++
 137 files changed, 7214 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/pom.xml b/syncope620/common/lib/pom.xml
new file mode 100644
index 0000000..4c9cccc
--- /dev/null
+++ b/syncope620/common/lib/pom.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.syncope</groupId>
+    <artifactId>syncope-common</artifactId>
+    <version>2.0.0-SNAPSHOT</version>
+  </parent>
+
+  <name>Apache Syncope Common Lib</name>
+  <description>Apache Syncope Common Lib</description>
+  <groupId>org.apache.syncope.common</groupId>
+  <artifactId>syncope-lib</artifactId>
+  <packaging>jar</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>com.fasterxml.jackson.core</groupId>
+      <artifactId>jackson-annotations</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-lang3</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-api</artifactId>
+    </dependency>
+  </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/annotation/ClassList.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/annotation/ClassList.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/annotation/ClassList.java
new file mode 100644
index 0000000..07528ea
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/annotation/ClassList.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.common.lib.annotation;
+
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Retention(RUNTIME)
+public @interface ClassList {
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/annotation/SchemaList.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/annotation/SchemaList.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/annotation/SchemaList.java
new file mode 100644
index 0000000..7469731
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/annotation/SchemaList.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.common.lib.annotation;
+
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Retention(RUNTIME)
+public @interface SchemaList {
+
+    boolean extended() default false;
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/report/ReportletConf.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/report/ReportletConf.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/report/ReportletConf.java
new file mode 100644
index 0000000..57bcf52
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/report/ReportletConf.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.common.lib.report;
+
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+
+@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class")
+public interface ReportletConf {
+
+    /**
+     * Give name of related reportlet instance.
+     *
+     * @return name of this reportlet instance
+     */
+    String getName();
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AbstractCommonsLangType.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AbstractCommonsLangType.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AbstractCommonsLangType.java
new file mode 100644
index 0000000..1953010
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AbstractCommonsLangType.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.types;
+
+import java.io.Serializable;
+import javax.xml.bind.annotation.XmlType;
+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;
+
+@XmlType
+public abstract class AbstractCommonsLangType implements Serializable {
+
+    private static final long serialVersionUID = 3119542005279892164L;
+
+    @Override
+    public boolean equals(final Object obj) {
+        return EqualsBuilder.reflectionEquals(this, obj);
+    }
+
+    @Override
+    public int hashCode() {
+        return HashCodeBuilder.reflectionHashCode(this);
+    }
+
+    @Override
+    public String toString() {
+        return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AccountPolicySpec.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AccountPolicySpec.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AccountPolicySpec.java
new file mode 100644
index 0000000..8d5a792
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AccountPolicySpec.java
@@ -0,0 +1,188 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.types;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.annotation.SchemaList;
+
+@XmlType
+public class AccountPolicySpec implements PolicySpec {
+
+    private static final long serialVersionUID = 3259256974414758406L;
+
+    /**
+     * Minimum length.
+     */
+    private int maxLength;
+
+    /**
+     * Maximum length.
+     */
+    private int minLength;
+
+    /**
+     * Pattern (regular expression) that must match.
+     */
+    private String pattern;
+
+    /**
+     * Substrings not permitted.
+     */
+    private List<String> wordsNotPermitted;
+
+    /**
+     * User attribute values not permitted.
+     */
+    @SchemaList
+    private List<String> schemasNotPermitted;
+
+    /**
+     * Substrings not permitted as prefix.
+     */
+    private List<String> prefixesNotPermitted;
+
+    /**
+     * Substrings not permitted as suffix.
+     */
+    private List<String> suffixesNotPermitted;
+
+    /**
+     * Specify if one or more lowercase characters are permitted.
+     */
+    private boolean allUpperCase;
+
+    /**
+     * Specify if one or more uppercase characters are permitted.
+     */
+    private boolean allLowerCase;
+
+    /**
+     * Specify if, when reached the maximum allowed number of subsequent login failures, user shall be suspended.
+     */
+    private boolean propagateSuspension;
+
+    /**
+     * Number of permitted login retries.
+     * 0 disabled; &gt;0 enabled.
+     * If the number of subsequent failed logins will be greater then this value
+     * the account will be suspended (lock-out).
+     */
+    private int permittedLoginRetries;
+
+    public boolean isAllLowerCase() {
+        return allLowerCase;
+    }
+
+    public void setAllLowerCase(final boolean allLowerCase) {
+        this.allLowerCase = allLowerCase;
+    }
+
+    public boolean isAllUpperCase() {
+        return allUpperCase;
+    }
+
+    public void setAllUpperCase(final boolean allUpperCase) {
+        this.allUpperCase = allUpperCase;
+    }
+
+    public int getMaxLength() {
+        return maxLength;
+    }
+
+    public void setMaxLength(final int maxLength) {
+        this.maxLength = maxLength;
+    }
+
+    public int getMinLength() {
+        return minLength;
+    }
+
+    public void setMinLength(final int minLength) {
+        this.minLength = minLength;
+    }
+
+    public String getPattern() {
+        return pattern;
+    }
+
+    public void setPattern(final String pattern) {
+        this.pattern = pattern;
+    }
+
+    @XmlElementWrapper(name = "prefixesNotPermitted")
+    @XmlElement(name = "prefix")
+    @JsonProperty("prefixesNotPermitted")
+    public List<String> getPrefixesNotPermitted() {
+        if (prefixesNotPermitted == null) {
+            prefixesNotPermitted = new ArrayList<String>();
+        }
+        return prefixesNotPermitted;
+    }
+
+    @XmlElementWrapper(name = "schemasNotPermitted")
+    @XmlElement(name = "schema")
+    @JsonProperty("schemasNotPermitted")
+    public List<String> getSchemasNotPermitted() {
+        if (schemasNotPermitted == null) {
+            schemasNotPermitted = new ArrayList<String>();
+        }
+        return schemasNotPermitted;
+    }
+
+    @XmlElementWrapper(name = "suffixesNotPermitted")
+    @XmlElement(name = "suffix")
+    @JsonProperty("suffixesNotPermitted")
+    public List<String> getSuffixesNotPermitted() {
+        if (suffixesNotPermitted == null) {
+            suffixesNotPermitted = new ArrayList<String>();
+        }
+        return suffixesNotPermitted;
+    }
+
+    @XmlElementWrapper(name = "wordsNotPermitted")
+    @XmlElement(name = "word")
+    @JsonProperty("wordsNotPermitted")
+    public List<String> getWordsNotPermitted() {
+        if (wordsNotPermitted == null) {
+            wordsNotPermitted = new ArrayList<String>();
+        }
+        return wordsNotPermitted;
+    }
+
+    public boolean isPropagateSuspension() {
+        return propagateSuspension;
+    }
+
+    public void setPropagateSuspension(final boolean propagateSuspension) {
+        this.propagateSuspension = propagateSuspension;
+    }
+
+    public int getPermittedLoginRetries() {
+        return permittedLoginRetries;
+    }
+
+    public void setPermittedLoginRetries(final int permittedLoginRetries) {
+        this.permittedLoginRetries = permittedLoginRetries;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AttrSchemaType.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AttrSchemaType.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AttrSchemaType.java
new file mode 100644
index 0000000..2fc937b
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AttrSchemaType.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.common.lib.types;
+
+import java.util.Date;
+import javax.xml.bind.annotation.XmlEnum;
+
+@XmlEnum
+public enum AttrSchemaType {
+
+    String(String.class),
+    Long(Long.class),
+    Double(Double.class),
+    Boolean(Boolean.class),
+    Date(Date.class),
+    Enum(Enum.class),
+    Encrypted(byte[].class),
+    Binary(byte[].class);
+
+    final private Class<?> type;
+
+    AttrSchemaType(final Class<?> type) {
+        this.type = type;
+    }
+
+    public Class<?> getType() {
+        return type;
+    }
+
+    public boolean isConversionPatternNeeded() {
+        return this == AttrSchemaType.Date
+                || this == AttrSchemaType.Double
+                || this == AttrSchemaType.Long;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AttributableType.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AttributableType.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AttributableType.java
new file mode 100644
index 0000000..6b989df
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/AttributableType.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+@XmlEnum
+public enum AttributableType {
+
+    USER,
+    ROLE,
+    MEMBERSHIP,
+    CONFIGURATION;
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/CipherAlgorithm.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/CipherAlgorithm.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/CipherAlgorithm.java
new file mode 100644
index 0000000..af5592e
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/CipherAlgorithm.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+@XmlEnum
+public enum CipherAlgorithm {
+
+    SHA("SHA-1", false),
+    SHA1("SHA-1", false),
+    SHA256("SHA-256", false),
+    SHA512("SHA-512", false),
+    AES("AES", true),
+    SMD5("S-MD5", false),
+    SSHA("S-SHA-1", false),
+    SSHA1("S-SHA-1", false),
+    SSHA256("S-SHA-256", false),
+    SSHA512("S-SHA-512", false),
+    BCRYPT("BCRYPT", false);
+
+    final private String algorithm;
+
+    final private boolean invertible;
+
+    CipherAlgorithm(final String algorithm, final boolean invertible) {
+        this.algorithm = algorithm;
+        this.invertible = invertible;
+    }
+
+    public String getAlgorithm() {
+        return algorithm;
+    }
+
+    public boolean isInvertible() {
+        return invertible;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ConflictResolutionAction.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ConflictResolutionAction.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ConflictResolutionAction.java
new file mode 100644
index 0000000..37308e1
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ConflictResolutionAction.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.common.lib.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+@XmlEnum
+public enum ConflictResolutionAction {
+
+    // ignore sync
+    IGNORE,
+    // sync first matcgh
+    FIRSTMATCH,
+    // sync last match
+    LASTMATCH,
+    // sync all
+    ALL;
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ConnConfPropSchema.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ConnConfPropSchema.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ConnConfPropSchema.java
new file mode 100644
index 0000000..02ca7aa
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ConnConfPropSchema.java
@@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.types;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement
+@XmlType
+public class ConnConfPropSchema extends AbstractCommonsLangType implements Comparable<ConnConfPropSchema> {
+
+    private static final long serialVersionUID = -1976365781005801296L;
+
+    private String name;
+
+    private String displayName;
+
+    private String helpMessage;
+
+    private String type;
+
+    private boolean required;
+
+    private int order;
+
+    private boolean confidential;
+
+    private final List<Object> defaultValues = new ArrayList<>();
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(final String name) {
+        this.name = name;
+    }
+
+    public boolean isRequired() {
+        return required;
+    }
+
+    public void setRequired(final boolean required) {
+        this.required = required;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(final String type) {
+        this.type = type;
+    }
+
+    public String getDisplayName() {
+        return displayName;
+    }
+
+    public void setDisplayName(final String displayName) {
+        this.displayName = displayName;
+    }
+
+    public String getHelpMessage() {
+        return helpMessage;
+    }
+
+    public void setHelpMessage(final String helpMessage) {
+        this.helpMessage = helpMessage;
+    }
+
+    public int getOrder() {
+        return order;
+    }
+
+    public void setOrder(final int order) {
+        this.order = order;
+    }
+
+    public boolean isConfidential() {
+        return confidential;
+    }
+
+    public void setConfidential(final boolean confidential) {
+        this.confidential = confidential;
+    }
+
+    @XmlElementWrapper(name = "defaultValues")
+    @XmlElement(name = "defaultValue")
+    @JsonProperty("defaultValues")
+    public List<Object> getDefaultValues() {
+        return defaultValues;
+    }
+
+    @Override
+    public int compareTo(final ConnConfPropSchema other) {
+        return this.getOrder() > other.getOrder()
+                ? 1
+                : this.getOrder() < other.getOrder()
+                        ? -1
+                        : 0;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ConnConfProperty.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ConnConfProperty.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ConnConfProperty.java
new file mode 100644
index 0000000..13b37b2
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ConnConfProperty.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.types;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.commons.lang3.ObjectUtils;
+
+@XmlRootElement
+@XmlType
+public class ConnConfProperty extends AbstractCommonsLangType implements Comparable<ConnConfProperty> {
+
+    private static final long serialVersionUID = -8391413960221862238L;
+
+    private ConnConfPropSchema schema;
+
+    private final List<Object> values = new ArrayList<>();
+
+    private boolean overridable;
+
+    public ConnConfPropSchema getSchema() {
+        return schema;
+    }
+
+    public void setSchema(final ConnConfPropSchema schema) {
+        this.schema = schema;
+    }
+
+    @XmlElementWrapper(name = "values")
+    @XmlElement(name = "value")
+    @JsonProperty("values")
+    public List<Object> getValues() {
+        return values;
+    }
+
+    public boolean isOverridable() {
+        return overridable;
+    }
+
+    public void setOverridable(final boolean overridable) {
+        this.overridable = overridable;
+    }
+
+    @Override
+    public int compareTo(final ConnConfProperty connConfProperty) {
+        return ObjectUtils.compare(this.getSchema(), connConfProperty.getSchema());
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ConnectorCapability.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ConnectorCapability.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ConnectorCapability.java
new file mode 100644
index 0000000..a0e5781
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ConnectorCapability.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.common.lib.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+/**
+ * Enum of all possible capabilities that a connector instance can expose.
+ */
+@XmlEnum
+public enum ConnectorCapability {
+
+    AUTHENTICATE,
+    ONE_PHASE_CREATE,
+    TWO_PHASES_CREATE,
+    ONE_PHASE_UPDATE,
+    TWO_PHASES_UPDATE,
+    ONE_PHASE_DELETE,
+    TWO_PHASES_DELETE,
+    SEARCH,
+    SYNC;
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/EntityViolationType.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/EntityViolationType.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/EntityViolationType.java
new file mode 100644
index 0000000..2450c56
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/EntityViolationType.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.common.lib.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+@XmlEnum
+public enum EntityViolationType {
+
+    Standard(""),
+    InvalidAccountPolicy("org.apache.syncope.core.validation.accountpolicy"),
+    InvalidConnInstanceLocation("org.apache.syncope.core.validation.conninstance.location"),
+    InvalidConnPoolConf("org.apache.syncope.core.validation.conninstance.poolConf"),
+    InvalidMapping("org.apache.syncope.core.validation.mapping"),
+    InvalidMSchema("org.apache.syncope.core.validation.attrvalue.mSchema"),
+    InvalidMDerSchema("org.apache.syncope.core.validation.attrvalue.mDerSchema"),
+    InvalidMVirSchema("org.apache.syncope.core.validation.attrvalue.mVirSchema"),
+    InvalidName("org.apache.syncope.core.validation.name"),
+    InvalidNotification("org.apache.syncope.core.validation.notification"),
+    InvalidPassword("org.apache.syncope.core.validation.syncopeuser.password"),
+    InvalidPasswordPolicy("org.apache.syncope.core.validation.passwordpolicy"),
+    InvalidPolicy("org.apache.syncope.core.validation.policy"),
+    InvalidPropagationTask("org.apache.syncope.core.validation.propagationtask"),
+    InvalidRSchema("org.apache.syncope.core.validation.attrvalue.rSchema"),
+    InvalidRDerSchema("org.apache.syncope.core.validation.attrvalue.rDerSchema"),
+    InvalidRVirSchema("org.apache.syncope.core.validation.attrvalue.rVirSchema"),
+    InvalidReport("org.apache.syncope.core.validation.report"),
+    InvalidResource("org.apache.syncope.core.validation.externalresource"),
+    InvalidRoleOwner("org.apache.syncope.core.validation.syncoperole.owner"),
+    InvalidSchemaEncrypted("org.apache.syncope.core.validation.schema.encrypted"),
+    InvalidSchemaEnum("org.apache.syncope.core.validation.schema.enum"),
+    InvalidSchemaMultivalueUnique("org.apache.syncope.core.validation.schema.multivalueUnique"),
+    InvalidSchedTask("org.apache.syncope.core.validation.schedtask"),
+    InvalidSyncTask("org.apache.syncope.core.validation.synctask"),
+    InvalidSyncPolicy("org.apache.syncope.core.validation.syncpolicy"),
+    InvalidUSchema("org.apache.syncope.core.validation.attrvalue.uSchema"),
+    InvalidUDerSchema("org.apache.syncope.core.validation.attrvalue.derSchema"),
+    InvalidUVirSchema("org.apache.syncope.core.validation.attrvalue.uVirSchema"),
+    InvalidUsername("org.apache.syncope.core.validation.syncopeuser.username"),
+    InvalidValueList("org.apache.syncope.core.validation.attr.valueList"),
+    MoreThanOneNonNull("org.apache.syncope.core.validation.attrvalue.moreThanOneNonNull");
+
+    private String message;
+
+    EntityViolationType(final String message) {
+        this.message = message;
+    }
+
+    public void setMessage(final String message) {
+        this.message = message;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/IntMappingType.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/IntMappingType.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/IntMappingType.java
new file mode 100644
index 0000000..5fefcc9
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/IntMappingType.java
@@ -0,0 +1,201 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.types;
+
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+/**
+ * Internal attribute mapping type.
+ */
+@XmlEnum
+public enum IntMappingType {
+
+    // Unfortunately enum type cannot be extended ...
+    // -------------------------
+    // User attribute types (the same in UserMappingType)
+    // -------------------------
+    UserSchema(AttributableType.USER),
+    UserDerivedSchema(AttributableType.USER),
+    UserVirtualSchema(AttributableType.USER),
+    UserId(AttributableType.USER),
+    Username(AttributableType.USER),
+    Password(AttributableType.USER),
+    // -------------------------
+    // Role attribute types (the same in RoleMappingType)
+    // -------------------------
+    RoleSchema(AttributableType.ROLE),
+    RoleDerivedSchema(AttributableType.ROLE),
+    RoleVirtualSchema(AttributableType.ROLE),
+    RoleId(AttributableType.ROLE),
+    RoleName(AttributableType.ROLE),
+    RoleOwnerSchema(AttributableType.ROLE),
+    // -------------------------
+    // Membership attribute types (the same in MembershipMappingType)
+    // -------------------------
+    MembershipSchema(AttributableType.MEMBERSHIP),
+    MembershipDerivedSchema(AttributableType.MEMBERSHIP),
+    MembershipVirtualSchema(AttributableType.MEMBERSHIP),
+    MembershipId(AttributableType.MEMBERSHIP);
+
+    private AttributableType attributableType;
+
+    private IntMappingType(final AttributableType attributableType) {
+        this.attributableType = attributableType;
+    }
+
+    public AttributableType getAttributableType() {
+        return attributableType;
+    }
+
+    /**
+     * Get attribute types for a certain attributable type.
+     *
+     * @param attributableType attributable type
+     * @param toBeFiltered types to be filtered from the result.
+     * @return set of attribute types.
+     */
+    public static Set<IntMappingType> getAttributeTypes(
+            final AttributableType attributableType, final Collection<IntMappingType> toBeFiltered) {
+
+        final Set<IntMappingType> res = getAttributeTypes(attributableType);
+        res.removeAll(toBeFiltered);
+
+        return res;
+    }
+
+    /**
+     * Get attribute types for a certain attributable type.
+     *
+     * @param attributableType attributable type
+     * @return set of attribute types.
+     */
+    public static Set<IntMappingType> getAttributeTypes(final AttributableType attributableType) {
+        final EnumSet<?> enumset;
+
+        switch (attributableType) {
+            case ROLE:
+                enumset = EnumSet.allOf(RoleMappingType.class);
+                break;
+
+            case MEMBERSHIP:
+                enumset = EnumSet.allOf(MembershipMappingType.class);
+                break;
+
+            case USER:
+            default:
+                enumset = EnumSet.allOf(UserMappingType.class);
+        }
+
+        final Set<IntMappingType> result = new HashSet<IntMappingType>(enumset.size());
+        for (Object obj : enumset) {
+            result.add(IntMappingType.valueOf(obj.toString()));
+        }
+
+        return result;
+    }
+
+    public static Set<IntMappingType> getEmbedded() {
+        return EnumSet.of(
+                IntMappingType.UserId, IntMappingType.Username, IntMappingType.Password,
+                IntMappingType.RoleId, IntMappingType.RoleName, IntMappingType.RoleOwnerSchema,
+                IntMappingType.MembershipId);
+    }
+
+    /**
+     * Check if attribute type belongs to the specified attributable type set.
+     *
+     * @param attributableType attributable type.
+     * @param type attribute type.
+     * @return true if attribute type belongs to the specified attributable type set.
+     */
+    public static boolean contains(final AttributableType attributableType, final String type) {
+        switch (attributableType) {
+            case ROLE:
+                for (RoleMappingType c : RoleMappingType.values()) {
+                    if (c.name().equals(type)) {
+                        return true;
+                    }
+                }
+                break;
+
+            case MEMBERSHIP:
+                for (MembershipMappingType c : MembershipMappingType.values()) {
+                    if (c.name().equals(type)) {
+                        return true;
+                    }
+                }
+                break;
+
+            case USER:
+            default:
+                for (UserMappingType c : UserMappingType.values()) {
+                    if (c.name().equals(type)) {
+                        return true;
+                    }
+                }
+                break;
+        }
+        return false;
+    }
+
+    /**
+     * User attribute types.
+     */
+    private enum UserMappingType {
+
+        UserSchema,
+        UserDerivedSchema,
+        UserVirtualSchema,
+        UserId,
+        Username,
+        Password;
+
+    }
+
+    /**
+     * Role attribute types.
+     */
+    private enum RoleMappingType {
+
+        RoleSchema,
+        RoleDerivedSchema,
+        RoleVirtualSchema,
+        RoleId,
+        RoleName,
+        RoleOwnerSchema;
+
+    }
+
+    /**
+     * Membership attribute types.
+     */
+    private enum MembershipMappingType {
+
+        MembershipSchema,
+        MembershipDerivedSchema,
+        MembershipVirtualSchema,
+        MembershipId;
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/LoggerLevel.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/LoggerLevel.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/LoggerLevel.java
new file mode 100644
index 0000000..01f7d2e
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/LoggerLevel.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.common.lib.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+import org.apache.logging.log4j.Level;
+
+@XmlEnum
+public enum LoggerLevel {
+
+    OFF(Level.OFF),
+    FATAL(Level.FATAL),
+    ERROR(Level.ERROR),
+    WARN(Level.WARN),
+    INFO(Level.INFO),
+    DEBUG(Level.DEBUG),
+    TRACE(Level.TRACE),
+    ALL(Level.ALL);
+
+    private final Level level;
+
+    LoggerLevel(final Level level) {
+        this.level = level;
+    }
+
+    public Level getLevel() {
+        return level;
+    }
+
+    public static LoggerLevel fromLevel(final Level level) {
+        return LoggerLevel.valueOf(level.name());
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/LoggerType.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/LoggerType.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/LoggerType.java
new file mode 100644
index 0000000..f77ed81
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/LoggerType.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+@XmlEnum
+public enum LoggerType {
+
+    /**
+     * This type describes a common logger used to handle system and application events.
+     */
+    LOG(""),
+    /**
+     * Audit logger only focus on security related events, usually logging how did what and when.
+     * In case of a security incident audit loggers should allow an administrator to recall all
+     * actions a certain user has done.
+     */
+    AUDIT("syncope.audit");
+
+    private String prefix;
+
+    LoggerType(final String prefix) {
+        this.prefix = prefix;
+    }
+
+    public String getPrefix() {
+        return prefix;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/MappingPurpose.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/MappingPurpose.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/MappingPurpose.java
new file mode 100644
index 0000000..dc8c23e
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/MappingPurpose.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.common.lib.types;
+
+public enum MappingPurpose {
+
+    BOTH,
+    SYNCHRONIZATION,
+    PROPAGATION,
+    NONE
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/MatchingRule.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/MatchingRule.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/MatchingRule.java
new file mode 100644
index 0000000..39764d9
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/MatchingRule.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+/**
+ * Sync/Push task matching rule.
+ */
+@XmlEnum
+public enum MatchingRule {
+
+    /**
+     * Do not perform any action.
+     */
+    IGNORE,
+    /**
+     * Update matching entity.
+     */
+    UPDATE,
+    /**
+     * Delete resource entity.
+     */
+    DEPROVISION,
+    /**
+     * Unlink resource and delete resource entity.
+     */
+    UNASSIGN,
+    /**
+     * Just unlink resource without performing any (de-)provisioning operation.
+     */
+    UNLINK,
+    /**
+     * Just link resource without performing any (de-)provisioning operation.
+     */
+    LINK
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PasswordPolicySpec.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PasswordPolicySpec.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PasswordPolicySpec.java
new file mode 100644
index 0000000..448fceb
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PasswordPolicySpec.java
@@ -0,0 +1,367 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.types;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.annotation.SchemaList;
+
+@XmlType
+public class PasswordPolicySpec implements PolicySpec {
+
+    private static final long serialVersionUID = -7988778083915548547L;
+
+    /**
+     * History length.
+     */
+    private int historyLength;
+
+    /**
+     * Minimum length.
+     */
+    private int maxLength;
+
+    /**
+     * Maximum length.
+     */
+    private int minLength;
+
+    /**
+     * Substrings not permitted.
+     */
+    private List<String> wordsNotPermitted;
+
+    /**
+     * User attribute values not permitted.
+     */
+    @SchemaList
+    private List<String> schemasNotPermitted;
+
+    /**
+     * Specify if one or more non alphanumeric characters are required.
+     */
+    private boolean nonAlphanumericRequired;
+
+    /**
+     * Specify if one or more alphanumeric characters are required.
+     */
+    private boolean alphanumericRequired;
+
+    /**
+     * Specify if one or more digits are required.
+     */
+    private boolean digitRequired;
+
+    /**
+     * Specify if one or more lowercase alphabetic characters are required.
+     */
+    private boolean lowercaseRequired;
+
+    /**
+     * Specify if one or more uppercase alphabetic characters are required.
+     */
+    private boolean uppercaseRequired;
+
+    /**
+     * Specify if must start with a digit.
+     */
+    private boolean mustStartWithDigit;
+
+    /**
+     * Specify if mustn't start with a digit.
+     */
+    private boolean mustntStartWithDigit;
+
+    /**
+     * Specify if must end with a digit.
+     */
+    private boolean mustEndWithDigit;
+
+    /**
+     * Specify if mustn't end with a digit.
+     */
+    private boolean mustntEndWithDigit;
+
+    /**
+     * Specify if must start with a non alphanumeric character.
+     */
+    private boolean mustStartWithNonAlpha;
+
+    /**
+     * Specify if must start with a alphanumeric character.
+     */
+    private boolean mustStartWithAlpha;
+
+    /**
+     * Specify if mustn't start with a non alphanumeric character.
+     */
+    private boolean mustntStartWithNonAlpha;
+
+    /**
+     * Specify if mustn't start with a alphanumeric character.
+     */
+    private boolean mustntStartWithAlpha;
+
+    /**
+     * Specify if must end with a non alphanumeric character.
+     */
+    private boolean mustEndWithNonAlpha;
+
+    /**
+     * Specify if must end with a alphanumeric character.
+     */
+    private boolean mustEndWithAlpha;
+
+    /**
+     * Specify if mustn't end with a non alphanumeric character.
+     */
+    private boolean mustntEndWithNonAlpha;
+
+    /**
+     * Specify if mustn't end with a alphanumeric character.
+     */
+    private boolean mustntEndWithAlpha;
+
+    /**
+     * Specify if password shall not be stored internally.
+     */
+    private boolean allowNullPassword;
+
+    /**
+     * Substrings not permitted as prefix.
+     */
+    private List<String> prefixesNotPermitted;
+
+    /**
+     * Substrings not permitted as suffix.
+     */
+    private List<String> suffixesNotPermitted;
+
+    public boolean isDigitRequired() {
+        return digitRequired;
+    }
+
+    public void setDigitRequired(final boolean digitRequired) {
+        this.digitRequired = digitRequired;
+    }
+
+    public boolean isLowercaseRequired() {
+        return lowercaseRequired;
+    }
+
+    public void setLowercaseRequired(final boolean lowercaseRequired) {
+        this.lowercaseRequired = lowercaseRequired;
+    }
+
+    public int getMaxLength() {
+        return maxLength;
+    }
+
+    public void setMaxLength(final int maxLength) {
+        this.maxLength = maxLength;
+    }
+
+    public int getMinLength() {
+        return minLength;
+    }
+
+    public void setMinLength(final int minLength) {
+        this.minLength = minLength;
+    }
+
+    public boolean isMustEndWithDigit() {
+        return mustEndWithDigit;
+    }
+
+    public void setMustEndWithDigit(final boolean mustEndWithDigit) {
+        this.mustEndWithDigit = mustEndWithDigit;
+    }
+
+    public boolean isMustEndWithNonAlpha() {
+        return mustEndWithNonAlpha;
+    }
+
+    public void setMustEndWithNonAlpha(final boolean mustEndWithNonAlpha) {
+        this.mustEndWithNonAlpha = mustEndWithNonAlpha;
+    }
+
+    public boolean isMustStartWithDigit() {
+        return mustStartWithDigit;
+    }
+
+    public void setMustStartWithDigit(final boolean mustStartWithDigit) {
+        this.mustStartWithDigit = mustStartWithDigit;
+    }
+
+    public boolean isMustStartWithNonAlpha() {
+        return mustStartWithNonAlpha;
+    }
+
+    public void setMustStartWithNonAlpha(final boolean mustStartWithNonAlpha) {
+        this.mustStartWithNonAlpha = mustStartWithNonAlpha;
+    }
+
+    public boolean isMustntEndWithDigit() {
+        return mustntEndWithDigit;
+    }
+
+    public void setMustntEndWithDigit(final boolean mustntEndWithDigit) {
+        this.mustntEndWithDigit = mustntEndWithDigit;
+    }
+
+    public boolean isMustntEndWithNonAlpha() {
+        return mustntEndWithNonAlpha;
+    }
+
+    public void setMustntEndWithNonAlpha(final boolean mustntEndWithNonAlpha) {
+        this.mustntEndWithNonAlpha = mustntEndWithNonAlpha;
+    }
+
+    public boolean isMustntStartWithDigit() {
+        return mustntStartWithDigit;
+    }
+
+    public void setMustntStartWithDigit(final boolean mustntStartWithDigit) {
+        this.mustntStartWithDigit = mustntStartWithDigit;
+    }
+
+    public boolean isMustntStartWithNonAlpha() {
+        return mustntStartWithNonAlpha;
+    }
+
+    public void setMustntStartWithNonAlpha(final boolean mustntStartWithNonAlpha) {
+        this.mustntStartWithNonAlpha = mustntStartWithNonAlpha;
+    }
+
+    public boolean isNonAlphanumericRequired() {
+        return nonAlphanumericRequired;
+    }
+
+    public void setNonAlphanumericRequired(final boolean nonAlphanumericRequired) {
+        this.nonAlphanumericRequired = nonAlphanumericRequired;
+    }
+
+    @XmlElementWrapper(name = "prefixesNotPermitted")
+    @XmlElement(name = "prefix")
+    @JsonProperty("prefixesNotPermitted")
+    public List<String> getPrefixesNotPermitted() {
+        if (prefixesNotPermitted == null) {
+            prefixesNotPermitted = new ArrayList<String>();
+        }
+        return prefixesNotPermitted;
+    }
+
+    @XmlElementWrapper(name = "schemasNotPermitted")
+    @XmlElement(name = "schema")
+    @JsonProperty("schemasNotPermitted")
+    public List<String> getSchemasNotPermitted() {
+        if (schemasNotPermitted == null) {
+            schemasNotPermitted = new ArrayList<String>();
+        }
+        return schemasNotPermitted;
+    }
+
+    @XmlElementWrapper(name = "suffixesNotPermitted")
+    @XmlElement(name = "suffix")
+    @JsonProperty("suffixesNotPermitted")
+    public List<String> getSuffixesNotPermitted() {
+        if (suffixesNotPermitted == null) {
+            suffixesNotPermitted = new ArrayList<String>();
+        }
+        return suffixesNotPermitted;
+    }
+
+    public boolean isUppercaseRequired() {
+        return uppercaseRequired;
+    }
+
+    public void setUppercaseRequired(final boolean uppercaseRequired) {
+        this.uppercaseRequired = uppercaseRequired;
+    }
+
+    @XmlElementWrapper(name = "wordsNotPermitted")
+    @XmlElement(name = "word")
+    @JsonProperty("wordsNotPermitted")
+    public List<String> getWordsNotPermitted() {
+        if (wordsNotPermitted == null) {
+            wordsNotPermitted = new ArrayList<String>();
+        }
+        return wordsNotPermitted;
+    }
+
+    public boolean isAlphanumericRequired() {
+        return alphanumericRequired;
+    }
+
+    public void setAlphanumericRequired(final boolean alphanumericRequired) {
+        this.alphanumericRequired = alphanumericRequired;
+    }
+
+    public boolean isMustEndWithAlpha() {
+        return mustEndWithAlpha;
+    }
+
+    public void setMustEndWithAlpha(final boolean mustEndWithAlpha) {
+        this.mustEndWithAlpha = mustEndWithAlpha;
+    }
+
+    public boolean isMustStartWithAlpha() {
+        return mustStartWithAlpha;
+    }
+
+    public void setMustStartWithAlpha(final boolean mustStartWithAlpha) {
+        this.mustStartWithAlpha = mustStartWithAlpha;
+    }
+
+    public boolean isMustntEndWithAlpha() {
+        return mustntEndWithAlpha;
+    }
+
+    public void setMustntEndWithAlpha(final boolean mustntEndWithAlpha) {
+        this.mustntEndWithAlpha = mustntEndWithAlpha;
+    }
+
+    public boolean isMustntStartWithAlpha() {
+        return mustntStartWithAlpha;
+    }
+
+    public void setMustntStartWithAlpha(final boolean mustntStartWithAlpha) {
+        this.mustntStartWithAlpha = mustntStartWithAlpha;
+    }
+
+    public int getHistoryLength() {
+        return historyLength;
+    }
+
+    public void setHistoryLength(final int historyLength) {
+        this.historyLength = historyLength;
+    }
+
+    public boolean isAllowNullPassword() {
+        return allowNullPassword;
+    }
+
+    public void setAllowNullPassword(final boolean allowNullPassword) {
+        this.allowNullPassword = allowNullPassword;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PolicySpec.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PolicySpec.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PolicySpec.java
new file mode 100644
index 0000000..cac7c1c
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PolicySpec.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.types;
+
+public interface PolicySpec {
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PolicyType.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PolicyType.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PolicyType.java
new file mode 100644
index 0000000..a8f12f7
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PolicyType.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+@XmlEnum
+public enum PolicyType {
+
+    /**
+     * Account policy like:
+     * password expire time, change password at first access, ...
+     */
+    ACCOUNT("Account Policy"),
+    GLOBAL_ACCOUNT("Account Global Policy"),
+    /**
+     * Password policy regarding password syntax.
+     */
+    PASSWORD("Password Policy"),
+    GLOBAL_PASSWORD("Password Global Policy"),
+    /**
+     * SYNC policy regarding account conflicts resolution.
+     */
+    SYNC("Synchronization Policy"),
+    GLOBAL_SYNC("Synchronization Global Policy"),
+    /**
+     * PUSH policy regarding account conflicts resolution.
+     */
+    PUSH("Push Policy"),
+    GLOBAL_PUSH("Push Global Policy");
+
+    private String description;
+
+    PolicyType(final String description) {
+        this.description = description;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public static PolicyType fromString(final String value) {
+        return PolicyType.valueOf(value.toUpperCase());
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PropagationMode.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PropagationMode.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PropagationMode.java
new file mode 100644
index 0000000..8b10bc8
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/PropagationMode.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+@XmlEnum
+public enum PropagationMode {
+
+    ONE_PHASE,
+    TWO_PHASES
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ReportExecStatus.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ReportExecStatus.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ReportExecStatus.java
new file mode 100644
index 0000000..2fe42ed
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ReportExecStatus.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.common.lib.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+@XmlEnum
+public enum ReportExecStatus {
+
+    STARTED,
+    RUNNING,
+    SUCCESS,
+    FAILURE;
+
+    public static ReportExecStatus fromString(final String value) {
+        return ReportExecStatus.valueOf(value.toUpperCase());
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ResourceOperation.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ResourceOperation.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ResourceOperation.java
new file mode 100644
index 0000000..b399b17
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/ResourceOperation.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+@XmlEnum
+public enum ResourceOperation {
+
+    CREATE,
+    UPDATE,
+    DELETE,
+    NONE
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/SubjectType.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/SubjectType.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/SubjectType.java
new file mode 100644
index 0000000..0acd314
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/SubjectType.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.common.lib.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+@XmlEnum
+public enum SubjectType {
+
+    USER,
+    ROLE;
+
+    public AttributableType asAttributableType() {
+        return this == USER
+                ? AttributableType.USER
+                : AttributableType.ROLE;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/SyncPolicySpec.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/SyncPolicySpec.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/SyncPolicySpec.java
new file mode 100644
index 0000000..9894b9b
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/SyncPolicySpec.java
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.types;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.annotation.ClassList;
+import org.apache.syncope.common.lib.annotation.SchemaList;
+
+@XmlType
+public class SyncPolicySpec implements PolicySpec {
+
+    private static final long serialVersionUID = -3144027171719498127L;
+
+    /**
+     * SyncopeUser attributes and fields for matching during synchronization.
+     */
+    @SchemaList(extended = true)
+    private final List<String> uAltSearchSchemas = new ArrayList<String>();
+
+    @ClassList
+    private String userJavaRule;
+
+    /**
+     * SyncopeRole attributes and fields for matching during synchronization.
+     */
+    @SchemaList(extended = true)
+    private final List<String> rAltSearchSchemas = new ArrayList<String>();
+
+    @ClassList
+    private String roleJavaRule;
+
+    /**
+     * Conflict resolution action.
+     */
+    private ConflictResolutionAction conflictResolutionAction;
+
+    public ConflictResolutionAction getConflictResolutionAction() {
+        return conflictResolutionAction == null
+                ? ConflictResolutionAction.IGNORE
+                : conflictResolutionAction;
+    }
+
+    public void setConflictResolutionAction(final ConflictResolutionAction conflictResolutionAction) {
+        this.conflictResolutionAction = conflictResolutionAction;
+    }
+
+    @XmlElementWrapper(name = "userAltSearchSchemas")
+    @XmlElement(name = "userAltSearchSchema")
+    @JsonProperty("userAltSearchSchemas")
+    public List<String> getuAltSearchSchemas() {
+        return uAltSearchSchemas;
+    }
+
+    @XmlElementWrapper(name = "roleAltSearchSchemas")
+    @XmlElement(name = "roleAltSearchSchema")
+    @JsonProperty("roleAltSearchSchemas")
+    public List<String> getrAltSearchSchemas() {
+        return rAltSearchSchemas;
+    }
+
+    public String getRoleJavaRule() {
+        return roleJavaRule;
+    }
+
+    public void setRoleJavaRule(final String roleJavaRule) {
+        this.roleJavaRule = roleJavaRule;
+    }
+
+    public String getUserJavaRule() {
+        return userJavaRule;
+    }
+
+    public void setUserJavaRule(final String userJavaRule) {
+        this.userJavaRule = userJavaRule;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/TraceLevel.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/TraceLevel.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/TraceLevel.java
new file mode 100644
index 0000000..e8232b8
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/TraceLevel.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.common.lib.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+@XmlEnum
+public enum TraceLevel {
+
+    /**
+     * No details at all.
+     */
+    NONE,
+    /**
+     * Only failed entries.
+     */
+    FAILURES,
+    /**
+     * Only an overall summary.
+     */
+    SUMMARY,
+    /**
+     * All available information, including per-entry information.
+     */
+    ALL
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/UnmatchingRule.java
----------------------------------------------------------------------
diff --git a/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/UnmatchingRule.java b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/UnmatchingRule.java
new file mode 100644
index 0000000..f579128
--- /dev/null
+++ b/syncope620/common/lib/src/main/java/org/apache/syncope/common/lib/types/UnmatchingRule.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.types;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+/**
+ * Sync/Push task un-matching rule.
+ */
+@XmlEnum
+public enum UnmatchingRule {
+
+    /**
+     * Do not perform any action.
+     */
+    IGNORE,
+    /**
+     * Link the resource and create entity.
+     */
+    ASSIGN,
+    /**
+     * Create entity without linking the resource.
+     */
+    PROVISION,
+    /**
+     * Just unlink resource without performing any (de-)provisioning operation.
+     * In case of sync task UNLINK and IGNORE will coincide.
+     */
+    UNLINK
+
+}


[3/6] syncope git commit: [SYNCOPE-620] persistence-api and common-lib

Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/VirSchema.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/VirSchema.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/VirSchema.java
new file mode 100644
index 0000000..d222ac5
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/VirSchema.java
@@ -0,0 +1,23 @@
+/*
+ * 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.persistence.api.entity;
+
+public interface VirSchema extends Schema {
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/conf/CNormAttr.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/conf/CNormAttr.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/conf/CNormAttr.java
new file mode 100644
index 0000000..a294321
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/conf/CNormAttr.java
@@ -0,0 +1,25 @@
+/*
+ * 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.persistence.api.entity.conf;
+
+import org.apache.syncope.persistence.api.entity.NormAttr;
+
+public interface CNormAttr extends NormAttr {
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/conf/Conf.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/conf/Conf.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/conf/Conf.java
new file mode 100644
index 0000000..4c559c6
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/conf/Conf.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.persistence.api.entity.conf;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.entity.Attributable;
+import org.apache.syncope.persistence.api.entity.DerAttr;
+import org.apache.syncope.persistence.api.entity.VirAttr;
+
+public interface Conf extends Attributable<CNormAttr, DerAttr<CNormAttr>, VirAttr> {
+
+    @Override
+    boolean addNormAttr(CNormAttr attr);
+
+    @Override
+    CNormAttr getNormAttr(String normSchemaName);
+
+    @Override
+    List<CNormAttr> getNormAttrs();
+
+    @Override
+    boolean removeNormAttr(CNormAttr attr);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MDerAttr.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MDerAttr.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MDerAttr.java
new file mode 100644
index 0000000..8cb04f8
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MDerAttr.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.persistence.api.entity.membership;
+
+import org.apache.syncope.persistence.api.entity.DerAttr;
+
+public interface MDerAttr extends DerAttr<MNormAttr> {
+
+    MDerAttrTemplate getTemplate();
+
+    void setTemplate(MDerAttrTemplate template);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MDerAttrTemplate.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MDerAttrTemplate.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MDerAttrTemplate.java
new file mode 100644
index 0000000..55c1c9f
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MDerAttrTemplate.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.persistence.api.entity.membership;
+
+import org.apache.syncope.persistence.api.entity.AttrTemplate;
+import org.apache.syncope.persistence.api.entity.DerSchema;
+
+public interface MDerAttrTemplate extends AttrTemplate<DerSchema> {
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MNormAttr.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MNormAttr.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MNormAttr.java
new file mode 100644
index 0000000..9804358
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MNormAttr.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.persistence.api.entity.membership;
+
+import org.apache.syncope.persistence.api.entity.NormAttr;
+
+public interface MNormAttr extends NormAttr {
+
+    MNormAttrTemplate getTemplate();
+
+    void setTemplate(MNormAttrTemplate template);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MNormAttrTemplate.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MNormAttrTemplate.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MNormAttrTemplate.java
new file mode 100644
index 0000000..7c21c40
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MNormAttrTemplate.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.persistence.api.entity.membership;
+
+import org.apache.syncope.persistence.api.entity.AttrTemplate;
+import org.apache.syncope.persistence.api.entity.NormSchema;
+
+public interface MNormAttrTemplate extends AttrTemplate<NormSchema> {
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MNormAttrValue.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MNormAttrValue.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MNormAttrValue.java
new file mode 100644
index 0000000..5031c7d
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MNormAttrValue.java
@@ -0,0 +1,25 @@
+/*
+ * 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.persistence.api.entity.membership;
+
+import org.apache.syncope.persistence.api.entity.NormAttrValue;
+
+public interface MNormAttrValue extends NormAttrValue {
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MVirAttr.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MVirAttr.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MVirAttr.java
new file mode 100644
index 0000000..43e42fe
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MVirAttr.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.persistence.api.entity.membership;
+
+import org.apache.syncope.persistence.api.entity.VirAttr;
+
+public interface MVirAttr extends VirAttr {
+
+    MVirAttrTemplate getTemplate();
+
+    void setTemplate(MVirAttrTemplate template);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MVirAttrTemplate.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MVirAttrTemplate.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MVirAttrTemplate.java
new file mode 100644
index 0000000..6a47df0
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/MVirAttrTemplate.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.persistence.api.entity.membership;
+
+import org.apache.syncope.persistence.api.entity.AttrTemplate;
+import org.apache.syncope.persistence.api.entity.VirSchema;
+
+public interface MVirAttrTemplate extends AttrTemplate<VirSchema> {
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/Membership.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/Membership.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/Membership.java
new file mode 100644
index 0000000..15c2ad0
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/membership/Membership.java
@@ -0,0 +1,71 @@
+/*
+ * 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.persistence.api.entity.membership;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.entity.Attributable;
+import org.apache.syncope.persistence.api.entity.role.Role;
+import org.apache.syncope.persistence.api.entity.user.User;
+
+public interface Membership extends Attributable<MNormAttr, MDerAttr, MVirAttr> {
+
+    Role getRole();
+
+    User getUser();
+
+    void setRole(Role role);
+
+    void setUser(User user);
+
+    @Override
+    boolean addNormAttr(MNormAttr attr);
+
+    @Override
+    boolean addDerAttr(MDerAttr attr);
+
+    @Override
+    boolean addVirAttr(MVirAttr attr);
+
+    @Override
+    MNormAttr getNormAttr(String normSchemaName);
+
+    @Override
+    List<MNormAttr> getNormAttrs();
+
+    @Override
+    MDerAttr getDerAttr(String derSchemaName);
+
+    @Override
+    List<MDerAttr> getDerAttrs();
+
+    @Override
+    MVirAttr getVirAttr(String virSchemaName);
+
+    @Override
+    List<MVirAttr> getVirAttrs();
+
+    @Override
+    boolean removeNormAttr(MNormAttr attr);
+
+    @Override
+    boolean removeDerAttr(MDerAttr derAttr);
+
+    @Override
+    boolean removeVirAttr(MVirAttr virAttr);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RDerAttr.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RDerAttr.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RDerAttr.java
new file mode 100644
index 0000000..b08c0a6
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RDerAttr.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.persistence.api.entity.role;
+
+import org.apache.syncope.persistence.api.entity.DerAttr;
+
+public interface RDerAttr extends DerAttr<RNormAttr> {
+
+    RDerAttrTemplate getTemplate();
+
+    void setTemplate(RDerAttrTemplate template);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RDerAttrTemplate.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RDerAttrTemplate.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RDerAttrTemplate.java
new file mode 100644
index 0000000..832d8d2
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RDerAttrTemplate.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.persistence.api.entity.role;
+
+import org.apache.syncope.persistence.api.entity.AttrTemplate;
+import org.apache.syncope.persistence.api.entity.DerSchema;
+
+public interface RDerAttrTemplate extends AttrTemplate<DerSchema> {
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RMapping.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RMapping.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RMapping.java
new file mode 100644
index 0000000..23a0def
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RMapping.java
@@ -0,0 +1,25 @@
+/*
+ * 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.persistence.api.entity.role;
+
+import org.apache.syncope.persistence.api.entity.Mapping;
+
+public interface RMapping extends Mapping<RMappingItem> {
+    
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RMappingItem.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RMappingItem.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RMappingItem.java
new file mode 100644
index 0000000..9174683
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RMappingItem.java
@@ -0,0 +1,25 @@
+/*
+ * 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.persistence.api.entity.role;
+
+import org.apache.syncope.persistence.api.entity.MappingItem;
+
+public interface RMappingItem extends MappingItem {
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RNormAttr.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RNormAttr.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RNormAttr.java
new file mode 100644
index 0000000..fed2585
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RNormAttr.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.persistence.api.entity.role;
+
+import org.apache.syncope.persistence.api.entity.NormAttr;
+
+public interface RNormAttr extends NormAttr {
+
+    RNormAttrTemplate getTemplate();
+
+    void setTemplate(RNormAttrTemplate template);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RNormAttrTemplate.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RNormAttrTemplate.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RNormAttrTemplate.java
new file mode 100644
index 0000000..83f2b51
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RNormAttrTemplate.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.persistence.api.entity.role;
+
+import org.apache.syncope.persistence.api.entity.AttrTemplate;
+import org.apache.syncope.persistence.api.entity.NormSchema;
+
+public interface RNormAttrTemplate extends AttrTemplate<NormSchema> {
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RNormAttrValue.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RNormAttrValue.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RNormAttrValue.java
new file mode 100644
index 0000000..cbb8e74
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RNormAttrValue.java
@@ -0,0 +1,25 @@
+/*
+ * 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.persistence.api.entity.role;
+
+import org.apache.syncope.persistence.api.entity.NormAttrValue;
+
+public interface RNormAttrValue extends NormAttrValue {
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RVirAttr.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RVirAttr.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RVirAttr.java
new file mode 100644
index 0000000..1ea6519
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RVirAttr.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.persistence.api.entity.role;
+
+import org.apache.syncope.persistence.api.entity.VirAttr;
+
+public interface RVirAttr extends VirAttr {
+
+    RVirAttrTemplate getTemplate();
+
+    void setTemplate(RVirAttrTemplate template);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RVirAttrTemplate.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RVirAttrTemplate.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RVirAttrTemplate.java
new file mode 100644
index 0000000..3e07013
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/RVirAttrTemplate.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.persistence.api.entity.role;
+
+import org.apache.syncope.persistence.api.entity.AttrTemplate;
+import org.apache.syncope.persistence.api.entity.VirSchema;
+
+public interface RVirAttrTemplate extends AttrTemplate<VirSchema> {
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/Role.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/Role.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/Role.java
new file mode 100644
index 0000000..3d314e2
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/role/Role.java
@@ -0,0 +1,170 @@
+/*
+ * 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.persistence.api.entity.role;
+
+import java.util.List;
+import java.util.Set;
+import org.apache.syncope.persistence.api.entity.AccountPolicy;
+import org.apache.syncope.persistence.api.entity.AttrTemplate;
+import org.apache.syncope.persistence.api.entity.Entitlement;
+import org.apache.syncope.persistence.api.entity.PasswordPolicy;
+import org.apache.syncope.persistence.api.entity.Schema;
+import org.apache.syncope.persistence.api.entity.Subject;
+import org.apache.syncope.persistence.api.entity.user.User;
+
+public interface Role extends Subject<RNormAttr, RDerAttr, RVirAttr> {
+
+    String getName();
+
+    Role getParent();
+
+    boolean addEntitlement(Entitlement entitlement);
+
+    boolean removeEntitlement(Entitlement entitlement);
+
+    /**
+     * Get all inherited attributes from the ancestors.
+     *
+     * @return a list of inherited and only inherited attributes.
+     */
+    List<RNormAttr> findLastInheritedAncestorNormAttrs();
+
+    /**
+     * Get all inherited derived attributes from the ancestors.
+     *
+     * @return a list of inherited and only inherited attributes.
+     */
+    List<RDerAttr> findLastInheritedAncestorDerAttrs();
+
+    /**
+     * Get all inherited virtual attributes from the ancestors.
+     *
+     * @return a list of inherited and only inherited attributes.
+     */
+    List<RVirAttr> findLastInheritedAncestorVirAttrs();
+
+    /**
+     * Get first valid account policy.
+     *
+     * @return parent account policy if isInheritAccountPolicy is 'true' and parent is not null, local account policy
+     * otherwise.
+     */
+    AccountPolicy getAccountPolicy();
+
+    <T extends AttrTemplate<K>, K extends Schema> List<T> findInheritedTemplates(Class<T> reference);
+
+    <T extends AttrTemplate<K>, K extends Schema> T getAttrTemplate(
+            Class<T> reference, String schemaName);
+
+    <T extends AttrTemplate<K>, K extends Schema> List<K> getAttrTemplateSchemas(Class<T> reference);
+
+    <T extends AttrTemplate<Schema>> List<T> getAttrTemplates(Class<T> reference);
+
+    Set<Entitlement> getEntitlements();
+
+    /**
+     * Get first valid password policy.
+     *
+     * @return parent password policy if isInheritPasswordPolicy is 'true' and parent is not null, local password policy
+     * otherwise
+     */
+    PasswordPolicy getPasswordPolicy();
+
+    Role getRoleOwner();
+
+    User getUserOwner();
+
+    boolean isInheritAccountPolicy();
+
+    boolean isInheritAttrs();
+
+    boolean isInheritDerAttrs();
+
+    boolean isInheritOwner();
+
+    boolean isInheritPasswordPolicy();
+
+    boolean isInheritTemplates();
+
+    boolean isInheritVirAttrs();
+
+    void setAccountPolicy(AccountPolicy accountPolicy);
+
+    void setEntitlements(List<Entitlement> entitlements);
+
+    void setInheritAccountPolicy(boolean condition);
+
+    void setInheritAttrs(boolean inheritAttrs);
+
+    void setInheritDerAttrs(boolean inheritDerAttrs);
+
+    void setInheritOwner(boolean inheritOwner);
+
+    void setInheritPasswordPolicy(boolean condition);
+
+    void setInheritTemplates(boolean condition);
+
+    void setInheritVirAttrs(boolean inheritVirAttrs);
+
+    void setName(String name);
+
+    void setParent(Role parent);
+
+    void setPasswordPolicy(PasswordPolicy passwordPolicy);
+
+    void setRoleOwner(Role roleOwner);
+
+    void setUserOwner(User userOwner);
+
+    @Override
+    boolean addNormAttr(RNormAttr attr);
+
+    @Override
+    boolean addDerAttr(RDerAttr attr);
+
+    @Override
+    boolean addVirAttr(RVirAttr attr);
+
+    @Override
+    RNormAttr getNormAttr(String normSchemaName);
+
+    @Override
+    List<RNormAttr> getNormAttrs();
+
+    @Override
+    RDerAttr getDerAttr(String derSchemaName);
+
+    @Override
+    List<RDerAttr> getDerAttrs();
+
+    @Override
+    RVirAttr getVirAttr(String virSchemaName);
+
+    @Override
+    List<RVirAttr> getVirAttrs();
+
+    @Override
+    boolean removeNormAttr(RNormAttr attr);
+
+    @Override
+    boolean removeDerAttr(RDerAttr derAttr);
+
+    @Override
+    boolean removeVirAttr(RVirAttr virAttr);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/NotificationTask.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/NotificationTask.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/NotificationTask.java
new file mode 100644
index 0000000..a60ee2b
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/NotificationTask.java
@@ -0,0 +1,57 @@
+/*
+ * 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.persistence.api.entity.task;
+
+import java.util.Set;
+import org.apache.syncope.common.lib.types.TraceLevel;
+
+public interface NotificationTask extends Task {
+
+    String getHtmlBody();
+
+    Set<String> getRecipients();
+
+    String getSender();
+
+    String getSubject();
+
+    String getTextBody();
+
+    TraceLevel getTraceLevel();
+
+    boolean isExecuted();
+
+    void setExecuted(boolean executed);
+
+    void setHtmlBody(String htmlBody);
+
+    boolean addRecipient(String recipient);
+
+    boolean removeRecipient(String recipient);
+
+    void setRecipients(Set<String> recipients);
+
+    void setSender(String sender);
+
+    void setSubject(String subject);
+
+    void setTextBody(String textBody);
+
+    void setTraceLevel(TraceLevel traceLevel);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/PropagationTask.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/PropagationTask.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/PropagationTask.java
new file mode 100644
index 0000000..0de12ee
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/PropagationTask.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.persistence.api.entity.task;
+
+import java.util.Set;
+import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.PropagationMode;
+import org.apache.syncope.common.lib.types.ResourceOperation;
+import org.apache.syncope.persistence.api.entity.ExternalResource;
+import org.identityconnectors.framework.common.objects.Attribute;
+
+public interface PropagationTask extends Task {
+
+    String getAccountId();
+
+    Set<Attribute> getAttributes();
+
+    String getObjectClassName();
+
+    String getOldAccountId();
+
+    PropagationMode getPropagationMode();
+
+    ResourceOperation getPropagationOperation();
+
+    ExternalResource getResource();
+
+    Long getSubjectId();
+
+    AttributableType getSubjectType();
+
+    void setAccountId(String accountId);
+
+    void setAttributes(Set<Attribute> attributes);
+
+    void setObjectClassName(String objectClassName);
+
+    void setOldAccountId(String oldAccountId);
+
+    void setPropagationMode(PropagationMode propagationMode);
+
+    void setPropagationOperation(ResourceOperation operation);
+
+    void setResource(ExternalResource resource);
+
+    void setSubjectId(Long subjectId);
+
+    void setSubjectType(AttributableType subjectType);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/ProvisioningTask.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/ProvisioningTask.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/ProvisioningTask.java
new file mode 100644
index 0000000..5b37648
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/ProvisioningTask.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.persistence.api.entity.task;
+
+import java.util.List;
+import org.apache.syncope.common.lib.types.MatchingRule;
+import org.apache.syncope.common.lib.types.UnmatchingRule;
+import org.apache.syncope.persistence.api.entity.ExternalResource;
+
+public interface ProvisioningTask extends SchedTask {
+
+    List<String> getActionsClassNames();
+
+    MatchingRule getMatchingRule();
+
+    ExternalResource getResource();
+
+    UnmatchingRule getUnmatchingRule();
+
+    boolean isPerformCreate();
+
+    boolean isPerformDelete();
+
+    boolean isPerformUpdate();
+
+    boolean isSyncStatus();
+
+    void setMatchingRule(MatchingRule matchigRule);
+
+    void setPerformCreate(boolean performCreate);
+
+    void setPerformDelete(boolean performDelete);
+
+    void setPerformUpdate(boolean performUpdate);
+
+    void setResource(ExternalResource resource);
+
+    void setSyncStatus(boolean syncStatus);
+
+    void setUnmatchingRule(UnmatchingRule unmatchigRule);
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/PushTask.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/PushTask.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/PushTask.java
new file mode 100644
index 0000000..e72ac5b
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/PushTask.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.persistence.api.entity.task;
+
+public interface PushTask extends ProvisioningTask {
+
+    String getRoleFilter();
+
+    String getUserFilter();
+
+    void setRoleFilter(String roleFilter);
+
+    void setUserFilter(String filter);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/SchedTask.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/SchedTask.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/SchedTask.java
new file mode 100644
index 0000000..f64eb9b
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/SchedTask.java
@@ -0,0 +1,38 @@
+/*
+ * 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.persistence.api.entity.task;
+
+public interface SchedTask extends Task {
+
+    String getCronExpression();
+
+    String getDescription();
+
+    String getJobClassName();
+
+    String getName();
+
+    void setCronExpression(String cronExpression);
+
+    void setDescription(String description);
+
+    void setJobClassName(String jobClassName);
+
+    void setName(String name);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/SyncTask.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/SyncTask.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/SyncTask.java
new file mode 100644
index 0000000..e51f379
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/SyncTask.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.persistence.api.entity.task;
+
+public interface SyncTask extends ProvisioningTask {
+
+    String getRoleTemplate();
+
+    String getUserTemplate();
+
+    boolean isFullReconciliation();
+
+    void setFullReconciliation(boolean condition);
+
+    void setRoleTemplate(String roleTemplate);
+
+    void setUserTemplate(String userTemplate);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/Task.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/Task.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/Task.java
new file mode 100644
index 0000000..baf8637
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/Task.java
@@ -0,0 +1,33 @@
+/*
+ * 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.persistence.api.entity.task;
+
+import java.util.List;
+import org.apache.syncope.persistence.api.entity.Entity;
+
+public interface Task extends Entity<Long> {
+
+    boolean addExec(TaskExec exec);
+
+    boolean removeExec(TaskExec exec);
+
+    List<TaskExec> getExecs();
+
+    void setExecs(List<TaskExec> executions);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/TaskExec.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/TaskExec.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/TaskExec.java
new file mode 100644
index 0000000..ba0dc37
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/task/TaskExec.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.persistence.api.entity.task;
+
+import org.apache.syncope.persistence.api.entity.Exec;
+
+public interface TaskExec extends Exec {
+
+    Task getTask();
+
+    void setTask(Task task);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/SecurityQuestion.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/SecurityQuestion.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/SecurityQuestion.java
new file mode 100644
index 0000000..9efe547
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/SecurityQuestion.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.persistence.api.entity.user;
+
+import org.apache.syncope.persistence.api.entity.Entity;
+
+public interface SecurityQuestion extends Entity<Long> {
+
+    String getContent();
+
+    void setContent(String content);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UDerAttr.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UDerAttr.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UDerAttr.java
new file mode 100644
index 0000000..ffec8ba
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UDerAttr.java
@@ -0,0 +1,25 @@
+/*
+ * 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.persistence.api.entity.user;
+
+import org.apache.syncope.persistence.api.entity.DerAttr;
+
+public interface UDerAttr extends DerAttr<UNormAttr> {
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UMapping.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UMapping.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UMapping.java
new file mode 100644
index 0000000..479d34e
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UMapping.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.persistence.api.entity.user;
+
+import org.apache.syncope.persistence.api.entity.Mapping;
+
+public interface UMapping extends Mapping<UMappingItem> {
+
+    UMappingItem getPasswordItem();
+
+    boolean setPasswordItem(UMappingItem item);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UMappingItem.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UMappingItem.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UMappingItem.java
new file mode 100644
index 0000000..e14eefe
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UMappingItem.java
@@ -0,0 +1,25 @@
+/*
+ * 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.persistence.api.entity.user;
+
+import org.apache.syncope.persistence.api.entity.MappingItem;
+
+public interface UMappingItem extends MappingItem {
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UNormAttr.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UNormAttr.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UNormAttr.java
new file mode 100644
index 0000000..ed0ea4a
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UNormAttr.java
@@ -0,0 +1,25 @@
+/*
+ * 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.persistence.api.entity.user;
+
+import org.apache.syncope.persistence.api.entity.NormAttr;
+
+public interface UNormAttr extends NormAttr {
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UNormAttrValue.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UNormAttrValue.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UNormAttrValue.java
new file mode 100644
index 0000000..2340fb8
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UNormAttrValue.java
@@ -0,0 +1,25 @@
+/*
+ * 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.persistence.api.entity.user;
+
+import org.apache.syncope.persistence.api.entity.NormAttrValue;
+
+public interface UNormAttrValue extends NormAttrValue {
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UVirAttr.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UVirAttr.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UVirAttr.java
new file mode 100644
index 0000000..baf744d
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/UVirAttr.java
@@ -0,0 +1,25 @@
+/*
+ * 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.persistence.api.entity.user;
+
+import org.apache.syncope.persistence.api.entity.VirAttr;
+
+public interface UVirAttr extends VirAttr {
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/User.java
----------------------------------------------------------------------
diff --git a/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/User.java b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/User.java
new file mode 100644
index 0000000..c7aaf9f
--- /dev/null
+++ b/syncope620/server/persistence-api/src/main/java/org/apache/syncope/persistence/api/entity/user/User.java
@@ -0,0 +1,152 @@
+/*
+ * 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.persistence.api.entity.user;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+import org.apache.syncope.common.lib.types.CipherAlgorithm;
+import org.apache.syncope.persistence.api.entity.ExternalResource;
+import org.apache.syncope.persistence.api.entity.Subject;
+import org.apache.syncope.persistence.api.entity.membership.Membership;
+import org.apache.syncope.persistence.api.entity.role.Role;
+
+public interface User extends Subject<UNormAttr, UDerAttr, UVirAttr> {
+
+    boolean addMembership(Membership membership);
+
+    boolean canDecodePassword();
+
+    boolean checkToken(String token);
+
+    void generateToken(int tokenLength, int tokenExpireTime);
+
+    Date getChangePwdDate();
+
+    CipherAlgorithm getCipherAlgorithm();
+
+    String getClearPassword();
+
+    Integer getFailedLogins();
+
+    Date getLastLoginDate();
+
+    Membership getMembership(Long syncopeRoleId);
+
+    List<Membership> getMemberships();
+
+    Set<ExternalResource> getOwnResources();
+
+    String getPassword();
+
+    List<String> getPasswordHistory();
+
+    Set<Long> getRoleIds();
+
+    List<Role> getRoles();
+
+    String getSecurityAnswer();
+
+    SecurityQuestion getSecurityQuestion();
+
+    String getStatus();
+
+    String getToken();
+
+    Date getTokenExpireTime();
+
+    String getUsername();
+
+    String getWorkflowId();
+
+    boolean hasTokenExpired();
+
+    Boolean isSuspended();
+
+    void removeClearPassword();
+
+    boolean removeMembership(Membership membership);
+
+    void removeToken();
+
+    void setChangePwdDate(Date changePwdDate);
+
+    void setCipherAlgorithm(CipherAlgorithm cipherAlgorithm);
+
+    void setEncodedPassword(String password, CipherAlgorithm cipherAlgoritm);
+
+    void setFailedLogins(Integer failedLogins);
+
+    void setLastLoginDate(Date lastLoginDate);
+
+    void setMemberships(List<Membership> memberships);
+
+    void setPassword(String password, CipherAlgorithm cipherAlgoritm);
+
+    void setSecurityAnswer(String securityAnswer);
+
+    void setSecurityQuestion(SecurityQuestion securityQuestion);
+
+    void setStatus(String status);
+
+    void setSuspended(Boolean suspended);
+
+    void setUsername(String username);
+
+    void setWorkflowId(String workflowId);
+
+    boolean verifyPasswordHistory(String password, int size);
+
+    @Override
+    boolean addNormAttr(UNormAttr attr);
+
+    @Override
+    boolean addDerAttr(UDerAttr attr);
+
+    @Override
+    boolean addVirAttr(UVirAttr attr);
+
+    @Override
+    UNormAttr getNormAttr(String normSchemaName);
+
+    @Override
+    List<UNormAttr> getNormAttrs();
+
+    @Override
+    UDerAttr getDerAttr(String derSchemaName);
+
+    @Override
+    List<UDerAttr> getDerAttrs();
+
+    @Override
+    UVirAttr getVirAttr(String virSchemaName);
+
+    @Override
+    List<UVirAttr> getVirAttrs();
+
+    @Override
+    boolean removeNormAttr(UNormAttr attr);
+
+    @Override
+    boolean removeDerAttr(UDerAttr derAttr);
+
+    @Override
+    boolean removeVirAttr(UVirAttr virAttr);
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/c73a73b0/syncope620/server/pom.xml
----------------------------------------------------------------------
diff --git a/syncope620/server/pom.xml b/syncope620/server/pom.xml
new file mode 100644
index 0000000..b8c0503
--- /dev/null
+++ b/syncope620/server/pom.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.syncope</groupId>
+    <artifactId>syncope</artifactId>
+    <version>2.0.0-SNAPSHOT</version>
+  </parent>
+
+  <name>Apache Syncope Server</name>
+  <description>Apache Syncope Server</description>
+  <groupId>org.apache.syncope</groupId>
+  <artifactId>syncope-server</artifactId>
+  <packaging>pom</packaging>
+
+  <modules>
+    <module>persistence-api</module>
+    <!--<module>persistence-jpa</module>-->
+  </modules>
+
+</project>


[2/6] syncope git commit: Useless imports

Posted by il...@apache.org.
Useless imports


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

Branch: refs/heads/2_0_X
Commit: 8fe7f5c4db4e672c93b04a09adb449a5dd914caf
Parents: 91352e5
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Dec 23 13:47:25 2014 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Dec 23 13:47:25 2014 +0100

----------------------------------------------------------------------
 .../syncope/core/persistence/beans/AbstractMapping.java       | 7 -------
 1 file changed, 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/8fe7f5c4/core/src/main/java/org/apache/syncope/core/persistence/beans/AbstractMapping.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/syncope/core/persistence/beans/AbstractMapping.java b/core/src/main/java/org/apache/syncope/core/persistence/beans/AbstractMapping.java
index a60d7a4..ff710e9 100644
--- a/core/src/main/java/org/apache/syncope/core/persistence/beans/AbstractMapping.java
+++ b/core/src/main/java/org/apache/syncope/core/persistence/beans/AbstractMapping.java
@@ -18,17 +18,10 @@
  */
 package org.apache.syncope.core.persistence.beans;
 
-import java.util.ArrayList;
-import java.util.Collection;
 import java.util.List;
 import javax.persistence.Cacheable;
 import javax.persistence.MappedSuperclass;
 import org.apache.syncope.common.types.IntMappingType;
-import org.apache.syncope.common.util.BeanUtils;
-import org.apache.syncope.core.persistence.beans.role.RMappingItem;
-import org.apache.syncope.core.persistence.beans.user.UMapping;
-import org.apache.syncope.core.persistence.beans.user.UMappingItem;
-import org.identityconnectors.framework.common.objects.Uid;
 
 @MappedSuperclass
 @Cacheable