syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [06/24] syncope git commit: [SYNCOPE-822] UUID keys
Date Tue, 19 Apr 2016 13:01:53 GMT
http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ConnectorServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ConnectorServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ConnectorServiceImpl.java
index c64a02d..a5ebee1 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ConnectorServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ConnectorServiceImpl.java
@@ -48,7 +48,7 @@ public class ConnectorServiceImpl extends AbstractServiceImpl implements Connect
     }
 
     @Override
-    public void delete(final Long key) {
+    public void delete(final String key) {
         logic.delete(key);
     }
 
@@ -70,7 +70,7 @@ public class ConnectorServiceImpl extends AbstractServiceImpl implements Connect
     }
 
     @Override
-    public ConnInstanceTO read(final Long key, final String lang) {
+    public ConnInstanceTO read(final String key, final String lang) {
         return logic.read(key, lang);
     }
 
@@ -101,8 +101,7 @@ public class ConnectorServiceImpl extends AbstractServiceImpl implements Connect
         if (bulkAction.getType() == BulkAction.Type.DELETE) {
             for (String key : bulkAction.getTargets()) {
                 try {
-                    result.getResults().put(
-                            String.valueOf(logic.delete(Long.valueOf(key)).getKey()), BulkActionResult.Status.SUCCESS);
+                    result.getResults().put(logic.delete(key).getKey(), BulkActionResult.Status.SUCCESS);
                 } catch (Exception e) {
                     LOG.error("Error performing delete for connector {}", key, e);
                     result.getResults().put(key, BulkActionResult.Status.FAILURE);

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/GroupServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/GroupServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/GroupServiceImpl.java
index cf65346..d32d87c 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/GroupServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/GroupServiceImpl.java
@@ -41,7 +41,7 @@ public class GroupServiceImpl extends AbstractAnyService<GroupTO, GroupPatch> im
     }
 
     @Override
-    protected GroupPatch newPatch(final Long key) {
+    protected GroupPatch newPatch(final String key) {
         GroupPatch patch = new GroupPatch();
         patch.setKey(key);
         return patch;

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/NotificationServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/NotificationServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/NotificationServiceImpl.java
index 43e6b5b..6acdda0 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/NotificationServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/NotificationServiceImpl.java
@@ -46,7 +46,7 @@ public class NotificationServiceImpl extends AbstractServiceImpl implements Noti
     }
 
     @Override
-    public NotificationTO read(final Long key) {
+    public NotificationTO read(final String key) {
         return logic.read(key);
     }
 
@@ -61,7 +61,7 @@ public class NotificationServiceImpl extends AbstractServiceImpl implements Noti
     }
 
     @Override
-    public void delete(final Long key) {
+    public void delete(final String key) {
         logic.delete(key);
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java
index 95fe255..5295a64 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java
@@ -45,7 +45,7 @@ public class PolicyServiceImpl extends AbstractServiceImpl implements PolicyServ
     }
 
     @Override
-    public void delete(final Long key) {
+    public void delete(final String key) {
         logic.delete(key);
     }
 
@@ -55,7 +55,7 @@ public class PolicyServiceImpl extends AbstractServiceImpl implements PolicyServ
     }
 
     @Override
-    public <T extends AbstractPolicyTO> T read(final Long key) {
+    public <T extends AbstractPolicyTO> T read(final String key) {
         return logic.read(key);
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ReportServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ReportServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ReportServiceImpl.java
index 738f76c..b68b2a5 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ReportServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ReportServiceImpl.java
@@ -66,12 +66,12 @@ public class ReportServiceImpl extends AbstractServiceImpl implements ReportServ
     }
 
     @Override
-    public ReportTO read(final Long key) {
+    public ReportTO read(final String key) {
         return logic.read(key);
     }
 
     @Override
-    public Response exportExecutionResult(final Long executionKey, final ReportExecExportFormat fmt) {
+    public Response exportExecutionResult(final String executionKey, final ReportExecExportFormat fmt) {
         final ReportExecExportFormat format = (fmt == null) ? ReportExecExportFormat.XML : fmt;
         final ReportExec reportExec = logic.getReportExec(executionKey);
         StreamingOutput sout = new StreamingOutput() {
@@ -93,7 +93,7 @@ public class ReportServiceImpl extends AbstractServiceImpl implements ReportServ
     }
 
     @Override
-    public void delete(final Long key) {
+    public void delete(final String key) {
         logic.delete(key);
     }
 
@@ -103,7 +103,7 @@ public class ReportServiceImpl extends AbstractServiceImpl implements ReportServ
     }
 
     @Override
-    public void deleteExecution(final Long executionKey) {
+    public void deleteExecution(final String executionKey) {
         logic.deleteExecution(executionKey);
     }
 
@@ -123,7 +123,7 @@ public class ReportServiceImpl extends AbstractServiceImpl implements ReportServ
     }
 
     @Override
-    public void actionJob(final Long key, final JobAction action) {
+    public void actionJob(final String key, final JobAction action) {
         logic.actionJob(key, action);
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceServiceImpl.java
index a7e88d3..d8ee45f 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceServiceImpl.java
@@ -93,7 +93,7 @@ public class ResourceServiceImpl extends AbstractServiceImpl implements Resource
     }
 
     @Override
-    public ConnObjectTO readConnObject(final String key, final String anyTypeKey, final Long anyKey) {
+    public ConnObjectTO readConnObject(final String key, final String anyTypeKey, final String anyKey) {
         return logic.readConnObject(key, anyTypeKey, anyKey);
     }
 
@@ -136,14 +136,14 @@ public class ResourceServiceImpl extends AbstractServiceImpl implements Resource
     public BulkActionResult bulkDeassociation(final ResourceDeassociationPatch patch) {
         AbstractResourceAssociator<? extends AnyTO> associator =
                 patch.getAnyTypeKey().equalsIgnoreCase(AnyTypeKind.USER.name())
-                        ? userLogic
-                        : patch.getAnyTypeKey().equalsIgnoreCase(AnyTypeKind.GROUP.name())
-                                ? groupLogic
-                                : anyObjectLogic;
+                ? userLogic
+                : patch.getAnyTypeKey().equalsIgnoreCase(AnyTypeKind.GROUP.name())
+                ? groupLogic
+                : anyObjectLogic;
 
         BulkActionResult result = new BulkActionResult();
 
-        for (Long anyKey : patch.getAnyKyes()) {
+        for (String anyKey : patch.getAnyKyes()) {
             Set<String> resources = Collections.singleton(patch.getKey());
             try {
                 switch (patch.getAction()) {
@@ -162,10 +162,10 @@ public class ResourceServiceImpl extends AbstractServiceImpl implements Resource
                     default:
                 }
 
-                result.getResults().put(String.valueOf(anyKey), BulkActionResult.Status.SUCCESS);
+                result.getResults().put(anyKey, BulkActionResult.Status.SUCCESS);
             } catch (Exception e) {
                 LOG.warn("While executing {} on {} {}", patch.getAction(), patch.getAnyTypeKey(), anyKey, e);
-                result.getResults().put(String.valueOf(anyKey), BulkActionResult.Status.FAILURE);
+                result.getResults().put(anyKey, BulkActionResult.Status.FAILURE);
             }
         }
 
@@ -177,12 +177,12 @@ public class ResourceServiceImpl extends AbstractServiceImpl implements Resource
         BulkActionResult result = new BulkActionResult();
 
         if (bulkAction.getType() == BulkAction.Type.DELETE) {
-            for (String name : bulkAction.getTargets()) {
+            for (String key : bulkAction.getTargets()) {
                 try {
-                    result.getResults().put(logic.delete(name).getKey(), BulkActionResult.Status.SUCCESS);
+                    result.getResults().put(logic.delete(key).getKey(), BulkActionResult.Status.SUCCESS);
                 } catch (Exception e) {
-                    LOG.error("Error performing delete for resource {}", name, e);
-                    result.getResults().put(name, BulkActionResult.Status.FAILURE);
+                    LOG.error("Error performing delete for resource {}", key, e);
+                    result.getResults().put(key, BulkActionResult.Status.FAILURE);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SecurityQuestionServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SecurityQuestionServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SecurityQuestionServiceImpl.java
index 37cc4552..3aa5382 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SecurityQuestionServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SecurityQuestionServiceImpl.java
@@ -40,7 +40,7 @@ public class SecurityQuestionServiceImpl extends AbstractServiceImpl implements
     }
 
     @Override
-    public SecurityQuestionTO read(final Long key) {
+    public SecurityQuestionTO read(final String key) {
         return logic.read(key);
     }
 
@@ -60,7 +60,7 @@ public class SecurityQuestionServiceImpl extends AbstractServiceImpl implements
     }
 
     @Override
-    public void delete(final Long key) {
+    public void delete(final String key) {
         logic.delete(key);
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
index 083b49e..1bae984 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
@@ -64,7 +64,7 @@ public class TaskServiceImpl extends AbstractServiceImpl implements TaskService
     }
 
     @Override
-    public void delete(final Long key) {
+    public void delete(final String key) {
         logic.delete(key);
     }
 
@@ -98,7 +98,7 @@ public class TaskServiceImpl extends AbstractServiceImpl implements TaskService
     }
 
     @Override
-    public <T extends AbstractTaskTO> T read(final Long key, final boolean details) {
+    public <T extends AbstractTaskTO> T read(final String key, final boolean details) {
         return logic.read(key, details);
     }
 
@@ -130,7 +130,7 @@ public class TaskServiceImpl extends AbstractServiceImpl implements TaskService
     }
 
     @Override
-    public void deleteExecution(final Long executionKey) {
+    public void deleteExecution(final String executionKey) {
         logic.deleteExecution(executionKey);
     }
 
@@ -152,9 +152,7 @@ public class TaskServiceImpl extends AbstractServiceImpl implements TaskService
             case DELETE:
                 for (String key : bulkAction.getTargets()) {
                     try {
-                        result.getResults().put(
-                                String.valueOf(logic.delete(Long.valueOf(key)).getKey()),
-                                BulkActionResult.Status.SUCCESS);
+                        result.getResults().put(logic.delete(key).getKey(), BulkActionResult.Status.SUCCESS);
                     } catch (Exception e) {
                         LOG.error("Error performing delete for task {}", key, e);
                         result.getResults().put(key, BulkActionResult.Status.FAILURE);
@@ -165,7 +163,7 @@ public class TaskServiceImpl extends AbstractServiceImpl implements TaskService
             case DRYRUN:
                 for (String key : bulkAction.getTargets()) {
                     try {
-                        logic.execute(Long.valueOf(key), null, true);
+                        logic.execute(key, null, true);
                         result.getResults().put(key, BulkActionResult.Status.SUCCESS);
                     } catch (Exception e) {
                         LOG.error("Error performing dryrun for task {}", key, e);
@@ -177,7 +175,7 @@ public class TaskServiceImpl extends AbstractServiceImpl implements TaskService
             case EXECUTE:
                 for (String key : bulkAction.getTargets()) {
                     try {
-                        logic.execute(Long.valueOf(key), null, false);
+                        logic.execute(key, null, false);
                         result.getResults().put(key, BulkActionResult.Status.SUCCESS);
                     } catch (Exception e) {
                         LOG.error("Error performing execute for task {}", key, e);
@@ -198,7 +196,7 @@ public class TaskServiceImpl extends AbstractServiceImpl implements TaskService
     }
 
     @Override
-    public void actionJob(final Long key, final JobAction action) {
+    public void actionJob(final String key, final JobAction action) {
         logic.actionJob(key, action);
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserServiceImpl.java
index 1b57c38..f395c59 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserServiceImpl.java
@@ -18,14 +18,12 @@
  */
 package org.apache.syncope.core.rest.cxf.service;
 
-import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.Response;
 import org.apache.syncope.common.lib.patch.StatusPatch;
 import org.apache.syncope.common.lib.patch.UserPatch;
 import org.apache.syncope.common.lib.to.PagedResult;
 import org.apache.syncope.common.lib.to.ProvisioningResult;
 import org.apache.syncope.common.lib.to.UserTO;
-import org.apache.syncope.common.rest.api.RESTHeaders;
 import org.apache.syncope.common.rest.api.beans.AnyListQuery;
 import org.apache.syncope.common.rest.api.service.UserService;
 import org.apache.syncope.core.logic.AbstractAnyLogic;
@@ -45,27 +43,13 @@ public class UserServiceImpl extends AbstractAnyService<UserTO, UserPatch> imple
     }
 
     @Override
-    protected UserPatch newPatch(final Long key) {
+    protected UserPatch newPatch(final String key) {
         UserPatch patch = new UserPatch();
         patch.setKey(key);
         return patch;
     }
 
     @Override
-    public Response getUsername(final Long key) {
-        return Response.ok().header(HttpHeaders.ALLOW, OPTIONS_ALLOW).
-                header(RESTHeaders.USERNAME, logic.getUsername(key)).
-                build();
-    }
-
-    @Override
-    public Response getUserKey(final String username) {
-        return Response.ok().header(HttpHeaders.ALLOW, OPTIONS_ALLOW).
-                header(RESTHeaders.USER_KEY, logic.getKey(username)).
-                build();
-    }
-
-    @Override
     public PagedResult<UserTO> list(final AnyListQuery listQuery) {
         return super.list(listQuery);
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowServiceImpl.java
index b396e40..a3e6040 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/UserWorkflowServiceImpl.java
@@ -43,7 +43,7 @@ public class UserWorkflowServiceImpl implements UserWorkflowService {
     }
 
     @Override
-    public WorkflowFormTO getFormForUser(final Long userKey) {
+    public WorkflowFormTO getFormForUser(final String userKey) {
         return lofic.getFormForUser(userKey);
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthDataAccessor.java
----------------------------------------------------------------------
diff --git a/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthDataAccessor.java b/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthDataAccessor.java
index 146eea3..377b96e 100644
--- a/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthDataAccessor.java
+++ b/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthDataAccessor.java
@@ -126,11 +126,11 @@ public class AuthDataAccessor {
      * @return {@code null} if no matching user was found, authentication result otherwise
      */
     @Transactional(noRollbackFor = DisabledException.class)
-    public Pair<Long, Boolean> authenticate(final Authentication authentication) {
-        Long key = null;
+    public Pair<String, Boolean> authenticate(final Authentication authentication) {
+        String key = null;
         Boolean authenticated = null;
 
-        User user = userDAO.find(authentication.getName());
+        User user = userDAO.findByUsername(authentication.getName());
         if (user != null) {
             key = user.getKey();
             authenticated = false;
@@ -254,7 +254,7 @@ public class AuthDataAccessor {
                 }
             }, authorities);
         } else {
-            User user = userDAO.find(username);
+            User user = userDAO.findByUsername(username);
             if (user == null) {
                 throw new UsernameNotFoundException("Could not find any user with id " + username);
             }

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/spring/src/main/java/org/apache/syncope/core/spring/security/DelegatedAdministrationException.java
----------------------------------------------------------------------
diff --git a/core/spring/src/main/java/org/apache/syncope/core/spring/security/DelegatedAdministrationException.java b/core/spring/src/main/java/org/apache/syncope/core/spring/security/DelegatedAdministrationException.java
index d99c96c..be378a5 100644
--- a/core/spring/src/main/java/org/apache/syncope/core/spring/security/DelegatedAdministrationException.java
+++ b/core/spring/src/main/java/org/apache/syncope/core/spring/security/DelegatedAdministrationException.java
@@ -24,7 +24,7 @@ public class DelegatedAdministrationException extends RuntimeException {
 
     private static final long serialVersionUID = 7540587364235915081L;
 
-    public DelegatedAdministrationException(final AnyTypeKind type, final Long key) {
+    public DelegatedAdministrationException(final AnyTypeKind type, final String key) {
         super("Missing entitlement or realm administration for "
                 + (key == null
                         ? "new " + type

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeAuthenticationProvider.java
----------------------------------------------------------------------
diff --git a/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeAuthenticationProvider.java b/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeAuthenticationProvider.java
index 078ebc4..b69c98b 100644
--- a/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeAuthenticationProvider.java
+++ b/core/spring/src/main/java/org/apache/syncope/core/spring/security/SyncopeAuthenticationProvider.java
@@ -112,23 +112,23 @@ public class SyncopeAuthenticationProvider implements AuthenticationProvider {
                 authenticated = AuthContextUtils.execWithAuthContext(
                         SyncopeConstants.MASTER_DOMAIN, new Executable<Boolean>() {
 
-                            @Override
-                            public Boolean exec() {
-                                Domain domain = dataAccessor.findDomain(domainToFind);
-
-                                return encryptor.verify(
-                                        authentication.getCredentials().toString(),
-                                        domain.getAdminCipherAlgorithm(),
-                                        domain.getAdminPwd());
-                            }
-                        });
+                    @Override
+                    public Boolean exec() {
+                        Domain domain = dataAccessor.findDomain(domainToFind);
+
+                        return encryptor.verify(
+                                authentication.getCredentials().toString(),
+                                domain.getAdminCipherAlgorithm(),
+                                domain.getAdminPwd());
+                    }
+                });
             }
         } else {
-            final Pair<Long, Boolean> authResult =
-                    AuthContextUtils.execWithAuthContext(domainKey, new Executable<Pair<Long, Boolean>>() {
+            final Pair<String, Boolean> authResult =
+                    AuthContextUtils.execWithAuthContext(domainKey, new Executable<Pair<String, Boolean>>() {
 
                         @Override
-                        public Pair<Long, Boolean> exec() {
+                        public Pair<String, Boolean> exec() {
                             return dataAccessor.authenticate(authentication);
                         }
                     });
@@ -151,28 +151,28 @@ public class SyncopeAuthenticationProvider implements AuthenticationProvider {
             token = AuthContextUtils.execWithAuthContext(
                     domainKey, new Executable<UsernamePasswordAuthenticationToken>() {
 
-                        @Override
-                        public UsernamePasswordAuthenticationToken exec() {
-                            UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(
-                                    authentication.getPrincipal(),
-                                    null,
-                                    userDetailsService.loadUserByUsername(authentication.getPrincipal().toString()).
-                                    getAuthorities());
-                            token.setDetails(authentication.getDetails());
-
-                            dataAccessor.audit(
-                                    AuditElements.EventCategoryType.REST,
-                                    AuditElements.AUTHENTICATION_CATEGORY,
-                                    null,
-                                    AuditElements.LOGIN_EVENT,
-                                    Result.SUCCESS,
-                                    null,
-                                    isAuthenticated,
-                                    authentication,
-                                    "Successfully authenticated, with entitlements: " + token.getAuthorities());
-                            return token;
-                        }
-                    });
+                @Override
+                public UsernamePasswordAuthenticationToken exec() {
+                    UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(
+                            authentication.getPrincipal(),
+                            null,
+                            userDetailsService.loadUserByUsername(authentication.getPrincipal().toString()).
+                            getAuthorities());
+                    token.setDetails(authentication.getDetails());
+
+                    dataAccessor.audit(
+                            AuditElements.EventCategoryType.REST,
+                            AuditElements.AUTHENTICATION_CATEGORY,
+                            null,
+                            AuditElements.LOGIN_EVENT,
+                            Result.SUCCESS,
+                            null,
+                            isAuthenticated,
+                            authentication,
+                            "Successfully authenticated, with entitlements: " + token.getAuthorities());
+                    return token;
+                }
+            });
 
             LOG.debug("User {} successfully authenticated, with entitlements {}",
                     authentication.getPrincipal(), token.getAuthorities());

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
index a8a65b6..4eaa5e6 100644
--- a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
+++ b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
@@ -213,19 +213,19 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
     }
 
     @Override
-    public WorkflowResult<Pair<Long, Boolean>> create(final UserTO userTO, final boolean disablePwdPolicyCheck,
+    public WorkflowResult<Pair<String, Boolean>> create(final UserTO userTO, final boolean disablePwdPolicyCheck,
             final boolean storePassword) {
 
         return create(userTO, disablePwdPolicyCheck, null, storePassword);
     }
 
     @Override
-    public WorkflowResult<Pair<Long, Boolean>> create(final UserTO userTO, final boolean storePassword) {
+    public WorkflowResult<Pair<String, Boolean>> create(final UserTO userTO, final boolean storePassword) {
         return create(userTO, false, storePassword);
     }
 
     @Override
-    public WorkflowResult<Pair<Long, Boolean>> create(final UserTO userTO, final boolean disablePwdPolicyCheck,
+    public WorkflowResult<Pair<String, Boolean>> create(final UserTO userTO, final boolean disablePwdPolicyCheck,
             final Boolean enabled, final boolean storePassword) {
 
         Map<String, Object> variables = new HashMap<>();
@@ -270,7 +270,7 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
 
         Set<String> tasks = getPerformedTasks(user);
 
-        return new WorkflowResult<Pair<Long, Boolean>>(
+        return new WorkflowResult<Pair<String, Boolean>>(
                 new ImmutablePair<>(user.getKey(), propagateEnable), propByRes, tasks);
     }
 
@@ -313,7 +313,7 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
     }
 
     @Override
-    protected WorkflowResult<Long> doActivate(final User user, final String token) {
+    protected WorkflowResult<String> doActivate(final User user, final String token) {
         Set<String> tasks = doExecuteTask(user, "activate", Collections.singletonMap(TOKEN, (Object) token));
 
         updateStatus(user);
@@ -345,7 +345,7 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
     }
 
     @Override
-    protected WorkflowResult<Long> doSuspend(final User user) {
+    protected WorkflowResult<String> doSuspend(final User user) {
         Set<String> performedTasks = doExecuteTask(user, "suspend", null);
         updateStatus(user);
         User updated = userDAO.save(user);
@@ -354,7 +354,7 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
     }
 
     @Override
-    protected WorkflowResult<Long> doReactivate(final User user) {
+    protected WorkflowResult<String> doReactivate(final User user) {
         Set<String> performedTasks = doExecuteTask(user, "reactivate", null);
         updateStatus(user);
 
@@ -424,7 +424,7 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
     }
 
     @Override
-    public WorkflowResult<Long> execute(final UserTO userTO, final String taskId) {
+    public WorkflowResult<String> execute(final UserTO userTO, final String taskId) {
         User user = userDAO.authFind(userTO.getKey());
 
         final Map<String, Object> variables = new HashMap<>();
@@ -678,18 +678,18 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
             forms.addAll(getForms(engine.getTaskService().createTaskQuery().
                     taskVariableValueEquals(TASK_IS_FORM, Boolean.TRUE)));
         } else {
-            User user = userDAO.find(authUser);
+            User user = userDAO.findByUsername(authUser);
             if (user == null) {
                 throw new NotFoundException("Syncope User " + authUser);
             }
 
             forms.addAll(getForms(engine.getTaskService().createTaskQuery().
                     taskVariableValueEquals(TASK_IS_FORM, Boolean.TRUE).
-                    taskCandidateOrAssigned(user.getKey().toString())));
+                    taskCandidateOrAssigned(user.getKey())));
 
             List<String> candidateGroups = new ArrayList<>();
-            for (Long groupId : userDAO.findAllGroupKeys(user)) {
-                candidateGroups.add(groupId.toString());
+            for (String groupKey : userDAO.findAllGroupKeys(user)) {
+                candidateGroups.add(groupKey);
             }
             if (!candidateGroups.isEmpty()) {
                 forms.addAll(getForms(engine.getTaskService().createTaskQuery().
@@ -766,7 +766,7 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
         }
 
         if (!adminUser.equals(authUser)) {
-            User user = userDAO.find(authUser);
+            User user = userDAO.findByUsername(authUser);
             if (user == null) {
                 throw new NotFoundException("Syncope User " + authUser);
             }

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUtils.java
----------------------------------------------------------------------
diff --git a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUtils.java b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUtils.java
index a11dcfa..963a7d1 100644
--- a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUtils.java
+++ b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUtils.java
@@ -27,7 +27,7 @@ import org.springframework.transaction.annotation.Transactional;
 public class ActivitiUtils {
 
     @Transactional(readOnly = true)
-    public boolean isUserIngroup(final User user, final Long groupKey) {
+    public boolean isUserIngroup(final User user, final String groupKey) {
         return IterableUtils.matchesAny(user.getMemberships(), new Predicate<UMembership>() {
 
             @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeGroupManager.java
----------------------------------------------------------------------
diff --git a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeGroupManager.java b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeGroupManager.java
index b1f1c8c..9293dae 100644
--- a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeGroupManager.java
+++ b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeGroupManager.java
@@ -64,11 +64,11 @@ public class SyncopeGroupManager implements GroupIdentityManager, SyncopeSession
     @Override
     public List<Group> findGroupsByUser(final String userId) {
         List<Group> result = Collections.emptyList();
-        User user = userDAO.find(userId);
+        User user = userDAO.findByUsername(userId);
         if (user != null) {
             result = new ArrayList<>();
-            for (Long groupId : userDAO.findAllGroupKeys(user)) {
-                result.add(new GroupEntity(groupId.toString()));
+            for (String groupKey : userDAO.findAllGroupKeys(user)) {
+                result.add(new GroupEntity(groupKey));
             }
         }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeGroupQueryImpl.java
----------------------------------------------------------------------
diff --git a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeGroupQueryImpl.java b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeGroupQueryImpl.java
index 4336cf6..46d82a3 100644
--- a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeGroupQueryImpl.java
+++ b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeGroupQueryImpl.java
@@ -21,7 +21,6 @@ package org.apache.syncope.core.workflow.activiti;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-
 import org.activiti.engine.ActivitiException;
 import org.activiti.engine.identity.Group;
 import org.activiti.engine.identity.GroupQuery;
@@ -34,7 +33,7 @@ public class SyncopeGroupQueryImpl implements GroupQuery {
 
     private final GroupDAO groupDAO;
 
-    private Long groupId;
+    private String groupId;
 
     private List<Group> result;
 
@@ -45,7 +44,7 @@ public class SyncopeGroupQueryImpl implements GroupQuery {
     @Override
     public GroupQuery groupId(final String groupId) {
         try {
-            this.groupId = Long.valueOf(groupId);
+            this.groupId = groupId;
         } catch (NumberFormatException e) {
             // ignore
         }
@@ -99,12 +98,12 @@ public class SyncopeGroupQueryImpl implements GroupQuery {
     }
 
     private Group fromSyncopeGroup(final org.apache.syncope.core.persistence.api.entity.group.Group group) {
-        return new GroupEntity(group.getKey().toString());
+        return new GroupEntity(group.getKey());
     }
 
     private void execute() {
         if (groupId != null) {
-            org.apache.syncope.core.persistence.api.entity.group.Group syncopeGroup = groupDAO.find(groupId);
+            org.apache.syncope.core.persistence.api.entity.group.Group syncopeGroup = groupDAO.findByName(groupId);
             if (syncopeGroup == null) {
                 result = Collections.emptyList();
             } else {

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeUserManager.java
----------------------------------------------------------------------
diff --git a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeUserManager.java b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeUserManager.java
index 658795c..260639a 100644
--- a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeUserManager.java
+++ b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeUserManager.java
@@ -75,7 +75,7 @@ public class SyncopeUserManager implements UserIdentityManager, SyncopeSession {
         org.apache.syncope.core.persistence.api.entity.user.User user = userDAO.find(userKey);
         if (user != null) {
             result = new ArrayList<>();
-            for (Long groupKey : userDAO.findAllGroupKeys(user)) {
+            for (String groupKey : userDAO.findAllGroupKeys(user)) {
                 result.add(new GroupEntity(groupKey.toString()));
             }
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeUserQueryImpl.java
----------------------------------------------------------------------
diff --git a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeUserQueryImpl.java b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeUserQueryImpl.java
index e213c6e..2950b1f 100644
--- a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeUserQueryImpl.java
+++ b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/SyncopeUserQueryImpl.java
@@ -40,7 +40,7 @@ public class SyncopeUserQueryImpl implements UserQuery {
 
     private String username;
 
-    private Long memberOf;
+    private String memberOf;
 
     private List<User> result;
 
@@ -92,11 +92,7 @@ public class SyncopeUserQueryImpl implements UserQuery {
 
     @Override
     public UserQuery memberOfGroup(final String groupId) {
-        try {
-            memberOf = Long.valueOf(groupId);
-        } catch (NumberFormatException e) {
-            // ignore
-        }
+        memberOf = groupId;
         return this;
     }
 
@@ -136,7 +132,7 @@ public class SyncopeUserQueryImpl implements UserQuery {
 
     private void execute() {
         if (username != null) {
-            org.apache.syncope.core.persistence.api.entity.user.User user = userDAO.find(username);
+            org.apache.syncope.core.persistence.api.entity.user.User user = userDAO.findByUsername(username);
             if (user == null) {
                 result = Collections.<User>emptyList();
             } else if (memberOf == null || userDAO.findAllGroupKeys(user).contains(memberOf)) {
@@ -144,7 +140,7 @@ public class SyncopeUserQueryImpl implements UserQuery {
             }
         }
         if (memberOf != null) {
-            Group group = groupDAO.find(memberOf);
+            Group group = groupDAO.findByName(memberOf);
             if (group == null) {
                 result = Collections.<User>emptyList();
             } else {

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowAdapter.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowAdapter.java
index 2a05443..22dac48 100644
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowAdapter.java
+++ b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/AnyObjectWorkflowAdapter.java
@@ -33,7 +33,7 @@ public interface AnyObjectWorkflowAdapter extends WorkflowAdapter {
      * @param anyObjectTO anyObject to be created and whether to propagate it as active
      * @return anyObject just created
      */
-    WorkflowResult<Long> create(AnyObjectTO anyObjectTO);
+    WorkflowResult<String> create(AnyObjectTO anyObjectTO);
 
     /**
      * Execute a task on a anyObject.
@@ -42,7 +42,7 @@ public interface AnyObjectWorkflowAdapter extends WorkflowAdapter {
      * @param taskId to be executed
      * @return anyObject just updated
      */
-    WorkflowResult<Long> execute(AnyObjectTO anyObjectTO, String taskId);
+    WorkflowResult<String> execute(AnyObjectTO anyObjectTO, String taskId);
 
     /**
      * Update a anyObject.
@@ -50,12 +50,12 @@ public interface AnyObjectWorkflowAdapter extends WorkflowAdapter {
      * @param anyObjectPatch modification set to be performed
      * @return anyObject just updated and propagations to be performed
      */
-    WorkflowResult<Long> update(AnyObjectPatch anyObjectPatch);
+    WorkflowResult<String> update(AnyObjectPatch anyObjectPatch);
 
     /**
      * Delete a anyObject.
      *
      * @param anyObjectKey anyObject to be deleted
      */
-    void delete(Long anyObjectKey);
+    void delete(String anyObjectKey);
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowAdapter.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowAdapter.java
index 04f7f17..df0740b 100644
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowAdapter.java
+++ b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/GroupWorkflowAdapter.java
@@ -33,7 +33,7 @@ public interface GroupWorkflowAdapter extends WorkflowAdapter {
      * @param groupTO group to be created and whether to propagate it as active
      * @return group just created
      */
-    WorkflowResult<Long> create(GroupTO groupTO);
+    WorkflowResult<String> create(GroupTO groupTO);
 
     /**
      * Execute a task on a group.
@@ -42,7 +42,7 @@ public interface GroupWorkflowAdapter extends WorkflowAdapter {
      * @param taskId to be executed
      * @return group just updated
      */
-    WorkflowResult<Long> execute(GroupTO groupTO, String taskId);
+    WorkflowResult<String> execute(GroupTO groupTO, String taskId);
 
     /**
      * Update a group.
@@ -50,12 +50,12 @@ public interface GroupWorkflowAdapter extends WorkflowAdapter {
      * @param groupPatch modification set to be performed
      * @return group just updated and propagations to be performed
      */
-    WorkflowResult<Long> update(GroupPatch groupPatch);
+    WorkflowResult<String> update(GroupPatch groupPatch);
 
     /**
      * Delete a group.
      *
      * @param groupKey group to be deleted
      */
-    void delete(Long groupKey);
+    void delete(String groupKey);
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowAdapter.java b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowAdapter.java
index 91a83aa..91487ee 100644
--- a/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowAdapter.java
+++ b/core/workflow-api/src/main/java/org/apache/syncope/core/workflow/api/UserWorkflowAdapter.java
@@ -35,7 +35,7 @@ public interface UserWorkflowAdapter extends WorkflowAdapter {
      * @param storePassword whether password shall be stored into the internal storage
      * @return user just created
      */
-    WorkflowResult<Pair<Long, Boolean>> create(UserTO userTO, boolean storePassword);
+    WorkflowResult<Pair<String, Boolean>> create(UserTO userTO, boolean storePassword);
 
     /**
      * Create an user, optionally disabling password policy check.
@@ -45,7 +45,7 @@ public interface UserWorkflowAdapter extends WorkflowAdapter {
      * @param storePassword whether password shall be stored into the internal storage
      * @return user just created
      */
-    WorkflowResult<Pair<Long, Boolean>> create(
+    WorkflowResult<Pair<String, Boolean>> create(
             UserTO userTO, boolean disablePwdPolicyCheck, boolean storePassword);
 
     /**
@@ -57,7 +57,7 @@ public interface UserWorkflowAdapter extends WorkflowAdapter {
      * @param storePassword whether password shall be stored into the internal storage
      * @return user just created
      */
-    WorkflowResult<Pair<Long, Boolean>> create(
+    WorkflowResult<Pair<String, Boolean>> create(
             UserTO userTO, boolean disablePwdPolicyCheck, final Boolean enabled, boolean storePassword);
 
     /**
@@ -67,7 +67,7 @@ public interface UserWorkflowAdapter extends WorkflowAdapter {
      * @param taskId to be executed
      * @return user just updated
      */
-    WorkflowResult<Long> execute(UserTO userTO, String taskId);
+    WorkflowResult<String> execute(UserTO userTO, String taskId);
 
     /**
      * Activate an user.
@@ -76,7 +76,7 @@ public interface UserWorkflowAdapter extends WorkflowAdapter {
      * @param token to be verified for activation
      * @return user just updated
      */
-    WorkflowResult<Long> activate(Long userKey, String token);
+    WorkflowResult<String> activate(String userKey, String token);
 
     /**
      * Update an user.
@@ -92,7 +92,7 @@ public interface UserWorkflowAdapter extends WorkflowAdapter {
      * @param key to be suspended
      * @return user just suspended
      */
-    WorkflowResult<Long> suspend(Long key);
+    WorkflowResult<String> suspend(String key);
 
     /**
      * Suspend an user (used by internal authentication process)
@@ -100,7 +100,7 @@ public interface UserWorkflowAdapter extends WorkflowAdapter {
      * @param key to be suspended
      * @return user just suspended and information whether to propagate suspension
      */
-    Pair<WorkflowResult<Long>, Boolean> internalSuspend(Long key);
+    Pair<WorkflowResult<String>, Boolean> internalSuspend(String key);
 
     /**
      * Reactivate an user.
@@ -108,14 +108,14 @@ public interface UserWorkflowAdapter extends WorkflowAdapter {
      * @param userKey user to be reactivated
      * @return user just reactivated
      */
-    WorkflowResult<Long> reactivate(Long userKey);
+    WorkflowResult<String> reactivate(String userKey);
 
     /**
      * Request password reset for an user.
      *
      * @param userKey user requesting password reset
      */
-    void requestPasswordReset(Long userKey);
+    void requestPasswordReset(String userKey);
 
     /**
      * Confirm password reset for an user.
@@ -125,12 +125,12 @@ public interface UserWorkflowAdapter extends WorkflowAdapter {
      * @param password new password value
      * @return user just updated and propagations to be performed
      */
-    WorkflowResult<Pair<UserPatch, Boolean>> confirmPasswordReset(Long userKey, String token, String password);
+    WorkflowResult<Pair<UserPatch, Boolean>> confirmPasswordReset(String userKey, String token, String password);
 
     /**
      * Delete an user.
      *
      * @param userKey user to be deleted
      */
-    void delete(Long userKey);
+    void delete(String userKey);
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractAnyObjectWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractAnyObjectWorkflowAdapter.java b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractAnyObjectWorkflowAdapter.java
index d124051..34f1a0c 100644
--- a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractAnyObjectWorkflowAdapter.java
+++ b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractAnyObjectWorkflowAdapter.java
@@ -46,17 +46,17 @@ public abstract class AbstractAnyObjectWorkflowAdapter implements AnyObjectWorkf
         return null;
     }
 
-    protected abstract WorkflowResult<Long> doUpdate(AnyObject anyObject, AnyObjectPatch anyObjectPatch);
+    protected abstract WorkflowResult<String> doUpdate(AnyObject anyObject, AnyObjectPatch anyObjectPatch);
 
     @Override
-    public WorkflowResult<Long> update(final AnyObjectPatch anyObjectPatch) {
+    public WorkflowResult<String> update(final AnyObjectPatch anyObjectPatch) {
         return doUpdate(anyObjectDAO.authFind(anyObjectPatch.getKey()), anyObjectPatch);
     }
 
     protected abstract void doDelete(AnyObject anyObject);
 
     @Override
-    public void delete(final Long anyObjectKey) {
+    public void delete(final String anyObjectKey) {
         doDelete(anyObjectDAO.authFind(anyObjectKey));
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractGroupWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractGroupWorkflowAdapter.java b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractGroupWorkflowAdapter.java
index 50e96fe..952edb2 100644
--- a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractGroupWorkflowAdapter.java
+++ b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractGroupWorkflowAdapter.java
@@ -46,17 +46,17 @@ public abstract class AbstractGroupWorkflowAdapter implements GroupWorkflowAdapt
         return null;
     }
 
-    protected abstract WorkflowResult<Long> doUpdate(Group group, GroupPatch groupPatch);
+    protected abstract WorkflowResult<String> doUpdate(Group group, GroupPatch groupPatch);
 
     @Override
-    public WorkflowResult<Long> update(final GroupPatch groupPatch) {
+    public WorkflowResult<String> update(final GroupPatch groupPatch) {
         return doUpdate(groupDAO.authFind(groupPatch.getKey()), groupPatch);
     }
 
     protected abstract void doDelete(Group group);
 
     @Override
-    public void delete(final Long groupKey) {
+    public void delete(final String groupKey) {
         doDelete(groupDAO.authFind(groupKey));
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractUserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractUserWorkflowAdapter.java b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractUserWorkflowAdapter.java
index 716090f..546d03b 100644
--- a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractUserWorkflowAdapter.java
+++ b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/AbstractUserWorkflowAdapter.java
@@ -64,10 +64,10 @@ public abstract class AbstractUserWorkflowAdapter implements UserWorkflowAdapter
         return null;
     }
 
-    protected abstract WorkflowResult<Long> doActivate(User user, String token);
+    protected abstract WorkflowResult<String> doActivate(User user, String token);
 
     @Override
-    public WorkflowResult<Long> activate(final Long key, final String token) {
+    public WorkflowResult<String> activate(final String key, final String token) {
         return doActivate(userDAO.authFind(key), token);
     }
 
@@ -78,10 +78,10 @@ public abstract class AbstractUserWorkflowAdapter implements UserWorkflowAdapter
         return doUpdate(userDAO.authFind(userPatch.getKey()), userPatch);
     }
 
-    protected abstract WorkflowResult<Long> doSuspend(User user);
+    protected abstract WorkflowResult<String> doSuspend(User user);
 
     @Override
-    public WorkflowResult<Long> suspend(final Long key) {
+    public WorkflowResult<String> suspend(final String key) {
         User user = userDAO.authFind(key);
 
         // set suspended flag
@@ -91,10 +91,10 @@ public abstract class AbstractUserWorkflowAdapter implements UserWorkflowAdapter
     }
 
     @Override
-    public Pair<WorkflowResult<Long>, Boolean> internalSuspend(final Long key) {
+    public Pair<WorkflowResult<String>, Boolean> internalSuspend(final String key) {
         User user = userDAO.authFind(key);
 
-        Pair<WorkflowResult<Long>, Boolean> result = null;
+        Pair<WorkflowResult<String>, Boolean> result = null;
 
         Pair<Boolean, Boolean> enforce = userDAO.enforcePolicies(user);
         if (enforce.getKey()) {
@@ -112,10 +112,10 @@ public abstract class AbstractUserWorkflowAdapter implements UserWorkflowAdapter
         return result;
     }
 
-    protected abstract WorkflowResult<Long> doReactivate(User user);
+    protected abstract WorkflowResult<String> doReactivate(User user);
 
     @Override
-    public WorkflowResult<Long> reactivate(final Long key) {
+    public WorkflowResult<String> reactivate(final String key) {
         User user = userDAO.authFind(key);
 
         // reset failed logins
@@ -130,7 +130,7 @@ public abstract class AbstractUserWorkflowAdapter implements UserWorkflowAdapter
     protected abstract void doRequestPasswordReset(User user);
 
     @Override
-    public void requestPasswordReset(final Long key) {
+    public void requestPasswordReset(final String key) {
         doRequestPasswordReset(userDAO.authFind(key));
     }
 
@@ -139,7 +139,7 @@ public abstract class AbstractUserWorkflowAdapter implements UserWorkflowAdapter
 
     @Override
     public WorkflowResult<Pair<UserPatch, Boolean>> confirmPasswordReset(
-            final Long key, final String token, final String password) {
+            final String key, final String token, final String password) {
 
         return doConfirmPasswordReset(userDAO.authFind(key), token, password);
     }
@@ -147,7 +147,7 @@ public abstract class AbstractUserWorkflowAdapter implements UserWorkflowAdapter
     protected abstract void doDelete(User user);
 
     @Override
-    public void delete(final Long key) {
+    public void delete(final String key) {
         doDelete(userDAO.authFind(key));
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultAnyObjectWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultAnyObjectWorkflowAdapter.java b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultAnyObjectWorkflowAdapter.java
index 5f4c198..630bd8b 100644
--- a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultAnyObjectWorkflowAdapter.java
+++ b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultAnyObjectWorkflowAdapter.java
@@ -39,7 +39,7 @@ import org.springframework.transaction.annotation.Transactional;
 public class DefaultAnyObjectWorkflowAdapter extends AbstractAnyObjectWorkflowAdapter {
 
     @Override
-    public WorkflowResult<Long> create(final AnyObjectTO anyObjectTO) {
+    public WorkflowResult<String> create(final AnyObjectTO anyObjectTO) {
         AnyObject anyObject = entityFactory.newEntity(AnyObject.class);
         dataBinder.create(anyObject, anyObjectTO);
         anyObject = anyObjectDAO.save(anyObject);
@@ -51,7 +51,7 @@ public class DefaultAnyObjectWorkflowAdapter extends AbstractAnyObjectWorkflowAd
     }
 
     @Override
-    protected WorkflowResult<Long> doUpdate(final AnyObject anyObject, final AnyObjectPatch anyObjectPatch) {
+    protected WorkflowResult<String> doUpdate(final AnyObject anyObject, final AnyObjectPatch anyObjectPatch) {
         PropagationByResource propByRes = dataBinder.update(anyObject, anyObjectPatch);
 
         AnyObject updated = anyObjectDAO.save(anyObject);
@@ -65,7 +65,7 @@ public class DefaultAnyObjectWorkflowAdapter extends AbstractAnyObjectWorkflowAd
     }
 
     @Override
-    public WorkflowResult<Long> execute(final AnyObjectTO anyObject, final String taskId) {
+    public WorkflowResult<String> execute(final AnyObjectTO anyObject, final String taskId) {
         throw new WorkflowException(new UnsupportedOperationException("Not supported."));
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultGroupWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultGroupWorkflowAdapter.java b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultGroupWorkflowAdapter.java
index e14b9a1..b99b22b 100644
--- a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultGroupWorkflowAdapter.java
+++ b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultGroupWorkflowAdapter.java
@@ -39,7 +39,7 @@ import org.springframework.transaction.annotation.Transactional;
 public class DefaultGroupWorkflowAdapter extends AbstractGroupWorkflowAdapter {
 
     @Override
-    public WorkflowResult<Long> create(final GroupTO groupTO) {
+    public WorkflowResult<String> create(final GroupTO groupTO) {
         Group group = entityFactory.newEntity(Group.class);
         dataBinder.create(group, groupTO);
         group = groupDAO.save(group);
@@ -51,7 +51,7 @@ public class DefaultGroupWorkflowAdapter extends AbstractGroupWorkflowAdapter {
     }
 
     @Override
-    protected WorkflowResult<Long> doUpdate(final Group group, final GroupPatch groupPatch) {
+    protected WorkflowResult<String> doUpdate(final Group group, final GroupPatch groupPatch) {
         PropagationByResource propByRes = dataBinder.update(group, groupPatch);
 
         Group updated = groupDAO.save(group);
@@ -65,7 +65,7 @@ public class DefaultGroupWorkflowAdapter extends AbstractGroupWorkflowAdapter {
     }
 
     @Override
-    public WorkflowResult<Long> execute(final GroupTO group, final String taskId) {
+    public WorkflowResult<String> execute(final GroupTO group, final String taskId) {
         throw new WorkflowException(new UnsupportedOperationException("Not supported."));
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java
index 6523474..6ede0ef 100644
--- a/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java
+++ b/core/workflow-java/src/main/java/org/apache/syncope/core/workflow/java/DefaultUserWorkflowAdapter.java
@@ -45,19 +45,19 @@ public class DefaultUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
     private ConfDAO confDAO;
 
     @Override
-    public WorkflowResult<Pair<Long, Boolean>> create(final UserTO userTO, final boolean storePassword) {
+    public WorkflowResult<Pair<String, Boolean>> create(final UserTO userTO, final boolean storePassword) {
         return create(userTO, false, true);
     }
 
     @Override
-    public WorkflowResult<Pair<Long, Boolean>> create(final UserTO userTO, final boolean disablePwdPolicyCheck,
+    public WorkflowResult<Pair<String, Boolean>> create(final UserTO userTO, final boolean disablePwdPolicyCheck,
             final boolean storePassword) {
 
         return create(userTO, disablePwdPolicyCheck, null, storePassword);
     }
 
     @Override
-    public WorkflowResult<Pair<Long, Boolean>> create(final UserTO userTO, final boolean disablePwdPolicyCheck,
+    public WorkflowResult<Pair<String, Boolean>> create(final UserTO userTO, final boolean disablePwdPolicyCheck,
             final Boolean enabled, final boolean storePassword) {
 
         User user = entityFactory.newEntity(User.class);
@@ -87,12 +87,12 @@ public class DefaultUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
         final PropagationByResource propByRes = new PropagationByResource();
         propByRes.set(ResourceOperation.CREATE, userDAO.findAllResourceNames(user));
 
-        return new WorkflowResult<Pair<Long, Boolean>>(
+        return new WorkflowResult<Pair<String, Boolean>>(
                 new ImmutablePair<>(user.getKey(), propagateEnable), propByRes, "create");
     }
 
     @Override
-    protected WorkflowResult<Long> doActivate(final User user, final String token) {
+    protected WorkflowResult<String> doActivate(final User user, final String token) {
         if (!user.checkToken(token)) {
             throw new WorkflowException(new IllegalArgumentException("Wrong token: " + token + " for " + user));
         }
@@ -115,7 +115,7 @@ public class DefaultUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
     }
 
     @Override
-    protected WorkflowResult<Long> doSuspend(final User user) {
+    protected WorkflowResult<String> doSuspend(final User user) {
         user.setStatus("suspended");
         User updated = userDAO.save(user);
 
@@ -123,7 +123,7 @@ public class DefaultUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
     }
 
     @Override
-    protected WorkflowResult<Long> doReactivate(final User user) {
+    protected WorkflowResult<String> doReactivate(final User user) {
         user.setStatus("active");
         User updated = userDAO.save(user);
 
@@ -162,7 +162,7 @@ public class DefaultUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
     }
 
     @Override
-    public WorkflowResult<Long> execute(final UserTO userTO, final String taskId) {
+    public WorkflowResult<String> execute(final UserTO userTO, final String taskId) {
         throw new WorkflowException(new UnsupportedOperationException("Not supported."));
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/CamelRouteLogic.java
----------------------------------------------------------------------
diff --git a/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/CamelRouteLogic.java b/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/CamelRouteLogic.java
index b30a010..b489f3b 100644
--- a/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/CamelRouteLogic.java
+++ b/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/CamelRouteLogic.java
@@ -106,8 +106,8 @@ public class CamelRouteLogic extends AbstractTransactionalLogic<CamelRouteTO> {
         } else {
             MetricRegistry registry = registryService.getMetricsRegistry();
             for (Map.Entry<String, Timer> entry : registry.getTimers().entrySet()) {
-                CamelMetrics.MeanRate meanRate = new CamelMetrics.MeanRate();
-                meanRate.setRouteId(StringUtils.substringBetween(entry.getKey(), ":", "."));
+                CamelMetrics.MeanRate meanRate = new CamelMetrics.MeanRate();                
+                meanRate.setRouteId(StringUtils.substringBetween(entry.getKey(), ".", "."));
                 meanRate.setValue(entry.getValue().getMeanRate());
                 metrics.getResponseMeanRates().add(meanRate);
             }

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/init/CamelRouteLoader.java
----------------------------------------------------------------------
diff --git a/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/init/CamelRouteLoader.java b/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/init/CamelRouteLoader.java
index 3c72ed2..9b5de4c 100644
--- a/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/init/CamelRouteLoader.java
+++ b/ext/camel/logic/src/main/java/org/apache/syncope/core/logic/init/CamelRouteLoader.java
@@ -178,7 +178,7 @@ public class CamelRouteLoader implements SyncopeLoader {
                     String routeId = ((Element) routeElement).getAttribute("id");
 
                     jdbcTemplate.update(
-                            String.format("INSERT INTO %s(NAME, ANYTYPEKIND, CONTENT) VALUES (?, ?, ?)",
+                            String.format("INSERT INTO %s(KEY, ANYTYPEKIND, CONTENT) VALUES (?, ?, ?)",
                                     CamelRoute.class.getSimpleName()),
                             new Object[] { routeId, anyTypeKind.name(), routeContent });
                     LOG.info("[{}] Route successfully loaded: {}", domain, routeId);

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/ext/camel/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/CamelRouteDAO.java
----------------------------------------------------------------------
diff --git a/ext/camel/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/CamelRouteDAO.java b/ext/camel/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/CamelRouteDAO.java
index 8162bde..d843ab8 100644
--- a/ext/camel/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/CamelRouteDAO.java
+++ b/ext/camel/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/CamelRouteDAO.java
@@ -22,7 +22,7 @@ import java.util.List;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 import org.apache.syncope.core.persistence.api.entity.CamelRoute;
 
-public interface CamelRouteDAO extends DAO<CamelRoute, String> {
+public interface CamelRouteDAO extends DAO<CamelRoute> {
 
     CamelRoute find(String key);
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/ext/camel/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/CamelRoute.java
----------------------------------------------------------------------
diff --git a/ext/camel/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/CamelRoute.java b/ext/camel/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/CamelRoute.java
index 5e25c68..8e6676e 100644
--- a/ext/camel/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/CamelRoute.java
+++ b/ext/camel/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/CamelRoute.java
@@ -20,9 +20,7 @@ package org.apache.syncope.core.persistence.api.entity;
 
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 
-public interface CamelRoute extends Entity<String> {
-
-    void setKey(String name);
+public interface CamelRoute extends ProvidedKeyEntity {
 
     AnyTypeKind getAnyTypeKind();
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/ext/camel/persistence-jpa/pom.xml
----------------------------------------------------------------------
diff --git a/ext/camel/persistence-jpa/pom.xml b/ext/camel/persistence-jpa/pom.xml
index 4dfece3..a51d018 100644
--- a/ext/camel/persistence-jpa/pom.xml
+++ b/ext/camel/persistence-jpa/pom.xml
@@ -64,7 +64,7 @@ under the License.
           </dependency>
         </dependencies>
         <configuration>
-          <persistenceXmlFile>${rootpom.basedir}/core/persistence-jpa/src/test/resources/META-INF/persistence-enhance.xml</persistenceXmlFile> 
+          <persistenceXmlFile>${rootpom.basedir}/core/persistence-jpa/src/main/resources/persistence-enhance.xml</persistenceXmlFile> 
           <includes>org/apache/syncope/core/persistence/jpa/entity/**/*.class</includes>
           <connectionDriverName>org.springframework.jdbc.datasource.DriverManagerDataSource</connectionDriverName>
           <connectionProperties>

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/ext/camel/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPACamelRouteDAO.java
----------------------------------------------------------------------
diff --git a/ext/camel/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPACamelRouteDAO.java b/ext/camel/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPACamelRouteDAO.java
index 8894992..7d941ab 100644
--- a/ext/camel/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPACamelRouteDAO.java
+++ b/ext/camel/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPACamelRouteDAO.java
@@ -28,7 +28,7 @@ import org.springframework.stereotype.Repository;
 import org.springframework.transaction.annotation.Transactional;
 
 @Repository
-public class JPACamelRouteDAO extends AbstractDAO<CamelRoute, String> implements CamelRouteDAO {
+public class JPACamelRouteDAO extends AbstractDAO<CamelRoute> implements CamelRouteDAO {
 
     @Override
     public CamelRoute find(final String key) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/ext/camel/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPACamelRoute.java
----------------------------------------------------------------------
diff --git a/ext/camel/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPACamelRoute.java b/ext/camel/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPACamelRoute.java
index b4ab959..813cb9a 100644
--- a/ext/camel/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPACamelRoute.java
+++ b/ext/camel/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPACamelRoute.java
@@ -19,7 +19,6 @@
 package org.apache.syncope.core.persistence.jpa.entity;
 
 import javax.persistence.Entity;
-import javax.persistence.Id;
 import javax.persistence.Lob;
 import javax.persistence.EnumType;
 import javax.persistence.Enumerated;
@@ -30,15 +29,12 @@ import org.apache.syncope.core.persistence.api.entity.CamelRoute;
 
 @Entity
 @Table(name = JPACamelRoute.TABLE)
-public class JPACamelRoute extends AbstractEntity<String> implements CamelRoute {
+public class JPACamelRoute extends AbstractProvidedKeyEntity implements CamelRoute {
 
     private static final long serialVersionUID = -2767606675667839161L;
 
     public static final String TABLE = "CamelRoute";
 
-    @Id
-    private String name;
-
     @NotNull
     @Enumerated(EnumType.STRING)
     private AnyTypeKind anyTypeKind;
@@ -47,16 +43,6 @@ public class JPACamelRoute extends AbstractEntity<String> implements CamelRoute
     private String content;
 
     @Override
-    public String getKey() {
-        return name;
-    }
-
-    @Override
-    public void setKey(final String name) {
-        this.name = name;
-    }
-
-    @Override
     public AnyTypeKind getAnyTypeKind() {
         return anyTypeKind;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/CamelAnyObjectProvisioningManager.java
----------------------------------------------------------------------
diff --git a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/CamelAnyObjectProvisioningManager.java b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/CamelAnyObjectProvisioningManager.java
index 3e2f9f8..0a51ce9 100644
--- a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/CamelAnyObjectProvisioningManager.java
+++ b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/CamelAnyObjectProvisioningManager.java
@@ -36,13 +36,13 @@ public class CamelAnyObjectProvisioningManager
         extends AbstractCamelProvisioningManager implements AnyObjectProvisioningManager {
 
     @Override
-    public Pair<Long, List<PropagationStatus>> create(final AnyObjectTO any, final boolean nullPriorityAsync) {
+    public Pair<String, List<PropagationStatus>> create(final AnyObjectTO any, final boolean nullPriorityAsync) {
         return create(any, Collections.<String>emptySet(), nullPriorityAsync);
     }
 
     @Override
     @SuppressWarnings("unchecked")
-    public Pair<Long, List<PropagationStatus>> create(
+    public Pair<String, List<PropagationStatus>> create(
             final AnyObjectTO anyObjectTO, final Set<String> excludedResources, final boolean nullPriorityAsync) {
 
         PollingConsumer pollingConsumer = getConsumer("direct:createAnyObjectPort");
@@ -63,13 +63,15 @@ public class CamelAnyObjectProvisioningManager
     }
 
     @Override
-    public Pair<Long, List<PropagationStatus>> update(final AnyObjectPatch anyPatch, final boolean nullPriorityAsync) {
+    public Pair<String, List<PropagationStatus>> update(
+            final AnyObjectPatch anyPatch, final boolean nullPriorityAsync) {
+
         return update(anyPatch, Collections.<String>emptySet(), nullPriorityAsync);
     }
 
     @Override
     @SuppressWarnings("unchecked")
-    public Pair<Long, List<PropagationStatus>> update(
+    public Pair<String, List<PropagationStatus>> update(
             final AnyObjectPatch anyPatch, final Set<String> excludedResources, final boolean nullPriorityAsync) {
 
         PollingConsumer pollingConsumer = getConsumer("direct:updateAnyObjectPort");
@@ -90,14 +92,14 @@ public class CamelAnyObjectProvisioningManager
     }
 
     @Override
-    public List<PropagationStatus> delete(final Long anyObjectObjectKey, final boolean nullPriorityAsync) {
+    public List<PropagationStatus> delete(final String anyObjectObjectKey, final boolean nullPriorityAsync) {
         return delete(anyObjectObjectKey, Collections.<String>emptySet(), nullPriorityAsync);
     }
 
     @Override
     @SuppressWarnings("unchecked")
     public List<PropagationStatus> delete(
-            final Long key, final Set<String> excludedResources, final boolean nullPriorityAsync) {
+            final String key, final Set<String> excludedResources, final boolean nullPriorityAsync) {
 
         PollingConsumer pollingConsumer = getConsumer("direct:deleteAnyObjectPort");
 
@@ -117,7 +119,7 @@ public class CamelAnyObjectProvisioningManager
     }
 
     @Override
-    public Long unlink(final AnyObjectPatch anyObjectPatch) {
+    public String unlink(final AnyObjectPatch anyObjectPatch) {
         PollingConsumer pollingConsumer = getConsumer("direct:unlinkAnyObjectPort");
 
         sendMessage("direct:unlinkAnyObject", anyObjectPatch);
@@ -128,11 +130,11 @@ public class CamelAnyObjectProvisioningManager
             throw (RuntimeException) exchange.getProperty(Exchange.EXCEPTION_CAUGHT);
         }
 
-        return exchange.getIn().getBody(Long.class);
+        return exchange.getIn().getBody(String.class);
     }
 
     @Override
-    public Long link(final AnyObjectPatch anyObjectPatch) {
+    public String link(final AnyObjectPatch anyObjectPatch) {
         PollingConsumer pollingConsumer = getConsumer("direct:linkAnyObjectPort");
 
         sendMessage("direct:linkAnyObject", anyObjectPatch);
@@ -143,13 +145,13 @@ public class CamelAnyObjectProvisioningManager
             throw (RuntimeException) exchange.getProperty(Exchange.EXCEPTION_CAUGHT);
         }
 
-        return exchange.getIn().getBody(Long.class);
+        return exchange.getIn().getBody(String.class);
     }
 
     @Override
     @SuppressWarnings("unchecked")
     public List<PropagationStatus> provision(
-            final Long key, final Collection<String> resources, final boolean nullPriorityAsync) {
+            final String key, final Collection<String> resources, final boolean nullPriorityAsync) {
 
         PollingConsumer pollingConsumer = getConsumer("direct:provisionAnyObjectPort");
 
@@ -171,7 +173,7 @@ public class CamelAnyObjectProvisioningManager
     @Override
     @SuppressWarnings("unchecked")
     public List<PropagationStatus> deprovision(
-            final Long key, final Collection<String> resources, final boolean nullPriorityAsync) {
+            final String key, final Collection<String> resources, final boolean nullPriorityAsync) {
 
         PollingConsumer pollingConsumer = getConsumer("direct:deprovisionAnyObjectPort");
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/550ee4f4/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/CamelGroupProvisioningManager.java
----------------------------------------------------------------------
diff --git a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/CamelGroupProvisioningManager.java b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/CamelGroupProvisioningManager.java
index 0217f17..d3745a1 100644
--- a/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/CamelGroupProvisioningManager.java
+++ b/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/core/provisioning/camel/CamelGroupProvisioningManager.java
@@ -36,13 +36,13 @@ public class CamelGroupProvisioningManager
         extends AbstractCamelProvisioningManager implements GroupProvisioningManager {
 
     @Override
-    public Pair<Long, List<PropagationStatus>> create(final GroupTO any, final boolean nullPriorityAsync) {
+    public Pair<String, List<PropagationStatus>> create(final GroupTO any, final boolean nullPriorityAsync) {
         return create(any, Collections.<String>emptySet(), nullPriorityAsync);
     }
 
     @Override
     @SuppressWarnings("unchecked")
-    public Pair<Long, List<PropagationStatus>> create(
+    public Pair<String, List<PropagationStatus>> create(
             final GroupTO groupTO, final Set<String> excludedResources, final boolean nullPriorityAsync) {
 
         PollingConsumer pollingConsumer = getConsumer("direct:createGroupPort");
@@ -64,9 +64,9 @@ public class CamelGroupProvisioningManager
 
     @Override
     @SuppressWarnings("unchecked")
-    public Pair<Long, List<PropagationStatus>> create(
+    public Pair<String, List<PropagationStatus>> create(
             final GroupTO groupTO,
-            final Map<Long, String> groupOwnerMap,
+            final Map<String, String> groupOwnerMap,
             final Set<String> excludedResources,
             final boolean nullPriorityAsync) {
 
@@ -89,13 +89,13 @@ public class CamelGroupProvisioningManager
     }
 
     @Override
-    public Pair<Long, List<PropagationStatus>> update(final GroupPatch anyPatch, final boolean nullPriorityAsync) {
+    public Pair<String, List<PropagationStatus>> update(final GroupPatch anyPatch, final boolean nullPriorityAsync) {
         return update(anyPatch, Collections.<String>emptySet(), nullPriorityAsync);
     }
 
     @Override
     @SuppressWarnings("unchecked")
-    public Pair<Long, List<PropagationStatus>> update(
+    public Pair<String, List<PropagationStatus>> update(
             final GroupPatch anyPatch, final Set<String> excludedResources, final boolean nullPriorityAsync) {
 
         PollingConsumer pollingConsumer = getConsumer("direct:updateGroupPort");
@@ -116,14 +116,14 @@ public class CamelGroupProvisioningManager
     }
 
     @Override
-    public List<PropagationStatus> delete(final Long key, final boolean nullPriorityAsync) {
+    public List<PropagationStatus> delete(final String key, final boolean nullPriorityAsync) {
         return delete(key, Collections.<String>emptySet(), nullPriorityAsync);
     }
 
     @Override
     @SuppressWarnings("unchecked")
     public List<PropagationStatus> delete(
-            final Long key, final Set<String> excludedResources, final boolean nullPriorityAsync) {
+            final String key, final Set<String> excludedResources, final boolean nullPriorityAsync) {
 
         PollingConsumer pollingConsumer = getConsumer("direct:deleteGroupPort");
 
@@ -143,7 +143,7 @@ public class CamelGroupProvisioningManager
     }
 
     @Override
-    public Long unlink(final GroupPatch groupPatch) {
+    public String unlink(final GroupPatch groupPatch) {
         PollingConsumer pollingConsumer = getConsumer("direct:unlinkGroupPort");
 
         sendMessage("direct:unlinkGroup", groupPatch);
@@ -154,11 +154,11 @@ public class CamelGroupProvisioningManager
             throw (RuntimeException) exchange.getProperty(Exchange.EXCEPTION_CAUGHT);
         }
 
-        return exchange.getIn().getBody(Long.class);
+        return exchange.getIn().getBody(String.class);
     }
 
     @Override
-    public Long link(final GroupPatch groupPatch) {
+    public String link(final GroupPatch groupPatch) {
         PollingConsumer pollingConsumer = getConsumer("direct:linkGroupPort");
 
         sendMessage("direct:linkGroup", groupPatch);
@@ -169,13 +169,13 @@ public class CamelGroupProvisioningManager
             throw (RuntimeException) exchange.getProperty(Exchange.EXCEPTION_CAUGHT);
         }
 
-        return exchange.getIn().getBody(Long.class);
+        return exchange.getIn().getBody(String.class);
     }
 
     @Override
     @SuppressWarnings("unchecked")
     public List<PropagationStatus> provision(
-            final Long key, final Collection<String> resources, final boolean nullPriorityAsync) {
+            final String key, final Collection<String> resources, final boolean nullPriorityAsync) {
 
         PollingConsumer pollingConsumer = getConsumer("direct:provisionGroupPort");
 
@@ -197,7 +197,7 @@ public class CamelGroupProvisioningManager
     @Override
     @SuppressWarnings("unchecked")
     public List<PropagationStatus> deprovision(
-            final Long key, final Collection<String> resources, final boolean nullPriorityAsync) {
+            final String key, final Collection<String> resources, final boolean nullPriorityAsync) {
 
         PollingConsumer pollingConsumer = getConsumer("direct:deprovisionGroupPort");
 


Mime
View raw message