[CONF] Apache Syncope > Setup a Syncope cluster
Francesco Chicchiricco edited the page: Setup a Syncope cluster ... Note: Run Syncope in real environments is a prerequisite for this page. OpenJPA Remote Event Notification When deploying multiple Syncope instances insisting on a single database or database cluster, it is of fundamental importance that the contained OpenJPA instances are correctly configured for remote event notification. Such configuration, in fact, allows OpenJPA's data cache to remain synchronized when deployed in multiple JVMs, thus enforcing data consistency across all Syncope instances. The default configuration, in core/src/main/resources/persistenceContextEMFactory.xml is Code Block language xml which is suited for single JVM installations; with multiple instances, more options like as TCP or JMS are available; see OpenJPA's documentation for reference. Info OpenJPA documentation refers to direct configuration under META-INF/persistence.xml; for example: Code Block
[3/3] syncope git commit: [SYNCOPE-661] No more overloaded list / search REST methods + helpers provided for Java client invocation
[SYNCOPE-661] No more overloaded list / search REST methods + helpers provided for Java client invocation Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/bc2afa9a Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/bc2afa9a Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/bc2afa9a Branch: refs/heads/master Commit: bc2afa9a4cc2b9d0935c39d894f791f71bb1ec31 Parents: 39f8a06 Author: Francesco Chicchiriccò Authored: Thu Apr 23 10:02:45 2015 +0200 Committer: Francesco Chicchiriccò Committed: Thu Apr 23 17:06:17 2015 +0200 -- .../client/cli/commands/ReportCommand.java | 3 +- .../console/rest/AbstractSubjectRestClient.java | 7 +- .../client/console/rest/GroupRestClient.java| 22 +- .../client/console/rest/ReportRestClient.java | 13 +- .../client/console/rest/TaskRestClient.java | 9 +- .../client/console/rest/UserRestClient.java | 20 +- .../syncope/client/lib/SyncopeClient.java | 84 +++- .../client/lib/builders/ListQueryBuilder.java | 48 ++ .../lib/builders/SubjectListQueryBuilder.java | 61 +++ .../lib/builders/SubjectSearchQueryBuilder.java | 64 +++ .../syncope/common/lib/to/PagedResult.java | 2 +- .../syncope/common/rest/api/Preference.java | 2 +- .../common/rest/api/beans/ListQuery.java| 86 .../common/rest/api/beans/SubjectListQuery.java | 41 ++ .../rest/api/beans/SubjectSearchQuery.java | 39 ++ .../common/rest/api/service/GroupService.java | 126 + .../common/rest/api/service/JAXRSService.java | 8 - .../common/rest/api/service/ReportService.java | 49 +- .../common/rest/api/service/TaskService.java| 57 +-- .../common/rest/api/service/UserService.java| 124 + .../jpa/entity/AttributableSearchTest.java | 471 --- .../jpa/entity/SubjectSearchTest.java | 471 +++ .../relationship/AttributableSearchTest.java| 72 --- .../jpa/relationship/SubjectSearchTest.java | 72 +++ .../rest/cxf/QueryResourceInfoComparator.java | 114 - .../core/rest/cxf/service/GroupServiceImpl.java | 72 +-- .../rest/cxf/service/ReportServiceImpl.java | 31 +- .../core/rest/cxf/service/TaskServiceImpl.java | 36 +- .../core/rest/cxf/service/UserServiceImpl.java | 72 +-- .../src/main/resources/restCXFContext.xml | 3 - .../fit/core/reference/AbstractTaskITCase.java | 4 +- .../core/reference/AuthenticationITCase.java| 10 +- .../syncope/fit/core/reference/GroupITCase.java | 10 +- .../core/reference/PropagationTaskITCase.java | 39 +- .../fit/core/reference/PushTaskITCase.java | 3 +- .../fit/core/reference/ReportITCase.java| 3 +- .../fit/core/reference/SchedTaskITCase.java | 6 +- .../fit/core/reference/SearchITCase.java| 86 ++-- .../fit/core/reference/SyncTaskITCase.java | 44 +- .../syncope/fit/core/reference/UserITCase.java | 53 ++- pom.xml | 2 +- 41 files changed, 1252 insertions(+), 1287 deletions(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/bc2afa9a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/ReportCommand.java -- diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/ReportCommand.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/ReportCommand.java index 17f0e14..c2ed1fa 100644 --- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/ReportCommand.java +++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/ReportCommand.java @@ -28,6 +28,7 @@ import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.apache.syncope.client.cli.SyncopeServices; import org.apache.syncope.client.cli.util.XmlUtils; +import org.apache.syncope.client.lib.SyncopeClient; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.ReportExecTO; import org.apache.syncope.common.lib.to.ReportTO; @@ -97,7 +98,7 @@ public class ReportCommand extends AbstractCommand { } else if (list) { LOG.debug("- report list command"); try { -for (final ReportTO reportTO : reportService.list().getResult()) { +for (ReportTO reportTO : reportService.list(SyncopeClient.getListQueryBuilder().build()).getResult()) { System.out.println(reportTO); } } catch (final SyncopeClientException ex) { http://git-wip-us.apache.org/repos/asf/syncope/blob/bc2afa9a/client/console/src/main/java/org/apache/syncope/client/console/rest/AbstractSubjectRestClient.java --
[1/3] syncope git commit: [SYNCOPE-661] No more overloaded list / search REST methods + helpers provided for Java client invocation
Repository: syncope Updated Branches: refs/heads/master 39f8a0696 -> bc2afa9a4 http://git-wip-us.apache.org/repos/asf/syncope/blob/bc2afa9a/pom.xml -- diff --git a/pom.xml b/pom.xml index 958496a..a86ca77 100644 --- a/pom.xml +++ b/pom.xml @@ -326,7 +326,7 @@ under the License. 1.4.0 1.2.2 -3.0.4 +3.0.5-SNAPSHOT 2.15.1
[2/3] syncope git commit: [SYNCOPE-661] No more overloaded list / search REST methods + helpers provided for Java client invocation
http://git-wip-us.apache.org/repos/asf/syncope/blob/bc2afa9a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/SubjectSearchTest.java -- diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/SubjectSearchTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/SubjectSearchTest.java new file mode 100644 index 000..d0a6d0c --- /dev/null +++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/entity/SubjectSearchTest.java @@ -0,0 +1,471 @@ +/* + * 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.persistence.jpa.entity; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.Predicate; +import org.apache.syncope.common.lib.SyncopeConstants; +import org.apache.syncope.common.lib.types.SubjectType; +import org.apache.syncope.core.persistence.api.dao.GroupDAO; +import org.apache.syncope.core.persistence.api.dao.SubjectSearchDAO; +import org.apache.syncope.core.persistence.api.dao.UserDAO; +import org.apache.syncope.core.persistence.api.dao.search.AttributeCond; +import org.apache.syncope.core.persistence.api.dao.search.MembershipCond; +import org.apache.syncope.core.persistence.api.dao.search.OrderByClause; +import org.apache.syncope.core.persistence.api.dao.search.ResourceCond; +import org.apache.syncope.core.persistence.api.dao.search.SearchCond; +import org.apache.syncope.core.persistence.api.dao.search.SubjectCond; +import org.apache.syncope.core.persistence.api.entity.group.Group; +import org.apache.syncope.core.persistence.api.entity.user.User; +import org.apache.syncope.core.persistence.jpa.AbstractTest; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; + +@Transactional +public class SubjectSearchTest extends AbstractTest { + +@Autowired +private UserDAO userDAO; + +@Autowired +private GroupDAO groupDAO; + +@Autowired +private SubjectSearchDAO searchDAO; + +@Test +public void userMatch() { +User user = userDAO.find(1L); +assertNotNull(user); + +MembershipCond membershipCond = new MembershipCond(); +membershipCond.setGroupId(5L); + +assertFalse(searchDAO.matches(user, SearchCond.getLeafCond(membershipCond), SubjectType.USER)); + +membershipCond.setGroupId(1L); + +assertTrue(searchDAO.matches(user, SearchCond.getLeafCond(membershipCond), SubjectType.USER)); +} + +@Test +public void groupMatch() { +Group group = groupDAO.find(1L); +assertNotNull(group); + +AttributeCond attrCond = new AttributeCond(); +attrCond.setSchema("show"); +attrCond.setType(AttributeCond.Type.ISNOTNULL); + +assertTrue(searchDAO.matches(group, SearchCond.getLeafCond(attrCond), SubjectType.GROUP)); +} + +@Test +public void searchWithLikeCondition() { +AttributeCond fullnameLeafCond = new AttributeCond(AttributeCond.Type.LIKE); +fullnameLeafCond.setSchema("fullname"); +fullnameLeafCond.setExpression("%o%"); + +MembershipCond membershipCond = new MembershipCond(); +membershipCond.setGroupId(1L); + +AttributeCond loginDateCond = new AttributeCond(AttributeCond.Type.EQ); +loginDateCond.setSchema("loginDate"); +loginDateCond.setExpression("2009-05-26"); + +SearchCond subCond = SearchCond.getAndCond(SearchCond.getLeafCond(fullnameLeafCond), SearchCond.getLeafCond( +membershipCond)); + +assertTrue(subCond.isValid()); + +SearchCond cond = SearchCond.getAndCond(subCond, SearchCond.getLeafCond(loginDateCond)); + +assertTru
[3/3] syncope git commit: Merge branch '1_2_X'
Merge branch '1_2_X' Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/1ac18d4e Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/1ac18d4e Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/1ac18d4e Branch: refs/heads/master Commit: 1ac18d4ea4b415f35ce22c06e862efd8091c1ecd Parents: bc2afa9 c0c4e01 Author: Francesco Chicchiriccò Authored: Thu Apr 23 17:14:06 2015 +0200 Committer: Francesco Chicchiriccò Committed: Thu Apr 23 17:14:06 2015 +0200 -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/1ac18d4e/pom.xml --
[2/3] syncope git commit: Upgrading maven-release-plugin
Upgrading maven-release-plugin Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/c0c4e011 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/c0c4e011 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/c0c4e011 Branch: refs/heads/master Commit: c0c4e011b9f27d9c0ee57bcfbb6d5f07a8a69a51 Parents: ff60dec Author: Francesco Chicchiriccò Authored: Thu Apr 23 17:13:50 2015 +0200 Committer: Francesco Chicchiriccò Committed: Thu Apr 23 17:13:50 2015 +0200 -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/c0c4e011/pom.xml -- diff --git a/pom.xml b/pom.xml index e993220..b771181 100644 --- a/pom.xml +++ b/pom.xml @@ -1487,7 +1487,7 @@ under the License. org.apache.maven.plugins maven-release-plugin -2.5.1 +2.5.2 forked-path true
[1/3] syncope git commit: Upgrading maven-release-plugin
Repository: syncope Updated Branches: refs/heads/1_2_X ff60decbb -> c0c4e011b refs/heads/master bc2afa9a4 -> 1ac18d4ea Upgrading maven-release-plugin Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/c0c4e011 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/c0c4e011 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/c0c4e011 Branch: refs/heads/1_2_X Commit: c0c4e011b9f27d9c0ee57bcfbb6d5f07a8a69a51 Parents: ff60dec Author: Francesco Chicchiriccò Authored: Thu Apr 23 17:13:50 2015 +0200 Committer: Francesco Chicchiriccò Committed: Thu Apr 23 17:13:50 2015 +0200 -- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/syncope/blob/c0c4e011/pom.xml -- diff --git a/pom.xml b/pom.xml index e993220..b771181 100644 --- a/pom.xml +++ b/pom.xml @@ -1487,7 +1487,7 @@ under the License. org.apache.maven.plugins maven-release-plugin -2.5.1 +2.5.2 forked-path true