syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmarte...@apache.org
Subject svn commit: r1298759 - in /incubator/syncope/trunk/core/src/main/java/org/syncope/core: init/ notification/ policy/ propagation/ rest/controller/ scheduling/ workflow/
Date Fri, 09 Mar 2012 09:07:51 GMT
Author: fmartelli
Date: Fri Mar  9 09:07:50 2012
New Revision: 1298759

URL: http://svn.apache.org/viewvc?rev=1298759&view=rev
Log:
SYNCOPE-31 #comment user status can be managed during update as well

Modified:
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ContentLoader.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/notification/NotificationManager.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/policy/AccountPolicyEnforcer.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/propagation/PropagationManager.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/UserController.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/scheduling/SyncJob.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/AbstractUserWorkflowAdapter.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/ActivitiUserWorkflowAdapter.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/NoOpUserWorkflowAdapter.java
    incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/UserWorkflowAdapter.java

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ContentLoader.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ContentLoader.java?rev=1298759&r1=1298758&r2=1298759&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ContentLoader.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/init/ContentLoader.java Fri
Mar  9 09:07:50 2012
@@ -69,14 +69,12 @@ public class ContentLoader {
                     ResultSet.TYPE_SCROLL_SENSITIVE,
                     ResultSet.CONCUR_READ_ONLY);
 
-            resultSet = statement.executeQuery("SELECT * FROM "
-                    + SyncopeConf.class.getSimpleName());
+            resultSet = statement.executeQuery("SELECT * FROM " + SyncopeConf.class.getSimpleName());
             resultSet.last();
 
             existingData = resultSet.getRow() > 0;
         } catch (SQLException e) {
-            LOG.error("Could not access to table "
-                    + SyncopeConf.class.getSimpleName(), e);
+            LOG.error("Could not access to table " + SyncopeConf.class.getSimpleName(), e);
 
             // Setting this to true make nothing to be done below
             existingData = true;
@@ -107,8 +105,7 @@ public class ContentLoader {
         // 2. Create views
         LOG.debug("Creating views");
         try {
-            InputStream viewsStream = getClass().getResourceAsStream(
-                    "/views.xml");
+            InputStream viewsStream = getClass().getResourceAsStream("/views.xml");
             Properties views = new Properties();
             views.loadFromXML(viewsStream);
 
@@ -117,8 +114,7 @@ public class ContentLoader {
 
                 try {
                     statement = conn.createStatement();
-                    statement.executeUpdate(views.get(idx).toString().
-                            replaceAll("\\n", " "));
+                    statement.executeUpdate(views.get(idx).toString().replaceAll("\\n", "
"));
                     statement.close();
                 } catch (SQLException e) {
                     LOG.error("Could not create view ", e);
@@ -133,8 +129,7 @@ public class ContentLoader {
         // 3. Create indexes
         LOG.debug("Creating indexes");
         try {
-            InputStream indexesStream = getClass().getResourceAsStream(
-                    "/indexes.xml");
+            InputStream indexesStream = getClass().getResourceAsStream("/indexes.xml");
             Properties indexes = new Properties();
             indexes.loadFromXML(indexesStream);
 
@@ -167,8 +162,7 @@ public class ContentLoader {
         SAXParserFactory factory = SAXParserFactory.newInstance();
         try {
             SAXParser parser = factory.newSAXParser();
-            parser.parse(getClass().getResourceAsStream("/content.xml"),
-                    importExport);
+            parser.parse(getClass().getResourceAsStream("/content.xml"), importExport);
             LOG.debug("Default content successfully loaded");
         } catch (Throwable t) {
             LOG.error("While loading default content", t);

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/notification/NotificationManager.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/notification/NotificationManager.java?rev=1298759&r1=1298758&r2=1298759&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/notification/NotificationManager.java
(original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/notification/NotificationManager.java
Fri Mar  9 09:07:50 2012
@@ -46,6 +46,7 @@ import org.syncope.core.workflow.Workflo
 
 /**
  * Create notification tasks that will be executed by NotificationJob.
+ *
  * @see NotificationTask
  */
 @Transactional(rollbackFor = {
@@ -172,11 +173,10 @@ public class NotificationManager {
     }
 
     /**
-     * Create notification tasks for each notification matching the passed
-     * workflow result.
+     * Create notification tasks for each notification matching the passed workflow result.
+     *
      * @param wfResult workflow result
-     * @throws NotFoundException if user contained in the workflow result
-     * cannot be found
+     * @throws NotFoundException if user contained in the workflow result cannot be found
      */
     public void createTasks(final WorkflowResult<Long> wfResult)
             throws NotFoundException {
@@ -186,22 +186,16 @@ public class NotificationManager {
             throw new NotFoundException("User " + wfResult.getResult());
         }
 
-        final String emailSchema =
-                confDAO.find("email.schema", "email").getValue();
+        final String emailSchema = confDAO.find("email.schema", "email").getValue();
 
         for (Notification notification : notificationDAO.findAll()) {
             if (searchDAO.matches(user, notification.getAbout())) {
-                Set<String> events = new HashSet<String>(
-                        notification.getEvents());
+                Set<String> events = new HashSet<String>(notification.getEvents());
                 events.retainAll(wfResult.getPerformedTasks());
 
                 if (!events.isEmpty()) {
-                    LOG.debug(
-                            "Creating notification task for events {} about {}",
-                            events, user);
-
-                    taskDAO.save(getNotificationTask(notification, user,
-                            emailSchema));
+                    LOG.debug("Creating notification task for events {} about {}", events,
user);
+                    taskDAO.save(getNotificationTask(notification, user, emailSchema));
                 } else {
                     LOG.debug("No events found about {}", user);
                 }

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/policy/AccountPolicyEnforcer.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/policy/AccountPolicyEnforcer.java?rev=1298759&r1=1298758&r2=1298759&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/policy/AccountPolicyEnforcer.java
(original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/policy/AccountPolicyEnforcer.java
Fri Mar  9 09:07:50 2012
@@ -19,7 +19,9 @@
 package org.syncope.core.policy;
 
 import java.util.List;
+import java.util.Map;
 import java.util.regex.Pattern;
+import org.apache.commons.collections.keyvalue.DefaultMapEntry;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.syncope.client.to.UserTO;
@@ -125,8 +127,11 @@ public class AccountPolicyEnforcer
 
                 // propagate suspension if and only if it is required by policy
                 if (policy.isPropagateSuspension()) {
-                    final List<PropagationTask> tasks = propagationManager.
-                            getUpdateTaskIds(updated, Boolean.FALSE);
+                    final List<PropagationTask> tasks = propagationManager.getUpdateTaskIds(
+                            new WorkflowResult<Map.Entry<Long, Boolean>>(
+                            new DefaultMapEntry(updated.getResult(), Boolean.FALSE),
+                            updated.getPropByRes(),
+                            updated.getPerformedTasks()));
 
                     propagationManager.execute(tasks);
                 }

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/propagation/PropagationManager.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/propagation/PropagationManager.java?rev=1298759&r1=1298758&r2=1298759&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/propagation/PropagationManager.java
(original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/propagation/PropagationManager.java
Fri Mar  9 09:07:50 2012
@@ -230,63 +230,57 @@ public class PropagationManager {
      * Performs update on each resource associated to the user.
      *
      * @param wfResult user to be propagated (and info associated), as per result from workflow.
-     * @param enable wether user must be enabled or not.
      * @return list of propagation tasks
      * @throws NotFoundException if userId is not found
      */
     public List<PropagationTask> getUpdateTaskIds(
-            final WorkflowResult<Long> wfResult,
-            final Boolean enable)
+            final WorkflowResult<Map.Entry<Long, Boolean>> wfResult)
             throws NotFoundException {
 
-        return getUpdateTaskIds(wfResult, null, null, null, enable, null);
+        return getUpdateTaskIds(wfResult, null, null, null, null);
     }
 
     /**
      * Performs update on each resource associated to the user.
      *
-     * @param wfResult user to be propagated (and info associated), as per result from workflow
-     * @param password to be updated
-     * @param vAttrsToBeRemoved virtual attributes to be removed
-     * @param vAttrsToBeUpdated virtual attributes to be added
-     * @param enable wether user must be enabled or not
-     * @return list of propagation tasks
-     * @throws NotFoundException if userId is not found
+     * @param wfResult user to be propagated (and info associated), as per result from workflow.
+     * @param password to be updated.
+     * @param vAttrsToBeRemoved virtual attributes to be removed.
+     * @param vAttrsToBeUpdated virtual attributes to be added.
+     * @return list of propagation tasks.
+     * @throws NotFoundException if userId is not found.
      */
     public List<PropagationTask> getUpdateTaskIds(
-            final WorkflowResult<Long> wfResult,
+            final WorkflowResult<Map.Entry<Long, Boolean>> wfResult,
             final String password,
             final Set<String> vAttrsToBeRemoved,
-            final Set<AttributeMod> vAttrsToBeUpdated,
-            final Boolean enable)
+            final Set<AttributeMod> vAttrsToBeUpdated)
             throws NotFoundException {
 
-        return getUpdateTaskIds(wfResult, password, vAttrsToBeRemoved, vAttrsToBeUpdated,
enable, null);
+        return getUpdateTaskIds(wfResult, password, vAttrsToBeRemoved, vAttrsToBeUpdated,
null);
     }
 
     /**
      * Performs update on each resource associated to the user.
      *
-     * @param wfResult user to be propagated (and info associated), as per result from workflow
-     * @param password to be updated
-     * @param vAttrsToBeRemoved virtual attributes to be removed
-     * @param vAttrsToBeUpdated virtual attributes to be added
-     * @param enable wether user must be enabled or not
+     * @param wfResult user to be propagated (and info associated), as per result from workflow.
+     * @param password to be updated.
+     * @param vAttrsToBeRemoved virtual attributes to be removed.
+     * @param vAttrsToBeUpdated virtual attributes to be added.
      * @param syncResourceNames external resource names not to be considered for propagation.
Use this during sync and
      * disable/enable actions limited to the external resources only.
-     * @return list of propagation tasks
-     * @throws NotFoundException if userId is not found
+     * @return list of propagation tasks.
+     * @throws NotFoundException if userId is not found.
      */
     public List<PropagationTask> getUpdateTaskIds(
-            final WorkflowResult<Long> wfResult,
+            final WorkflowResult<Map.Entry<Long, Boolean>> wfResult,
             final String password,
             final Set<String> vAttrsToBeRemoved,
             final Set<AttributeMod> vAttrsToBeUpdated,
-            final Boolean enable,
             final Set<String> syncResourceNames)
             throws NotFoundException {
 
-        SyncopeUser user = getSyncopeUser(wfResult.getResult());
+        SyncopeUser user = getSyncopeUser(wfResult.getResult().getKey());
 
         return getUpdateTaskIds(
                 user,
@@ -294,7 +288,7 @@ public class PropagationManager {
                 password,
                 vAttrsToBeRemoved,
                 vAttrsToBeUpdated,
-                enable,
+                wfResult.getResult().getValue(),
                 syncResourceNames);
     }
 

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/UserController.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/UserController.java?rev=1298759&r1=1298758&r2=1298759&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/UserController.java
(original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/rest/controller/UserController.java
Fri Mar  9 09:07:50 2012
@@ -36,6 +36,7 @@ import java.util.Map;
 import java.util.Set;
 import javassist.NotFoundException;
 import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.collections.keyvalue.DefaultMapEntry;
 import org.identityconnectors.framework.common.objects.ConnectorObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -329,7 +330,7 @@ public class UserController {
 
         LOG.debug("User update called with {}", userMod);
 
-        WorkflowResult<Long> updated = wfAdapter.update(userMod);
+        WorkflowResult<Map.Entry<Long, Boolean>> updated = wfAdapter.update(userMod);
 
         List<PropagationTask> tasks = propagationManager.getUpdateTaskIds(
                 updated, userMod.getPassword(),
@@ -364,10 +365,12 @@ public class UserController {
             }
         });
 
-        notificationManager.createTasks(updated);
+        notificationManager.createTasks(
+                new WorkflowResult<Long>(updated.getResult().getKey(),
+                updated.getPropByRes(),
+                updated.getPerformedTasks()));
 
-        final UserTO updatedTO =
-                userDataBinder.getUserTO(updated.getResult());
+        final UserTO updatedTO = userDataBinder.getUserTO(updated.getResult().getKey());
 
         updatedTO.setPropagationTOs(propagations);
 
@@ -535,8 +538,10 @@ public class UserController {
 
         WorkflowResult<Long> updated = wfAdapter.execute(userTO, taskId);
 
-        List<PropagationTask> tasks =
-                propagationManager.getUpdateTaskIds(updated, null);
+        List<PropagationTask> tasks = propagationManager.getUpdateTaskIds(new WorkflowResult<Map.Entry<Long,
Boolean>>(
+                new DefaultMapEntry(updated.getResult(), null),
+                updated.getPropByRes(),
+                updated.getPerformedTasks()));
 
         propagationManager.execute(tasks);
 
@@ -593,17 +598,17 @@ public class UserController {
         LOG.debug("About to process form {}", form);
 
         WorkflowResult<Map.Entry<Long, String>> updated =
-                wfAdapter.submitForm(form, SecurityContextHolder.getContext().
-                getAuthentication().getName());
+                wfAdapter.submitForm(form, SecurityContextHolder.getContext().getAuthentication().getName());
 
         List<PropagationTask> tasks = propagationManager.getUpdateTaskIds(
-                new WorkflowResult<Long>(updated.getResult().getKey(),
-                updated.getPropByRes(), updated.getPerformedTasks()),
-                updated.getResult().getValue(), null, null, Boolean.TRUE);
+                new WorkflowResult<Map.Entry<Long, Boolean>>(
+                new DefaultMapEntry(updated.getResult().getKey(), Boolean.TRUE),
+                updated.getPropByRes(),
+                updated.getPerformedTasks()),
+                updated.getResult().getValue(), null, null);
         propagationManager.execute(tasks);
 
-        final UserTO savedTO = userDataBinder.getUserTO(
-                updated.getResult().getKey());
+        final UserTO savedTO = userDataBinder.getUserTO(updated.getResult().getKey());
 
         LOG.debug("About to return user after form processing\n{}", savedTO);
 

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/scheduling/SyncJob.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/scheduling/SyncJob.java?rev=1298759&r1=1298758&r2=1298759&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/scheduling/SyncJob.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/scheduling/SyncJob.java Fri
Mar  9 09:07:50 2012
@@ -360,14 +360,14 @@ public class SyncJob extends AbstractTas
                     result.setUsername(userMod.getUsername());
 
                     if (!dryRun) {
-                        WorkflowResult<Long> updated = wfAdapter.update(userMod);
+                        WorkflowResult<Map.Entry<Long, Boolean>> updated = wfAdapter.update(userMod);
 
                         List<PropagationTask> tasks = propagationManager.getUpdateTaskIds(
-                                updated, userMod.getPassword(), null, null, null,
+                                updated, userMod.getPassword(), null, null,
                                 Collections.singleton(((SyncTask) this.task).getResource().getName()));
 
                         propagationManager.execute(tasks);
-                        userTO = userDataBinder.getUserTO(updated.getResult());
+                        userTO = userDataBinder.getUserTO(updated.getResult().getKey());
                     }
                 } catch (PropagationException e) {
                     LOG.error("Could not propagate user " + delta.getUid().getUidValue(),
e);

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/AbstractUserWorkflowAdapter.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/AbstractUserWorkflowAdapter.java?rev=1298759&r1=1298758&r2=1298759&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/AbstractUserWorkflowAdapter.java
(original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/AbstractUserWorkflowAdapter.java
Fri Mar  9 09:07:50 2012
@@ -18,6 +18,7 @@
  */
 package org.syncope.core.workflow;
 
+import java.util.Map;
 import java.util.Map.Entry;
 import javassist.NotFoundException;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -32,8 +33,7 @@ import org.syncope.core.rest.data.UserDa
 @Transactional(rollbackFor = {
     Throwable.class
 })
-public abstract class AbstractUserWorkflowAdapter
-        implements UserWorkflowAdapter {
+public abstract class AbstractUserWorkflowAdapter implements UserWorkflowAdapter {
 
     @Autowired
     protected UserDataBinder dataBinder;
@@ -59,11 +59,11 @@ public abstract class AbstractUserWorkfl
         return doActivate(dataBinder.getUserFromId(userId), token);
     }
 
-    protected abstract WorkflowResult<Long> doUpdate(SyncopeUser user, UserMod userMod)
+    protected abstract WorkflowResult<Map.Entry<Long, Boolean>> doUpdate(SyncopeUser
user, UserMod userMod)
             throws WorkflowException;
 
     @Override
-    public WorkflowResult<Long> update(final UserMod userMod)
+    public WorkflowResult<Map.Entry<Long, Boolean>> update(final UserMod userMod)
             throws UnauthorizedRoleException, NotFoundException, WorkflowException {
 
         return doUpdate(dataBinder.getUserFromId(userMod.getId()), userMod);

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/ActivitiUserWorkflowAdapter.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/ActivitiUserWorkflowAdapter.java?rev=1298759&r1=1298758&r2=1298759&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/ActivitiUserWorkflowAdapter.java
(original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/ActivitiUserWorkflowAdapter.java
Fri Mar  9 09:07:50 2012
@@ -224,11 +224,11 @@ public class ActivitiUserWorkflowAdapter
         updateStatus(user);
         user = userDAO.save(user);
 
-        Boolean propagate_enable =
+        Boolean propagateEnable =
                 (Boolean) runtimeService.getVariable(processInstance.getProcessInstanceId(),
PROPAGATE_ENABLE);
 
-        if (propagate_enable == null) {
-            propagate_enable = enabled;
+        if (propagateEnable == null) {
+            propagateEnable = enabled;
         }
 
         // save resources to be propagated and password for later -
@@ -247,7 +247,7 @@ public class ActivitiUserWorkflowAdapter
         }
 
         return new WorkflowResult<Map.Entry<Long, Boolean>>(
-                new DefaultMapEntry(user.getId(), propagate_enable), propByRes, getPerformedTasks(user));
+                new DefaultMapEntry(user.getId(), propagateEnable), propByRes, getPerformedTasks(user));
     }
 
     private Set<String> doExecuteTask(
@@ -299,7 +299,7 @@ public class ActivitiUserWorkflowAdapter
     }
 
     @Override
-    protected WorkflowResult<Long> doUpdate(
+    protected WorkflowResult<Map.Entry<Long, Boolean>> doUpdate(
             final SyncopeUser user, final UserMod userMod)
             throws WorkflowException {
 
@@ -317,7 +317,10 @@ public class ActivitiUserWorkflowAdapter
             runtimeService.setVariable(user.getWorkflowId(), ENCRYPTED_PWD, encrypt(userMod.getPassword()));
         }
 
-        return new WorkflowResult<Long>(updated.getId(), propByRes, task);
+        Boolean propagateEnable = (Boolean) runtimeService.getVariable(user.getWorkflowId(),
PROPAGATE_ENABLE);
+
+        return new WorkflowResult<Map.Entry<Long, Boolean>>(
+                new DefaultMapEntry(updated.getId(), propagateEnable), propByRes, task);
     }
 
     @Override

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/NoOpUserWorkflowAdapter.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/NoOpUserWorkflowAdapter.java?rev=1298759&r1=1298758&r2=1298759&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/NoOpUserWorkflowAdapter.java
(original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/NoOpUserWorkflowAdapter.java
Fri Mar  9 09:07:50 2012
@@ -92,8 +92,7 @@ public class NoOpUserWorkflowAdapter ext
         propByRes.set(PropagationOperation.CREATE, user.getResourceNames());
 
         return new WorkflowResult<Map.Entry<Long, Boolean>>(
-                new DefaultMapEntry(user.getId(), propagate_enable),
-                propByRes, "create");
+                new DefaultMapEntry(user.getId(), propagate_enable), propByRes, "create");
     }
 
     @Override
@@ -114,7 +113,7 @@ public class NoOpUserWorkflowAdapter ext
     }
 
     @Override
-    protected WorkflowResult<Long> doUpdate(
+    protected WorkflowResult<Map.Entry<Long, Boolean>> doUpdate(
             final SyncopeUser user, final UserMod userMod)
             throws WorkflowException {
 
@@ -122,8 +121,8 @@ public class NoOpUserWorkflowAdapter ext
 
         SyncopeUser updated = userDAO.save(user);
 
-        return new WorkflowResult<Long>(
-                updated.getId(), propByRes, "update");
+        return new WorkflowResult<Map.Entry<Long, Boolean>>(
+                new DefaultMapEntry(updated.getId(), true), propByRes, "update");
     }
 
     @Override

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/UserWorkflowAdapter.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/UserWorkflowAdapter.java?rev=1298759&r1=1298758&r2=1298759&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/UserWorkflowAdapter.java
(original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/workflow/UserWorkflowAdapter.java
Fri Mar  9 09:07:50 2012
@@ -23,9 +23,9 @@ import java.util.Map;
 import javassist.NotFoundException;
 import org.syncope.client.mod.UserMod;
 import org.syncope.client.to.UserTO;
-import org.syncope.core.persistence.beans.user.SyncopeUser;
 import org.syncope.client.to.WorkflowDefinitionTO;
 import org.syncope.client.to.WorkflowFormTO;
+import org.syncope.core.persistence.beans.user.SyncopeUser;
 import org.syncope.core.rest.controller.UnauthorizedRoleException;
 
 /**
@@ -85,8 +85,7 @@ public interface UserWorkflowAdapter {
      * @throws WorkflowException workflow exception
      */
     WorkflowResult<Long> execute(UserTO userTO, String taskId)
-            throws UnauthorizedRoleException, NotFoundException,
-            WorkflowException;
+            throws UnauthorizedRoleException, NotFoundException, WorkflowException;
 
     /**
      * Activate an user.
@@ -99,8 +98,7 @@ public interface UserWorkflowAdapter {
      * @throws WorkflowException workflow exception
      */
     WorkflowResult<Long> activate(Long userId, String token)
-            throws UnauthorizedRoleException, NotFoundException,
-            WorkflowException;
+            throws UnauthorizedRoleException, NotFoundException, WorkflowException;
 
     /**
      * Updated an user.
@@ -111,9 +109,8 @@ public interface UserWorkflowAdapter {
      * @throws NotFoundException user not found exception
      * @throws WorkflowException workflow exception
      */
-    WorkflowResult<Long> update(UserMod userMod)
-            throws UnauthorizedRoleException, NotFoundException,
-            WorkflowException;
+    WorkflowResult<Map.Entry<Long, Boolean>> update(UserMod userMod)
+            throws UnauthorizedRoleException, NotFoundException, WorkflowException;
 
     /**
      * Suspend an user.
@@ -125,8 +122,7 @@ public interface UserWorkflowAdapter {
      * @throws WorkflowException workflow exception
      */
     WorkflowResult<Long> suspend(Long userId)
-            throws UnauthorizedRoleException, NotFoundException,
-            WorkflowException;
+            throws UnauthorizedRoleException, NotFoundException, WorkflowException;
 
     /**
      * Suspend an user.
@@ -149,8 +145,7 @@ public interface UserWorkflowAdapter {
      * @throws WorkflowException workflow exception
      */
     WorkflowResult<Long> reactivate(Long userId)
-            throws UnauthorizedRoleException, NotFoundException,
-            WorkflowException;
+            throws UnauthorizedRoleException, NotFoundException, WorkflowException;
 
     /**
      * Delete an user.
@@ -161,8 +156,7 @@ public interface UserWorkflowAdapter {
      * @throws WorkflowException workflow exception
      */
     void delete(Long userId)
-            throws UnauthorizedRoleException, NotFoundException,
-            WorkflowException;
+            throws UnauthorizedRoleException, NotFoundException, WorkflowException;
 
     /**
      * Get workflow definition.
@@ -195,7 +189,7 @@ public interface UserWorkflowAdapter {
     /**
      * Get all defined forms for current workflow process instances.
      *
-     * @return list of defined forms 
+     * @return list of defined forms
      */
     List<WorkflowFormTO> getForms();
 
@@ -231,7 +225,6 @@ public interface UserWorkflowAdapter {
      * @throws NotFoundException not found exception
      * @throws WorkflowException workflow exception
      */
-    WorkflowResult<Map.Entry<Long, String>> submitForm(
-            WorkflowFormTO form, String username)
+    WorkflowResult<Map.Entry<Long, String>> submitForm(WorkflowFormTO form, String
username)
             throws NotFoundException, WorkflowException;
 }



Mime
View raw message