http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/RoleCreateProcessor.java ---------------------------------------------------------------------- diff --git a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/RoleCreateProcessor.java b/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/RoleCreateProcessor.java deleted file mode 100644 index d2219ba..0000000 --- a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/RoleCreateProcessor.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.server.provisioning.camel.processor; - -import java.util.AbstractMap; -import java.util.List; -import java.util.Set; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.syncope.common.lib.to.RoleTO; -import org.apache.syncope.server.misc.security.AuthContextUtil; -import org.apache.syncope.server.misc.spring.ApplicationContextProvider; -import org.apache.syncope.server.persistence.api.RoleEntitlementUtil; -import org.apache.syncope.server.persistence.api.entity.task.PropagationTask; -import org.apache.syncope.server.provisioning.api.WorkflowResult; -import org.apache.syncope.server.provisioning.api.propagation.PropagationException; -import org.apache.syncope.server.provisioning.api.propagation.PropagationManager; -import org.apache.syncope.server.provisioning.api.propagation.PropagationReporter; -import org.apache.syncope.server.provisioning.api.propagation.PropagationTaskExecutor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class RoleCreateProcessor implements Processor { - - private static final Logger LOG = LoggerFactory.getLogger(RoleCreateProcessor.class); - - @Autowired - protected PropagationManager propagationManager; - - @Autowired - protected PropagationTaskExecutor taskExecutor; - - @SuppressWarnings("unchecked") - @Override - public void process(final Exchange exchange) { - WorkflowResult<Long> created = (WorkflowResult) exchange.getIn().getBody(); - RoleTO subject = exchange.getProperty("subject", RoleTO.class); - Set<String> excludedResource = exchange.getProperty("excludedResources", Set.class); - - AuthContextUtil.extendAuthContext( - created.getResult(), RoleEntitlementUtil.getEntitlementNameFromRoleKey(created.getResult())); - - List<PropagationTask> tasks = - propagationManager.getRoleCreateTaskIds(created, subject.getVirAttrs(), excludedResource); - PropagationReporter propagationReporter = - ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class); - try { - taskExecutor.execute(tasks, propagationReporter); - } catch (PropagationException e) { - LOG.error("Error propagation primary resource", e); - propagationReporter.onPrimaryResourceFailure(tasks); - } - - exchange.getOut().setBody(new AbstractMap.SimpleEntry<>( - created.getResult(), propagationReporter.getStatuses())); - } - -}
http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/RoleDeleteProcessor.java ---------------------------------------------------------------------- diff --git a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/RoleDeleteProcessor.java b/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/RoleDeleteProcessor.java deleted file mode 100644 index 7c6e816..0000000 --- a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/RoleDeleteProcessor.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.server.provisioning.camel.processor; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.syncope.common.lib.types.PropagationByResource; -import org.apache.syncope.server.misc.spring.ApplicationContextProvider; -import org.apache.syncope.server.persistence.api.dao.RoleDAO; -import org.apache.syncope.server.persistence.api.entity.role.Role; -import org.apache.syncope.server.persistence.api.entity.task.PropagationTask; -import org.apache.syncope.server.provisioning.api.WorkflowResult; -import org.apache.syncope.server.provisioning.api.propagation.PropagationException; -import org.apache.syncope.server.provisioning.api.propagation.PropagationManager; -import org.apache.syncope.server.provisioning.api.propagation.PropagationReporter; -import org.apache.syncope.server.provisioning.api.propagation.PropagationTaskExecutor; -import org.apache.syncope.server.workflow.api.RoleWorkflowAdapter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class RoleDeleteProcessor implements Processor { - - private static final Logger LOG = LoggerFactory.getLogger(RoleDeleteProcessor.class); - - @Autowired - protected RoleWorkflowAdapter rwfAdapter; - - @Autowired - protected PropagationManager propagationManager; - - @Autowired - protected PropagationTaskExecutor taskExecutor; - - @Autowired - protected RoleDAO roleDAO; - - @Override - public void process(final Exchange exchange) throws Exception { - final List<Role> toBeDeprovisioned = new ArrayList<>(); - - Long subjectKey = exchange.getIn().getBody(Long.class); - final Role syncopeRole = roleDAO.find(subjectKey); - - if (syncopeRole != null) { - toBeDeprovisioned.add(syncopeRole); - - final List<Role> descendants = roleDAO.findDescendants(toBeDeprovisioned.get(0)); - if (descendants != null) { - toBeDeprovisioned.addAll(descendants); - } - } - - final List<PropagationTask> tasks = new ArrayList<>(); - - for (Role role : toBeDeprovisioned) { - // Generate propagation tasks for deleting users from role resources, if they are on those resources only - // because of the reason being deleted (see SYNCOPE-357) - for (Map.Entry<Long, PropagationByResource> entry : roleDAO.findUsersWithIndirectResources(role. - getKey()).entrySet()) { - - WorkflowResult<Long> wfResult = - new WorkflowResult<>(entry.getKey(), entry.getValue(), Collections.<String>emptySet()); - tasks.addAll(propagationManager.getUserDeleteTaskIds(wfResult)); - } - - // Generate propagation tasks for deleting this role from resources - tasks.addAll(propagationManager.getRoleDeleteTaskIds(role.getKey())); - } - - PropagationReporter propagationReporter = - ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class); - try { - taskExecutor.execute(tasks, propagationReporter); - } catch (PropagationException e) { - LOG.error("Error propagation primary resource", e); - propagationReporter.onPrimaryResourceFailure(tasks); - } - - exchange.setProperty("statuses", propagationReporter.getStatuses()); - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/RoleDeprovisionProcessor.java ---------------------------------------------------------------------- diff --git a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/RoleDeprovisionProcessor.java b/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/RoleDeprovisionProcessor.java deleted file mode 100644 index 4753cd8..0000000 --- a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/RoleDeprovisionProcessor.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.server.provisioning.camel.processor; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.syncope.server.misc.spring.ApplicationContextProvider; -import org.apache.syncope.server.persistence.api.dao.RoleDAO; -import org.apache.syncope.server.persistence.api.entity.role.Role; -import org.apache.syncope.server.persistence.api.entity.task.PropagationTask; -import org.apache.syncope.server.provisioning.api.propagation.PropagationException; -import org.apache.syncope.server.provisioning.api.propagation.PropagationManager; -import org.apache.syncope.server.provisioning.api.propagation.PropagationReporter; -import org.apache.syncope.server.provisioning.api.propagation.PropagationTaskExecutor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class RoleDeprovisionProcessor implements Processor { - - private static final Logger LOG = LoggerFactory.getLogger(UserDeprovisionProcessor.class); - - @Autowired - protected PropagationManager propagationManager; - - @Autowired - protected PropagationTaskExecutor taskExecutor; - - @Autowired - protected RoleDAO roleDAO; - - @SuppressWarnings("unchecked") - @Override - public void process(final Exchange exchange) { - Long roleKey = exchange.getIn().getBody(Long.class); - List<String> resources = exchange.getProperty("resources", List.class); - - Role role = roleDAO.authFetch(roleKey); - - Set<String> noPropResourceName = role.getResourceNames(); - noPropResourceName.removeAll(resources); - - List<PropagationTask> tasks = - propagationManager.getRoleDeleteTaskIds(roleKey, new HashSet<>(resources), noPropResourceName); - PropagationReporter propagationReporter = - ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class); - try { - taskExecutor.execute(tasks, propagationReporter); - } catch (PropagationException e) { - LOG.error("Error propagation primary resource", e); - propagationReporter.onPrimaryResourceFailure(tasks); - } - - exchange.getOut().setBody(propagationReporter.getStatuses()); - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/RoleUpdateProcessor.java ---------------------------------------------------------------------- diff --git a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/RoleUpdateProcessor.java b/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/RoleUpdateProcessor.java deleted file mode 100644 index e91be21..0000000 --- a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/RoleUpdateProcessor.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.server.provisioning.camel.processor; - -import java.util.AbstractMap; -import java.util.List; -import java.util.Set; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.syncope.common.lib.mod.RoleMod; -import org.apache.syncope.server.misc.spring.ApplicationContextProvider; -import org.apache.syncope.server.persistence.api.entity.task.PropagationTask; -import org.apache.syncope.server.provisioning.api.WorkflowResult; -import org.apache.syncope.server.provisioning.api.propagation.PropagationException; -import org.apache.syncope.server.provisioning.api.propagation.PropagationManager; -import org.apache.syncope.server.provisioning.api.propagation.PropagationReporter; -import org.apache.syncope.server.provisioning.api.propagation.PropagationTaskExecutor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class RoleUpdateProcessor implements Processor { - - private static final Logger LOG = LoggerFactory.getLogger(UserUpdateProcessor.class); - - @Autowired - protected PropagationManager propagationManager; - - @Autowired - protected PropagationTaskExecutor taskExecutor; - - @SuppressWarnings("unchecked") - @Override - public void process(final Exchange exchange) { - WorkflowResult<Long> updated = (WorkflowResult) exchange.getIn().getBody(); - RoleMod subjectMod = exchange.getProperty("subjectMod", RoleMod.class); - Set<String> excludedResource = exchange.getProperty("excludedResources", Set.class); - - List<PropagationTask> tasks = propagationManager.getRoleUpdateTaskIds(updated, - subjectMod.getVirAttrsToRemove(), subjectMod.getVirAttrsToUpdate(), excludedResource); - PropagationReporter propagationReporter = - ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class); - try { - taskExecutor.execute(tasks, propagationReporter); - } catch (PropagationException e) { - LOG.error("Error propagation primary resource", e); - propagationReporter.onPrimaryResourceFailure(tasks); - } - - exchange.getOut().setBody(new AbstractMap.SimpleEntry<>(updated.getResult(), propagationReporter.getStatuses())); - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserConfirmPwdResetProcessor.java ---------------------------------------------------------------------- diff --git a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserConfirmPwdResetProcessor.java b/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserConfirmPwdResetProcessor.java deleted file mode 100644 index 3fb5ced..0000000 --- a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserConfirmPwdResetProcessor.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.server.provisioning.camel.processor; - -import java.util.List; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.syncope.server.misc.spring.ApplicationContextProvider; -import org.apache.syncope.server.persistence.api.entity.task.PropagationTask; -import org.apache.syncope.server.persistence.api.entity.user.User; -import org.apache.syncope.server.provisioning.api.propagation.PropagationException; -import org.apache.syncope.server.provisioning.api.propagation.PropagationManager; -import org.apache.syncope.server.provisioning.api.propagation.PropagationReporter; -import org.apache.syncope.server.provisioning.api.propagation.PropagationTaskExecutor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class UserConfirmPwdResetProcessor implements Processor { - - private static final Logger LOG = LoggerFactory.getLogger(UserConfirmPwdResetProcessor.class); - - @Autowired - protected PropagationManager propagationManager; - - @Autowired - protected PropagationTaskExecutor taskExecutor; - - @Override - public void process(final Exchange exchange) { - User user = exchange.getProperty("user", User.class); - - List<PropagationTask> tasks = propagationManager.getUserUpdateTaskIds(user, null, null); - PropagationReporter propReporter = - ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class); - try { - taskExecutor.execute(tasks, propReporter); - } catch (PropagationException e) { - LOG.error("Error propagation primary resource", e); - propReporter.onPrimaryResourceFailure(tasks); - } - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserCreateProcessor.java ---------------------------------------------------------------------- diff --git a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserCreateProcessor.java b/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserCreateProcessor.java deleted file mode 100644 index bcca679..0000000 --- a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserCreateProcessor.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.server.provisioning.camel.processor; - -import java.util.AbstractMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.syncope.common.lib.to.UserTO; -import org.apache.syncope.server.misc.spring.ApplicationContextProvider; -import org.apache.syncope.server.persistence.api.entity.task.PropagationTask; -import org.apache.syncope.server.provisioning.api.WorkflowResult; -import org.apache.syncope.server.provisioning.api.propagation.PropagationException; -import org.apache.syncope.server.provisioning.api.propagation.PropagationManager; -import org.apache.syncope.server.provisioning.api.propagation.PropagationReporter; -import org.apache.syncope.server.provisioning.api.propagation.PropagationTaskExecutor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class UserCreateProcessor implements Processor { - - private static final Logger LOG = LoggerFactory.getLogger(UserCreateProcessor.class); - - @Autowired - protected PropagationManager propagationManager; - - @Autowired - protected PropagationTaskExecutor taskExecutor; - - @SuppressWarnings("unchecked") - @Override - public void process(final Exchange exchange) { - if ((exchange.getIn().getBody() instanceof WorkflowResult)) { - - WorkflowResult<Map.Entry<Long, Boolean>> created = (WorkflowResult) exchange.getIn().getBody(); - UserTO actual = exchange.getProperty("actual", UserTO.class); - Set<String> excludedResource = exchange.getProperty("excludedResources", Set.class); - - List<PropagationTask> tasks = propagationManager.getUserCreateTaskIds( - created, actual.getPassword(), actual.getVirAttrs(), excludedResource, actual.getMemberships()); - PropagationReporter propagationReporter = - ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class); - try { - taskExecutor.execute(tasks, propagationReporter); - } catch (PropagationException e) { - LOG.error("Error propagation primary resource {}", e); - propagationReporter.onPrimaryResourceFailure(tasks); - } - - exchange.getOut().setBody( - new AbstractMap.SimpleEntry<>(created.getResult().getKey(), propagationReporter.getStatuses())); - } - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserDeleteProcessor.java ---------------------------------------------------------------------- diff --git a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserDeleteProcessor.java b/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserDeleteProcessor.java deleted file mode 100644 index b9795ad..0000000 --- a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserDeleteProcessor.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.server.provisioning.camel.processor; - -import java.util.List; -import java.util.Set; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.syncope.server.misc.spring.ApplicationContextProvider; -import org.apache.syncope.server.persistence.api.entity.task.PropagationTask; -import org.apache.syncope.server.provisioning.api.propagation.PropagationException; -import org.apache.syncope.server.provisioning.api.propagation.PropagationManager; -import org.apache.syncope.server.provisioning.api.propagation.PropagationReporter; -import org.apache.syncope.server.provisioning.api.propagation.PropagationTaskExecutor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class UserDeleteProcessor implements Processor { - - private static final Logger LOG = LoggerFactory.getLogger(UserDeleteProcessor.class); - - @Autowired - protected PropagationManager propagationManager; - - @Autowired - protected PropagationTaskExecutor taskExecutor; - - @SuppressWarnings("unchecked") - @Override - public void process(final Exchange exchange) throws Exception { - Long userKey = (Long) exchange.getIn().getBody(); - Set<String> excludedResource = exchange.getProperty("excludedResources", Set.class); - - // Note here that we can only notify about "delete", not any other - // task defined in workflow process definition: this because this - // information could only be available after uwfAdapter.delete(), which - // will also effectively remove user from db, thus making virtually - // impossible by NotificationManager to fetch required user information - List<PropagationTask> tasks = propagationManager.getUserDeleteTaskIds(userKey, excludedResource); - - PropagationReporter propagationReporter = - ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class); - try { - taskExecutor.execute(tasks, propagationReporter); - } catch (PropagationException e) { - LOG.error("Error propagation primary resource", e); - propagationReporter.onPrimaryResourceFailure(tasks); - } - - exchange.setProperty("statuses", propagationReporter.getStatuses()); - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserDeprovisionProcessor.java ---------------------------------------------------------------------- diff --git a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserDeprovisionProcessor.java b/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserDeprovisionProcessor.java deleted file mode 100644 index 042c287..0000000 --- a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserDeprovisionProcessor.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.server.provisioning.camel.processor; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.syncope.server.misc.spring.ApplicationContextProvider; -import org.apache.syncope.server.persistence.api.dao.UserDAO; -import org.apache.syncope.server.persistence.api.entity.task.PropagationTask; -import org.apache.syncope.server.persistence.api.entity.user.User; -import org.apache.syncope.server.provisioning.api.propagation.PropagationException; -import org.apache.syncope.server.provisioning.api.propagation.PropagationManager; -import org.apache.syncope.server.provisioning.api.propagation.PropagationReporter; -import org.apache.syncope.server.provisioning.api.propagation.PropagationTaskExecutor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class UserDeprovisionProcessor implements Processor { - - private static final Logger LOG = LoggerFactory.getLogger(UserDeprovisionProcessor.class); - - @Autowired - protected PropagationManager propagationManager; - - @Autowired - protected PropagationTaskExecutor taskExecutor; - - @Autowired - protected UserDAO userDAO; - - @Override - public void process(final Exchange exchange) { - Long userKey = exchange.getIn().getBody(Long.class); - @SuppressWarnings("unchecked") - List<String> resources = exchange.getProperty("resources", List.class); - - final User user = userDAO.authFetch(userKey); - - final Set<String> noPropResourceName = user.getResourceNames(); - noPropResourceName.removeAll(resources); - - final List<PropagationTask> tasks = - propagationManager.getUserDeleteTaskIds(userKey, new HashSet<>(resources), noPropResourceName); - final PropagationReporter propagationReporter = - ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class); - try { - taskExecutor.execute(tasks, propagationReporter); - } catch (PropagationException e) { - LOG.error("Error propagation primary resource", e); - propagationReporter.onPrimaryResourceFailure(tasks); - } - - exchange.getOut().setBody(propagationReporter.getStatuses()); - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserInnerSuspendProcessor.java ---------------------------------------------------------------------- diff --git a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserInnerSuspendProcessor.java b/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserInnerSuspendProcessor.java deleted file mode 100644 index 69760f8..0000000 --- a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserInnerSuspendProcessor.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.server.provisioning.camel.processor; - -import java.util.AbstractMap.SimpleEntry; -import java.util.List; -import java.util.Map; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.syncope.common.lib.mod.UserMod; -import org.apache.syncope.server.persistence.api.entity.task.PropagationTask; -import org.apache.syncope.server.provisioning.api.WorkflowResult; -import org.apache.syncope.server.provisioning.api.propagation.PropagationManager; -import org.apache.syncope.server.provisioning.api.propagation.PropagationTaskExecutor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class UserInnerSuspendProcessor implements Processor { - - @Autowired - protected PropagationManager propagationManager; - - @Autowired - protected PropagationTaskExecutor taskExecutor; - - @SuppressWarnings("unchecked") - @Override - public void process(final Exchange exchange) { - WorkflowResult<Long> updated = (WorkflowResult) exchange.getIn().getBody(); - Boolean propagate = exchange.getProperty("propagate", Boolean.class); - - if (propagate) { - UserMod userMod = new UserMod(); - userMod.setKey(updated.getResult()); - - final List<PropagationTask> tasks = propagationManager.getUserUpdateTaskIds( - new WorkflowResult<Map.Entry<UserMod, Boolean>>( - new SimpleEntry<>(userMod, Boolean.FALSE), - updated.getPropByRes(), updated.getPerformedTasks())); - taskExecutor.execute(tasks); - } - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserSetStatusInSyncProcessor.java ---------------------------------------------------------------------- diff --git a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserSetStatusInSyncProcessor.java b/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserSetStatusInSyncProcessor.java deleted file mode 100644 index 11d0ff6..0000000 --- a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserSetStatusInSyncProcessor.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.server.provisioning.camel.processor; - -import java.util.Map; -import org.apache.camel.Processor; -import org.apache.camel.Exchange; -import org.apache.syncope.common.lib.mod.UserMod; -import org.apache.syncope.server.persistence.api.dao.UserDAO; -import org.apache.syncope.server.persistence.api.entity.user.User; -import org.apache.syncope.server.provisioning.api.WorkflowResult; -import org.apache.syncope.server.workflow.api.UserWorkflowAdapter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class UserSetStatusInSyncProcessor implements Processor { - - private static final Logger LOG = LoggerFactory.getLogger(UserSetStatusInSyncProcessor.class); - - @Autowired - protected UserDAO userDAO; - - @Autowired - protected UserWorkflowAdapter uwfAdapter; - - @SuppressWarnings("unchecked") - @Override - public void process(final Exchange exchange) { - WorkflowResult<Map.Entry<UserMod, Boolean>> updated = (WorkflowResult) exchange.getIn().getBody(); - - Boolean enabled = exchange.getProperty("enabled", Boolean.class); - Long key = exchange.getProperty("key", Long.class); - - if (enabled != null) { - User user = userDAO.find(key); - - WorkflowResult<Long> enableUpdate = null; - if (user.isSuspended() == null) { - enableUpdate = uwfAdapter.activate(key, null); - } else if (enabled && user.isSuspended()) { - enableUpdate = uwfAdapter.reactivate(key); - } else if (!enabled && !user.isSuspended()) { - enableUpdate = uwfAdapter.suspend(key); - } - - if (enableUpdate != null) { - if (enableUpdate.getPropByRes() != null) { - updated.getPropByRes().merge(enableUpdate.getPropByRes()); - updated.getPropByRes().purge(); - } - updated.getPerformedTasks().addAll(enableUpdate.getPerformedTasks()); - } - } - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserStatusPropagationProcessor.java ---------------------------------------------------------------------- diff --git a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserStatusPropagationProcessor.java b/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserStatusPropagationProcessor.java deleted file mode 100644 index eb1452f..0000000 --- a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserStatusPropagationProcessor.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.server.provisioning.camel.processor; - -import java.util.AbstractMap; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.syncope.common.lib.mod.StatusMod; -import org.apache.syncope.server.misc.spring.ApplicationContextProvider; -import org.apache.syncope.server.persistence.api.entity.task.PropagationTask; -import org.apache.syncope.server.persistence.api.entity.user.User; -import org.apache.syncope.server.provisioning.api.WorkflowResult; -import org.apache.syncope.server.provisioning.api.propagation.PropagationException; -import org.apache.syncope.server.provisioning.api.propagation.PropagationManager; -import org.apache.syncope.server.provisioning.api.propagation.PropagationReporter; -import org.apache.syncope.server.provisioning.api.propagation.PropagationTaskExecutor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class UserStatusPropagationProcessor implements Processor { - - private static final Logger LOG = LoggerFactory.getLogger(UserStatusPropagationProcessor.class); - - @Autowired - protected PropagationManager propagationManager; - - @Autowired - protected PropagationTaskExecutor taskExecutor; - - @SuppressWarnings("unchecked") - @Override - public void process(final Exchange exchange) { - WorkflowResult<Long> updated = (WorkflowResult) exchange.getIn().getBody(); - - User user = exchange.getProperty("user", User.class); - StatusMod statusMod = exchange.getProperty("statusMod", StatusMod.class); - - Set<String> resourcesToBeExcluded = new HashSet<>(user.getResourceNames()); - resourcesToBeExcluded.removeAll(statusMod.getResourceNames()); - - List<PropagationTask> tasks = propagationManager.getUserUpdateTaskIds( - user, statusMod.getType() != StatusMod.ModType.SUSPEND, resourcesToBeExcluded); - PropagationReporter propReporter = - ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class); - try { - taskExecutor.execute(tasks, propReporter); - } catch (PropagationException e) { - LOG.error("Error propagation primary resource", e); - propReporter.onPrimaryResourceFailure(tasks); - } - - exchange.getOut().setBody(new AbstractMap.SimpleEntry<>(updated.getResult(), propReporter.getStatuses())); - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserUpdateInSyncProcessor.java ---------------------------------------------------------------------- diff --git a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserUpdateInSyncProcessor.java b/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserUpdateInSyncProcessor.java deleted file mode 100644 index 23092e7..0000000 --- a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserUpdateInSyncProcessor.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.server.provisioning.camel.processor; - -import java.util.AbstractMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.syncope.common.lib.mod.UserMod; -import org.apache.syncope.server.misc.spring.ApplicationContextProvider; -import org.apache.syncope.server.persistence.api.entity.task.PropagationTask; -import org.apache.syncope.server.provisioning.api.WorkflowResult; -import org.apache.syncope.server.provisioning.api.propagation.PropagationException; -import org.apache.syncope.server.provisioning.api.propagation.PropagationManager; -import org.apache.syncope.server.provisioning.api.propagation.PropagationReporter; -import org.apache.syncope.server.provisioning.api.propagation.PropagationTaskExecutor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class UserUpdateInSyncProcessor implements Processor { - - private static final Logger LOG = LoggerFactory.getLogger(UserUpdateInSyncProcessor.class); - - @Autowired - protected PropagationManager propagationManager; - - @Autowired - protected PropagationTaskExecutor taskExecutor; - - @SuppressWarnings("unchecked") - @Override - public void process(final Exchange exchange) { - WorkflowResult<Map.Entry<UserMod, Boolean>> updated = (WorkflowResult) exchange.getIn().getBody(); - Set<String> excludedResource = exchange.getProperty("excludedResources", Set.class); - - PropagationReporter propagationReporter = - ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class); - - List<PropagationTask> tasks = propagationManager.getUserUpdateTaskIds(updated, updated.getResult().getKey(). - getPassword() != null, excludedResource); - - try { - taskExecutor.execute(tasks, propagationReporter); - } catch (PropagationException e) { - LOG.error("Error propagation primary resource", e); - propagationReporter.onPrimaryResourceFailure(tasks); - } - - exchange.getOut().setBody(new AbstractMap.SimpleEntry<>( - updated.getResult().getKey().getKey(), propagationReporter.getStatuses())); - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserUpdateProcessor.java ---------------------------------------------------------------------- diff --git a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserUpdateProcessor.java b/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserUpdateProcessor.java deleted file mode 100644 index e921847..0000000 --- a/syncope620/ext/camel/provisioning-camel/src/main/java/org/apache/syncope/server/provisioning/camel/processor/UserUpdateProcessor.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.server.provisioning.camel.processor; - -import java.util.AbstractMap; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import org.apache.camel.Exchange; -import org.apache.camel.Processor; -import org.apache.syncope.common.lib.mod.MembershipMod; -import org.apache.syncope.common.lib.mod.UserMod; -import org.apache.syncope.common.lib.types.PropagationByResource; -import org.apache.syncope.server.misc.spring.ApplicationContextProvider; -import org.apache.syncope.server.persistence.api.entity.task.PropagationTask; -import org.apache.syncope.server.provisioning.api.WorkflowResult; -import org.apache.syncope.server.provisioning.api.propagation.PropagationException; -import org.apache.syncope.server.provisioning.api.propagation.PropagationManager; -import org.apache.syncope.server.provisioning.api.propagation.PropagationReporter; -import org.apache.syncope.server.provisioning.api.propagation.PropagationTaskExecutor; -import org.apache.syncope.server.provisioning.java.VirAttrHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class UserUpdateProcessor implements Processor { - - private static final Logger LOG = LoggerFactory.getLogger(UserUpdateProcessor.class); - - @Autowired - protected PropagationManager propagationManager; - - @Autowired - protected PropagationTaskExecutor taskExecutor; - - @Autowired - protected VirAttrHandler virtAttrHandler; - - @Override - @SuppressWarnings("unchecked") - public void process(final Exchange exchange) { - WorkflowResult<Map.Entry<UserMod, Boolean>> updated = (WorkflowResult) exchange.getIn().getBody(); - UserMod actual = exchange.getProperty("actual", UserMod.class); - boolean removeMemberships = exchange.getProperty("removeMemberships", boolean.class); - - List<PropagationTask> tasks = propagationManager.getUserUpdateTaskIds(updated); - if (tasks.isEmpty()) { - // SYNCOPE-459: take care of user virtual attributes ... - final PropagationByResource propByResVirAttr = virtAttrHandler.fillVirtual( - updated.getResult().getKey().getKey(), - actual.getVirAttrsToRemove(), - actual.getVirAttrsToUpdate()); - // SYNCOPE-501: update only virtual attributes (if any of them changed), password propagation is - // not required, take care also of membership virtual attributes - boolean addOrUpdateMemberships = false; - for (MembershipMod membershipMod : actual.getMembershipsToAdd()) { - if (!virtAttrHandler.fillMembershipVirtual( - updated.getResult().getKey().getKey(), - membershipMod.getRole(), - null, - membershipMod.getVirAttrsToRemove(), - membershipMod.getVirAttrsToUpdate(), - false).isEmpty()) { - - addOrUpdateMemberships = true; - } - } - tasks.addAll(!propByResVirAttr.isEmpty() || addOrUpdateMemberships || removeMemberships - ? propagationManager.getUserUpdateTaskIds(updated, false, null) - : Collections.<PropagationTask>emptyList()); - } - - PropagationReporter propagationReporter = - ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class); - if (!tasks.isEmpty()) { - try { - taskExecutor.execute(tasks, propagationReporter); - } catch (PropagationException e) { - LOG.error("Error propagation primary resource", e); - propagationReporter.onPrimaryResourceFailure(tasks); - } - } - - exchange.getOut().setBody(new AbstractMap.SimpleEntry<>( - updated.getResult().getKey().getKey(), propagationReporter.getStatuses())); - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/ext/camel/provisioning-camel/src/main/resources/provisioning.properties ---------------------------------------------------------------------- diff --git a/syncope620/ext/camel/provisioning-camel/src/main/resources/provisioning.properties b/syncope620/ext/camel/provisioning-camel/src/main/resources/provisioning.properties index b0c8917..16a895b 100644 --- a/syncope620/ext/camel/provisioning-camel/src/main/resources/provisioning.properties +++ b/syncope620/ext/camel/provisioning-camel/src/main/resources/provisioning.properties @@ -15,5 +15,5 @@ # specific language governing permissions and limitations # under the License. camel.directory=${conf.directory} -userProvisioningManager=org.apache.syncope.server.provisioning.camel.CamelUserProvisioningManager -roleProvisioningManager=org.apache.syncope.server.provisioning.camel.CamelRoleProvisioningManager +userProvisioningManager=org.apache.syncope.core.provisioning.camel.CamelUserProvisioningManager +roleProvisioningManager=org.apache.syncope.core.provisioning.camel.CamelRoleProvisioningManager http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/ext/camel/provisioning-camel/src/main/resources/provisioningCamelContext.xml ---------------------------------------------------------------------- diff --git a/syncope620/ext/camel/provisioning-camel/src/main/resources/provisioningCamelContext.xml b/syncope620/ext/camel/provisioning-camel/src/main/resources/provisioningCamelContext.xml index 8363127..59c2543 100644 --- a/syncope620/ext/camel/provisioning-camel/src/main/resources/provisioningCamelContext.xml +++ b/syncope620/ext/camel/provisioning-camel/src/main/resources/provisioningCamelContext.xml @@ -25,15 +25,15 @@ under the License. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> - <bean id="userRoutes" class="org.apache.syncope.server.misc.spring.ResourceWithFallbackLoader"> + <bean id="userRoutes" class="org.apache.syncope.core.misc.spring.ResourceWithFallbackLoader"> <property name="primary" value="file:${camel.directory}/userWorkflow.bpmn20.xml"/> <property name="fallback" value="classpath:userRoutes.xml"/> </bean> - <bean id="roleRoutes" class="org.apache.syncope.server.misc.spring.ResourceWithFallbackLoader"> + <bean id="roleRoutes" class="org.apache.syncope.core.misc.spring.ResourceWithFallbackLoader"> <property name="primary" value="file:${camel.directory}/userWorkflow.bpmn20.xml"/> <property name="fallback" value="classpath:roleRoutes.xml"/> </bean> - <context:component-scan base-package="org.apache.syncope.server.provisioning.camel"/> + <context:component-scan base-package="org.apache.syncope.core.provisioning.camel"/> </beans> http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/ext/camel/rest-cxf/pom.xml ---------------------------------------------------------------------- diff --git a/syncope620/ext/camel/rest-cxf/pom.xml b/syncope620/ext/camel/rest-cxf/pom.xml index acae2fe..ad12443 100644 --- a/syncope620/ext/camel/rest-cxf/pom.xml +++ b/syncope620/ext/camel/rest-cxf/pom.xml @@ -39,8 +39,8 @@ under the License. <dependencies> <dependency> - <groupId>org.apache.syncope.server</groupId> - <artifactId>syncope-server-rest-cxf</artifactId> + <groupId>org.apache.syncope.core</groupId> + <artifactId>syncope-core-rest-cxf</artifactId> <version>${project.version}</version> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/ext/camel/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/CamelRouteServiceImpl.java ---------------------------------------------------------------------- diff --git a/syncope620/ext/camel/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/CamelRouteServiceImpl.java b/syncope620/ext/camel/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/CamelRouteServiceImpl.java new file mode 100644 index 0000000..a128e06 --- /dev/null +++ b/syncope620/ext/camel/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/CamelRouteServiceImpl.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.syncope.core.rest.cxf.service; + +import java.util.List; +import org.apache.syncope.common.lib.to.CamelRouteTO; +import org.apache.syncope.common.lib.types.SubjectType; +import org.apache.syncope.common.rest.api.service.CamelRouteService; +import org.apache.syncope.core.logic.CamelRouteLogic; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class CamelRouteServiceImpl extends AbstractServiceImpl implements CamelRouteService { + + @Autowired + private CamelRouteLogic logic; + + @Override + public List<CamelRouteTO> list(final SubjectType subjectType) { + return logic.list(subjectType); + } + + @Override + public CamelRouteTO read(final String key) { + return logic.read(key); + } + + @Override + public void update(final String key, final CamelRouteTO route) { + route.setKey(key); + logic.update(route); + } + + @Override + public void restartContext() { + logic.restartContext(); + } + +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/ext/camel/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/CamelRouteServiceImpl.java ---------------------------------------------------------------------- diff --git a/syncope620/ext/camel/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/CamelRouteServiceImpl.java b/syncope620/ext/camel/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/CamelRouteServiceImpl.java deleted file mode 100644 index bc3e89c..0000000 --- a/syncope620/ext/camel/rest-cxf/src/main/java/org/apache/syncope/server/rest/cxf/service/CamelRouteServiceImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.server.rest.cxf.service; - -import java.util.List; -import org.apache.syncope.common.lib.to.CamelRouteTO; -import org.apache.syncope.common.lib.types.SubjectType; -import org.apache.syncope.common.rest.api.service.CamelRouteService; -import org.apache.syncope.server.logic.CamelRouteLogic; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class CamelRouteServiceImpl extends AbstractServiceImpl implements CamelRouteService { - - @Autowired - private CamelRouteLogic logic; - - @Override - public List<CamelRouteTO> list(final SubjectType subjectType) { - return logic.list(subjectType); - } - - @Override - public CamelRouteTO read(final String key) { - return logic.read(key); - } - - @Override - public void update(final String key, final CamelRouteTO route) { - route.setKey(key); - logic.update(route); - } - - @Override - public void restartContext() { - logic.restartContext(); - } - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/fit/console-reference/pom.xml ---------------------------------------------------------------------- diff --git a/syncope620/fit/console-reference/pom.xml b/syncope620/fit/console-reference/pom.xml index dfd1240..f5ce312 100644 --- a/syncope620/fit/console-reference/pom.xml +++ b/syncope620/fit/console-reference/pom.xml @@ -266,7 +266,7 @@ under the License. </properties> </deployable> <deployable> - <location>${basedir}/../server-reference/target/syncope-fit-server-reference-${project.version}</location> + <location>${basedir}/../core-reference/target/syncope-fit-core-reference-${project.version}</location> <pingURL>http://localhost:${cargo.servlet.port}/syncope/cacheStats.jsp</pingURL> <pingTimeout>60000</pingTimeout> <properties> @@ -328,7 +328,7 @@ under the License. <configuration> <configuration> <properties> - <cargo.jvmargs>-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n + <cargo.jvmargs>-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,core=y,suspend=n -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=512m</cargo.jvmargs> </properties> </configuration> @@ -505,7 +505,7 @@ under the License. <configuration> <configuration> <properties> - <cargo.jvmargs>-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n + <cargo.jvmargs>-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,core=y,suspend=n -noverify ${javaagent} -Drebel.spring_plugin=true -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=256m</cargo.jvmargs> </properties>
