syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [01/21] syncope git commit: Downgrading H2 to 1.4.190 since 1.4.191 seems to be slow
Date Tue, 26 Jan 2016 12:04:32 GMT
Repository: syncope
Updated Branches:
  refs/heads/master bf1c0fd90 -> 17d5d8928


Downgrading H2 to 1.4.190 since 1.4.191 seems to be slow


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

Branch: refs/heads/master
Commit: 6f35621893e768fdbbd8de1794be2e947cbfc4b8
Parents: 6d56c7e
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Tue Jan 26 11:06:06 2016 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Tue Jan 26 11:40:59 2016 +0100

----------------------------------------------------------------------
 .../syncope/common/lib/to/AnyTypeClassTO.java   | 12 ++++++------
 .../common/lib/types/ClientExceptionType.java   |  1 -
 .../persistence/api/entity/AnyTypeClass.java    |  2 --
 .../persistence/jpa/entity/JPAAnyTypeClass.java |  6 ------
 .../java/data/AnyTypeClassDataBinderImpl.java   | 20 +-------------------
 .../fit/core/reference/AnyTypeITCase.java       | 14 +++-----------
 pom.xml                                         |  2 +-
 7 files changed, 11 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/6f356218/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTypeClassTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTypeClassTO.java
b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTypeClassTO.java
index 815b800..7ed12bd 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTypeClassTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTypeClassTO.java
@@ -36,7 +36,7 @@ public class AnyTypeClassTO extends AbstractBaseBean implements EntityTO<String>
 
     private String key;
 
-    private final List<String> types = new ArrayList<>();
+    private final List<String> inUseByTypes = new ArrayList<>();
 
     private final List<String> plainSchemas = new ArrayList<>();
 
@@ -55,11 +55,11 @@ public class AnyTypeClassTO extends AbstractBaseBean implements EntityTO<String>
         this.key = key;
     }
 
-    @XmlElementWrapper(name = "types")
-    @XmlElement(name = "type")
-    @JsonProperty("types")
-    public List<String> getTypes() {
-        return types;
+    @XmlElementWrapper(name = "inUseByTypes")
+    @XmlElement(name = "anyTypeClass")
+    @JsonProperty("inUseByTypes")
+    public List<String> getInUseByTypes() {
+        return inUseByTypes;
     }
 
     @XmlElementWrapper(name = "plainSchemas")

http://git-wip-us.apache.org/repos/asf/syncope/blob/6f356218/common/lib/src/main/java/org/apache/syncope/common/lib/types/ClientExceptionType.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/types/ClientExceptionType.java
b/common/lib/src/main/java/org/apache/syncope/common/lib/types/ClientExceptionType.java
index d72d3d2..dfc5fe2 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/types/ClientExceptionType.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/types/ClientExceptionType.java
@@ -43,7 +43,6 @@ public enum ClientExceptionType {
     InvalidRelationship(Response.Status.BAD_REQUEST),
     InvalidRelationshipType(Response.Status.BAD_REQUEST),
     InvalidAnyType(Response.Status.BAD_REQUEST),
-    InvalidAnyTypeClass(Response.Status.BAD_REQUEST),
     InvalidAnyObject(Response.Status.BAD_REQUEST),
     InvalidGroup(Response.Status.BAD_REQUEST),
     InvalidSchemaDefinition(Response.Status.BAD_REQUEST),

http://git-wip-us.apache.org/repos/asf/syncope/blob/6f356218/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/AnyTypeClass.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/AnyTypeClass.java
b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/AnyTypeClass.java
index f6682b5..1908b69 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/AnyTypeClass.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/AnyTypeClass.java
@@ -24,8 +24,6 @@ public interface AnyTypeClass extends Entity<String> {
 
     void setKey(String key);
 
-    List<? extends AnyType> getTypes();
-
     boolean add(PlainSchema schema);
 
     List<? extends PlainSchema> getPlainSchemas();

http://git-wip-us.apache.org/repos/asf/syncope/blob/6f356218/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAAnyTypeClass.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAAnyTypeClass.java
b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAAnyTypeClass.java
index b823f49..58d5eb1 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAAnyTypeClass.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/JPAAnyTypeClass.java
@@ -27,7 +27,6 @@ import javax.persistence.Id;
 import javax.persistence.ManyToMany;
 import javax.persistence.OneToMany;
 import javax.persistence.Table;
-import org.apache.syncope.core.persistence.api.entity.AnyType;
 import org.apache.syncope.core.persistence.api.entity.AnyTypeClass;
 import org.apache.syncope.core.persistence.api.entity.DerSchema;
 import org.apache.syncope.core.persistence.api.entity.PlainSchema;
@@ -68,11 +67,6 @@ public class JPAAnyTypeClass extends AbstractEntity<String> implements
AnyTypeCl
     }
 
     @Override
-    public List<? extends AnyType> getTypes() {
-        return types;
-    }
-
-    @Override
     public boolean add(final PlainSchema schema) {
         checkType(schema, JPAPlainSchema.class);
         return this.plainSchemas.add((JPAPlainSchema) schema);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6f356218/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyTypeClassDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyTypeClassDataBinderImpl.java
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyTypeClassDataBinderImpl.java
index b5bc11a..e8ae693 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyTypeClassDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AnyTypeClassDataBinderImpl.java
@@ -19,11 +19,7 @@
 package org.apache.syncope.core.provisioning.java.data;
 
 import java.util.Collections;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.collections4.Transformer;
-import org.apache.syncope.common.lib.SyncopeClientException;
 import org.apache.syncope.common.lib.to.AnyTypeClassTO;
-import org.apache.syncope.common.lib.types.ClientExceptionType;
 import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO;
 import org.apache.syncope.core.persistence.api.dao.DerSchemaDAO;
 import org.apache.syncope.core.persistence.api.dao.PlainSchemaDAO;
@@ -73,20 +69,6 @@ public class AnyTypeClassDataBinderImpl implements AnyTypeClassDataBinder
{
             anyTypeClass.setKey(anyTypeClassTO.getKey());
         }
 
-        if (!CollectionUtils.disjunction(
-                CollectionUtils.collect(anyTypeClass.getTypes(), new Transformer<AnyType,
String>() {
-
-                    @Override
-                    public String transform(final AnyType anyType) {
-                        return anyType.getKey();
-                    }
-                }), anyTypeClassTO.getTypes()).isEmpty()) {
-
-            SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidAnyTypeClass);
-            sce.getElements().add("Cannot update types from classes, do the other way round");
-            throw sce;
-        }
-
         for (PlainSchema schema : plainSchemaDAO.findByAnyTypeClasses(Collections.singletonList(anyTypeClass)))
{
             schema.setAnyTypeClass(null);
         }
@@ -140,7 +122,7 @@ public class AnyTypeClassDataBinderImpl implements AnyTypeClassDataBinder
{
         anyTypeClassTO.setKey(anyTypeClass.getKey());
 
         for (AnyType anyType : anyTypeDAO.findByTypeClass(anyTypeClass)) {
-            anyTypeClassTO.getTypes().add(anyType.getKey());
+            anyTypeClassTO.getInUseByTypes().add(anyType.getKey());
         }
 
         for (PlainSchema schema : anyTypeClass.getPlainSchemas()) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/6f356218/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AnyTypeITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AnyTypeITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AnyTypeITCase.java
index b82aabd..704370e 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AnyTypeITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/reference/AnyTypeITCase.java
@@ -182,17 +182,9 @@ public class AnyTypeITCase extends AbstractITCase {
             assertTrue(group.getClasses().contains("other"));
 
             other = anyTypeClassService.read("other");
-            assertEquals(2, other.getTypes().size());
-            assertTrue(other.getTypes().contains(AnyTypeKind.USER.name()));
-            assertTrue(other.getTypes().contains(AnyTypeKind.GROUP.name()));
-
-            other.getTypes().remove(AnyTypeKind.GROUP.name());
-            try {
-                anyTypeClassService.update(other);
-                fail();
-            } catch (SyncopeClientException e) {
-                assertEquals(ClientExceptionType.InvalidAnyTypeClass, e.getType());
-            }
+            assertEquals(2, other.getInUseByTypes().size());
+            assertTrue(other.getInUseByTypes().contains(AnyTypeKind.USER.name()));
+            assertTrue(other.getInUseByTypes().contains(AnyTypeKind.GROUP.name()));
         } finally {
             group.getClasses().remove("other");
             anyTypeService.update(group);

http://git-wip-us.apache.org/repos/asf/syncope/blob/6f356218/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index bf6cff2..98a2a7e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -365,7 +365,7 @@ under the License.
     <commons-collection.version>4.1</commons-collection.version>
     <commons-logging.version>1.1.3</commons-logging.version>
 
-    <h2.version>1.4.191</h2.version>
+    <h2.version>1.4.190</h2.version>
 
     <junit.version>4.12</junit.version>
 


Mime
View raw message