syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject svn commit: r1300882 [13/22] - in /incubator/syncope/trunk: build-tools/src/main/java/org/syncope/buildtools/ client/src/main/java/org/syncope/annotation/ client/src/main/java/org/syncope/client/ client/src/main/java/org/syncope/client/http/ client/src...
Date Thu, 15 Mar 2012 10:17:24 GMT
Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/dao/impl/UserSearchDAOImpl.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/dao/impl/UserSearchDAOImpl.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/dao/impl/UserSearchDAOImpl.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/dao/impl/UserSearchDAOImpl.java Thu Mar 15 10:17:12 2012
@@ -46,11 +46,9 @@ import org.syncope.core.persistence.dao.
 import org.syncope.types.SchemaType;
 
 @Repository
-public class UserSearchDAOImpl extends AbstractDAOImpl
-        implements UserSearchDAO {
+public class UserSearchDAOImpl extends AbstractDAOImpl implements UserSearchDAO {
 
-    static final private String EMPTY_ATTR_QUERY =
-            "SELECT user_id FROM user_search_attr WHERE 1=2";
+    static final private String EMPTY_ATTR_QUERY = "SELECT user_id FROM user_search_attr WHERE 1=2";
 
     @Autowired
     private UserDAO userDAO;
@@ -69,18 +67,13 @@ public class UserSearchDAOImpl extends A
     private String getAdminRolesFilter(final Set<Long> adminRoles) {
         final StringBuilder adminRolesFilter = new StringBuilder();
         if (adminRoles == null || adminRoles.isEmpty()) {
-            adminRolesFilter.append("SELECT syncopeUser_id AS user_id ").
-                    append("FROM Membership");
+            adminRolesFilter.append("SELECT syncopeUser_id AS user_id ").append("FROM Membership");
         } else {
-            adminRolesFilter.append("SELECT syncopeUser_id AS user_id ").
-                    append("FROM Membership M1 ").
-                    append("WHERE syncopeRole_id IN (");
-            adminRolesFilter.append("SELECT syncopeRole_id ").
-                    append("FROM Membership M2 ").
-                    append("WHERE M2.syncopeUser_id=M1.syncopeUser_id ").
-                    append("AND syncopeRole_id NOT IN (");
-            adminRolesFilter.append(
-                    "SELECT id AS syncopeRole_id FROM SyncopeRole");
+            adminRolesFilter.append("SELECT syncopeUser_id AS user_id ").append("FROM Membership M1 ").append(
+                    "WHERE syncopeRole_id IN (");
+            adminRolesFilter.append("SELECT syncopeRole_id ").append("FROM Membership M2 ").append(
+                    "WHERE M2.syncopeUser_id=M1.syncopeUser_id ").append("AND syncopeRole_id NOT IN (");
+            adminRolesFilter.append("SELECT id AS syncopeRole_id FROM SyncopeRole");
             boolean firstRole = true;
             for (Long adminRoleId : adminRoles) {
                 if (firstRole) {
@@ -99,11 +92,9 @@ public class UserSearchDAOImpl extends A
     }
 
     @Override
-    public int count(final Set<Long> adminRoles,
-            final NodeCond searchCondition) {
+    public int count(final Set<Long> adminRoles, final NodeCond searchCondition) {
 
-        List<Object> parameters = Collections.synchronizedList(
-                new ArrayList<Object>());
+        List<Object> parameters = Collections.synchronizedList(new ArrayList<Object>());
 
         // 1. get the query string from the search condition
         StringBuilder queryString = getQuery(searchCondition, parameters);
@@ -117,12 +108,10 @@ public class UserSearchDAOImpl extends A
         queryString.insert(0, "SELECT COUNT(user_id) FROM (");
         queryString.append(") count_user_id");
 
-        Query countQuery =
-                entityManager.createNativeQuery(queryString.toString());
+        Query countQuery = entityManager.createNativeQuery(queryString.toString());
         fillWithParameters(countQuery, parameters);
 
-        LOG.debug("Native count query\n{}\nwith parameters\n{}",
-                queryString.toString(), parameters);
+        LOG.debug("Native count query\n{}\nwith parameters\n{}", queryString.toString(), parameters);
 
         int result = ((Number) countQuery.getSingleResult()).intValue();
         LOG.debug("Native count query result: {}", result);
@@ -136,16 +125,13 @@ public class UserSearchDAOImpl extends A
     }
 
     @Override
-    public List<SyncopeUser> search(final Set<Long> adminRoles,
-            final NodeCond searchCondition) {
+    public List<SyncopeUser> search(final Set<Long> adminRoles, final NodeCond searchCondition) {
 
         return search(adminRoles, searchCondition, -1, -1);
     }
 
     @Override
-    public List<SyncopeUser> search(final Set<Long> adminRoles,
-            final NodeCond searchCondition,
-            final int page,
+    public List<SyncopeUser> search(final Set<Long> adminRoles, final NodeCond searchCondition, final int page,
             final int itemsPerPage) {
 
         List<SyncopeUser> result = Collections.EMPTY_LIST;
@@ -155,8 +141,7 @@ public class UserSearchDAOImpl extends A
             LOG.error("Invalid search condition:\n{}", searchCondition);
         } else {
             try {
-                result = doSearch(adminRoles, searchCondition, page,
-                        itemsPerPage);
+                result = doSearch(adminRoles, searchCondition, page, itemsPerPage);
             } catch (Throwable t) {
                 LOG.error("While searching users", t);
             }
@@ -166,23 +151,20 @@ public class UserSearchDAOImpl extends A
     }
 
     @Override
-    public boolean matches(final SyncopeUser user,
-            final NodeCond searchCondition) {
+    public boolean matches(final SyncopeUser user, final NodeCond searchCondition) {
 
-        List<Object> parameters = Collections.synchronizedList(
-                new ArrayList<Object>());
+        List<Object> parameters = Collections.synchronizedList(new ArrayList<Object>());
 
         // 1. get the query string from the search condition
         StringBuilder queryString = getQuery(searchCondition, parameters);
 
         // 2. take into account the passed user
         queryString.insert(0, "SELECT u.user_id FROM (");
-        queryString.append(") u WHERE user_id=?").append(
-                setParameter(parameters, user.getId()));
+        queryString.append(") u WHERE user_id=?").append(setParameter(parameters, user.getId()));
 
         // 3. prepare the search query
         Query query = entityManager.createNativeQuery(queryString.toString());
-        
+
         // 4. populate the search query with parameter values
         fillWithParameters(query, parameters);
 
@@ -192,8 +174,7 @@ public class UserSearchDAOImpl extends A
         return !result.isEmpty();
     }
 
-    private int setParameter(final List<Object> parameters,
-            final Object parameter) {
+    private int setParameter(final List<Object> parameters, final Object parameter) {
 
         int key;
         synchronized (parameters) {
@@ -204,27 +185,25 @@ public class UserSearchDAOImpl extends A
         return key;
     }
 
-    private void fillWithParameters(final Query query,
-            final List<Object> parameters) {
+    private void fillWithParameters(final Query query, final List<Object> parameters) {
 
         for (int i = 0; i < parameters.size(); i++) {
             if (parameters.get(i) instanceof Date) {
-                query.setParameter(i + 1, (Date) parameters.get(i),
-                        TemporalType.TIMESTAMP);
+                query.setParameter(i + 1, (Date) parameters.get(i), TemporalType.TIMESTAMP);
             } else if (parameters.get(i) instanceof Boolean) {
-                query.setParameter(i + 1, ((Boolean) parameters.get(i)) ? 1 : 0);
+                query.setParameter(i + 1, ((Boolean) parameters.get(i))
+                        ? 1
+                        : 0);
             } else {
                 query.setParameter(i + 1, parameters.get(i));
             }
         }
     }
 
-    private List<SyncopeUser> doSearch(final Set<Long> adminRoles,
-            final NodeCond nodeCond,
-            final int page, final int itemsPerPage) {
+    private List<SyncopeUser> doSearch(final Set<Long> adminRoles, final NodeCond nodeCond, final int page,
+            final int itemsPerPage) {
 
-        List<Object> parameters = Collections.synchronizedList(
-                new ArrayList<Object>());
+        List<Object> parameters = Collections.synchronizedList(new ArrayList<Object>());
 
         // 1. get the query string from the search condition
         final StringBuilder queryString = getQuery(nodeCond, parameters);
@@ -240,11 +219,12 @@ public class UserSearchDAOImpl extends A
         queryString.append(getAdminRolesFilter(adminRoles)).append(")");
 
         // 3. prepare the search query
-        final Query query =
-                entityManager.createNativeQuery(queryString.toString());
+        final Query query = entityManager.createNativeQuery(queryString.toString());
 
         // page starts from 1, while setFirtResult() starts from 0
-        query.setFirstResult(itemsPerPage * (page <= 0 ? 0 : page - 1));
+        query.setFirstResult(itemsPerPage * (page <= 0
+                ? 0
+                : page - 1));
 
         if (itemsPerPage >= 0) {
             query.setMaxResults(itemsPerPage);
@@ -253,8 +233,7 @@ public class UserSearchDAOImpl extends A
         // 4. populate the search query with parameter values
         fillWithParameters(query, parameters);
 
-        LOG.debug("Native query\n{}\nwith parameters\n{}",
-                queryString.toString(), parameters);
+        LOG.debug("Native query\n{}\nwith parameters\n{}", queryString.toString(), parameters);
 
         // 5. Prepare the result (avoiding duplicates - set)
         final Set<Number> userIds = new HashSet<Number>();
@@ -271,15 +250,13 @@ public class UserSearchDAOImpl extends A
             }
         }
 
-        final List<SyncopeUser> result =
-                new ArrayList<SyncopeUser>(userIds.size());
+        final List<SyncopeUser> result = new ArrayList<SyncopeUser>(userIds.size());
 
         SyncopeUser user;
         for (Object userId : userIds) {
             user = userDAO.find(((Number) userId).longValue());
             if (user == null) {
-                LOG.error("Could not find user with id {}, "
-                        + "even though returned by the native query", userId);
+                LOG.error("Could not find user with id {}, " + "even though returned by the native query", userId);
             } else {
                 result.add(user);
             }
@@ -288,8 +265,7 @@ public class UserSearchDAOImpl extends A
         return result;
     }
 
-    private StringBuilder getQuery(final NodeCond nodeCond,
-            final List<Object> parameters) {
+    private StringBuilder getQuery(final NodeCond nodeCond, final List<Object> parameters) {
 
         StringBuilder query = new StringBuilder();
 
@@ -298,44 +274,31 @@ public class UserSearchDAOImpl extends A
             case LEAF:
             case NOT_LEAF:
                 if (nodeCond.getMembershipCond() != null) {
-                    query.append(getQuery(nodeCond.getMembershipCond(),
-                            nodeCond.getType() == NodeCond.Type.NOT_LEAF,
+                    query.append(getQuery(nodeCond.getMembershipCond(), nodeCond.getType() == NodeCond.Type.NOT_LEAF,
                             parameters));
                 }
                 if (nodeCond.getResourceCond() != null) {
-                    query.append(getQuery(nodeCond.getResourceCond(),
-                            nodeCond.getType() == NodeCond.Type.NOT_LEAF,
+                    query.append(getQuery(nodeCond.getResourceCond(), nodeCond.getType() == NodeCond.Type.NOT_LEAF,
                             parameters));
                 }
                 if (nodeCond.getAttributeCond() != null) {
-                    query.append(getQuery(nodeCond.getAttributeCond(),
-                            nodeCond.getType() == NodeCond.Type.NOT_LEAF,
+                    query.append(getQuery(nodeCond.getAttributeCond(), nodeCond.getType() == NodeCond.Type.NOT_LEAF,
                             parameters));
                 }
                 if (nodeCond.getSyncopeUserCond() != null) {
-                    query.append(getQuery(nodeCond.getSyncopeUserCond(),
-                            nodeCond.getType() == NodeCond.Type.NOT_LEAF,
+                    query.append(getQuery(nodeCond.getSyncopeUserCond(), nodeCond.getType() == NodeCond.Type.NOT_LEAF,
                             parameters));
                 }
                 break;
 
             case AND:
-                query.append(getQuery(nodeCond.getLeftNodeCond(),
-                        parameters)).
-                        append(" AND user_id IN ( ").
-                        append(getQuery(nodeCond.getRightNodeCond(),
-                        parameters).
-                        append(")"));
+                query.append(getQuery(nodeCond.getLeftNodeCond(), parameters)).append(" AND user_id IN ( ").append(
+                        getQuery(nodeCond.getRightNodeCond(), parameters).append(")"));
                 break;
 
             case OR:
-                query.append("(").
-                        append(getQuery(nodeCond.getLeftNodeCond(),
-                        parameters)).
-                        append(" UNION ").
-                        append(getQuery(nodeCond.getRightNodeCond(),
-                        parameters).
-                        append(")"));
+                query.append("(").append(getQuery(nodeCond.getLeftNodeCond(), parameters)).append(" UNION ").append(
+                        getQuery(nodeCond.getRightNodeCond(), parameters).append(")"));
                 break;
 
             default:
@@ -344,11 +307,9 @@ public class UserSearchDAOImpl extends A
         return query;
     }
 
-    private String getQuery(final MembershipCond cond,
-            final boolean not, final List<Object> parameters) {
+    private String getQuery(final MembershipCond cond, final boolean not, final List<Object> parameters) {
 
-        StringBuilder query = new StringBuilder(
-                "SELECT DISTINCT user_id FROM user_search WHERE ");
+        StringBuilder query = new StringBuilder("SELECT DISTINCT user_id FROM user_search WHERE ");
 
         if (not) {
             query.append("user_id NOT IN (");
@@ -356,15 +317,12 @@ public class UserSearchDAOImpl extends A
             query.append("user_id IN (");
         }
 
-        query.append("SELECT DISTINCT user_id ").
-                append("FROM user_search_membership WHERE ");
+        query.append("SELECT DISTINCT user_id ").append("FROM user_search_membership WHERE ");
 
         if (cond.getRoleId() != null) {
-            query.append("role_id=?").append(
-                    setParameter(parameters, cond.getRoleId()));
+            query.append("role_id=?").append(setParameter(parameters, cond.getRoleId()));
         } else if (cond.getRoleName() != null) {
-            query.append("role_name=?").append(
-                    setParameter(parameters, cond.getRoleName()));
+            query.append("role_name=?").append(setParameter(parameters, cond.getRoleName()));
         }
 
         query.append(")");
@@ -372,11 +330,9 @@ public class UserSearchDAOImpl extends A
         return query.toString();
     }
 
-    private String getQuery(final ResourceCond cond,
-            final boolean not, final List<Object> parameters) {
+    private String getQuery(final ResourceCond cond, final boolean not, final List<Object> parameters) {
 
-        final StringBuilder query = new StringBuilder(
-                "SELECT DISTINCT user_id FROM user_search WHERE ");
+        final StringBuilder query = new StringBuilder("SELECT DISTINCT user_id FROM user_search WHERE ");
 
         if (not) {
             query.append("user_id NOT IN (");
@@ -384,21 +340,17 @@ public class UserSearchDAOImpl extends A
             query.append("user_id IN (");
         }
 
-        query.append("SELECT DISTINCT user_id ").
-                append("FROM user_search_resource WHERE ");
+        query.append("SELECT DISTINCT user_id ").append("FROM user_search_resource WHERE ");
 
-        query.append("resource_name=?").append(
-                setParameter(parameters, cond.getResourceName()));
+        query.append("resource_name=?").append(setParameter(parameters, cond.getResourceName()));
 
         query.append(")");
 
         return query.toString();
     }
 
-    private void fillAttributeQuery(final StringBuilder query,
-            final UAttrValue attrValue, final USchema schema,
-            final AttributeCond cond, final boolean not,
-            final List<Object> parameters) {
+    private void fillAttributeQuery(final StringBuilder query, final UAttrValue attrValue, final USchema schema,
+            final AttributeCond cond, final boolean not, final List<Object> parameters) {
 
         String column = (cond instanceof SyncopeUserCond)
                 ? cond.getSchema()
@@ -407,16 +359,19 @@ public class UserSearchDAOImpl extends A
         switch (cond.getType()) {
 
             case ISNULL:
-                query.append(column).append(not ? " IS NOT NULL" : " IS NULL");
+                query.append(column).append(not
+                        ? " IS NOT NULL"
+                        : " IS NULL");
                 break;
 
             case ISNOTNULL:
-                query.append(column).append(not ? " IS NULL" : " IS NOT NULL");
+                query.append(column).append(not
+                        ? " IS NULL"
+                        : " IS NOT NULL");
                 break;
 
             case LIKE:
-                if (schema.getType() == SchemaType.String
-                        || schema.getType() == SchemaType.Enum) {
+                if (schema.getType() == SchemaType.String || schema.getType() == SchemaType.Enum) {
 
                     query.append(column);
                     if (not) {
@@ -443,8 +398,7 @@ public class UserSearchDAOImpl extends A
                 } else {
                     query.append("=");
                 }
-                query.append("?").append(
-                        setParameter(parameters, attrValue.getValue()));
+                query.append("?").append(setParameter(parameters, attrValue.getValue()));
                 break;
 
             case GE:
@@ -454,8 +408,7 @@ public class UserSearchDAOImpl extends A
                 } else {
                     query.append(">=");
                 }
-                query.append("?").append(
-                        setParameter(parameters, attrValue.getValue()));
+                query.append("?").append(setParameter(parameters, attrValue.getValue()));
                 break;
 
             case GT:
@@ -465,8 +418,7 @@ public class UserSearchDAOImpl extends A
                 } else {
                     query.append(">");
                 }
-                query.append("?").append(
-                        setParameter(parameters, attrValue.getValue()));
+                query.append("?").append(setParameter(parameters, attrValue.getValue()));
                 break;
 
             case LE:
@@ -476,8 +428,7 @@ public class UserSearchDAOImpl extends A
                 } else {
                     query.append("<=");
                 }
-                query.append("?").append(
-                        setParameter(parameters, attrValue.getValue()));
+                query.append("?").append(setParameter(parameters, attrValue.getValue()));
                 break;
 
             case LT:
@@ -487,8 +438,7 @@ public class UserSearchDAOImpl extends A
                 } else {
                     query.append("<");
                 }
-                query.append("?").append(
-                        setParameter(parameters, attrValue.getValue()));
+                query.append("?").append(setParameter(parameters, attrValue.getValue()));
                 break;
 
             default:
@@ -527,8 +477,7 @@ public class UserSearchDAOImpl extends A
         return result;
     }
 
-    private String getQuery(final AttributeCond cond,
-            final boolean not, final List<Object> parameters) {
+    private String getQuery(final AttributeCond cond, final boolean not, final List<Object> parameters) {
 
         USchema schema = schemaDAO.find(cond.getSchema(), USchema.class);
         if (schema == null) {
@@ -538,40 +487,34 @@ public class UserSearchDAOImpl extends A
 
         UAttrValue attrValue = new UAttrValue();
         try {
-            if (cond.getType() != AttributeCond.Type.LIKE
-                    && cond.getType() != AttributeCond.Type.ISNULL
+            if (cond.getType() != AttributeCond.Type.LIKE && cond.getType() != AttributeCond.Type.ISNULL
                     && cond.getType() != AttributeCond.Type.ISNOTNULL) {
 
                 schema.getValidator().validate(cond.getExpression(), attrValue);
             }
         } catch (ValidationException e) {
-            LOG.error("Could not validate expression '"
-                    + cond.getExpression() + "'", e);
+            LOG.error("Could not validate expression '" + cond.getExpression() + "'", e);
             return EMPTY_ATTR_QUERY;
         }
 
-        StringBuilder query = new StringBuilder(
-                "SELECT DISTINCT user_id FROM user_search_attr WHERE ").append(
+        StringBuilder query = new StringBuilder("SELECT DISTINCT user_id FROM user_search_attr WHERE ").append(
                 "schema_name='").append(schema.getName());
         fillAttributeQuery(query, attrValue, schema, cond, not, parameters);
 
         return query.toString();
     }
 
-    private String getQuery(final SyncopeUserCond cond,
-            final boolean not, final List<Object> parameters) {
+    private String getQuery(final SyncopeUserCond cond, final boolean not, final List<Object> parameters) {
 
         Field syncopeUserClassField = null;
         // loop over SyncopeUser class and all superclasses searching for field
-        for (Class<?> i = SyncopeUser.class;
-                syncopeUserClassField == null && i != Object.class;) {
+        for (Class<?> i = SyncopeUser.class; syncopeUserClassField == null && i != Object.class;) {
 
             try {
                 syncopeUserClassField = i.getDeclaredField(cond.getSchema());
             } catch (Exception ignore) {
                 // ignore exception
-                LOG.debug("Field '{}' not found on class '{}'",
-                        new String[]{cond.getSchema(), i.getSimpleName()},
+                LOG.debug("Field '{}' not found on class '{}'", new String[] { cond.getSchema(), i.getSimpleName() },
                         ignore);
             } finally {
                 i = i.getSuperclass();
@@ -585,8 +528,7 @@ public class UserSearchDAOImpl extends A
         USchema schema = new USchema();
         schema.setName(syncopeUserClassField.getName());
         for (SchemaType type : SchemaType.values()) {
-            if (syncopeUserClassField.getType().
-                    getName().equals(type.getClassName())) {
+            if (syncopeUserClassField.getType().getName().equals(type.getClassName())) {
 
                 schema.setType(type);
             }
@@ -594,20 +536,17 @@ public class UserSearchDAOImpl extends A
 
         UAttrValue attrValue = new UAttrValue();
         try {
-            if (cond.getType() != AttributeCond.Type.LIKE
-                    && cond.getType() != AttributeCond.Type.ISNULL
+            if (cond.getType() != AttributeCond.Type.LIKE && cond.getType() != AttributeCond.Type.ISNULL
                     && cond.getType() != AttributeCond.Type.ISNOTNULL) {
 
                 schema.getValidator().validate(cond.getExpression(), attrValue);
             }
         } catch (ValidationException e) {
-            LOG.error("Could not validate expression '"
-                    + cond.getExpression() + "'", e);
+            LOG.error("Could not validate expression '" + cond.getExpression() + "'", e);
             return EMPTY_ATTR_QUERY;
         }
 
-        final StringBuilder query = new StringBuilder(
-                "SELECT DISTINCT user_id FROM user_search WHERE ");
+        final StringBuilder query = new StringBuilder("SELECT DISTINCT user_id FROM user_search WHERE ");
 
         fillAttributeQuery(query, attrValue, schema, cond, not, parameters);
 

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/dao/impl/VirAttrDAOImpl.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/dao/impl/VirAttrDAOImpl.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/dao/impl/VirAttrDAOImpl.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/dao/impl/VirAttrDAOImpl.java Thu Mar 15 10:17:12 2012
@@ -28,31 +28,26 @@ import org.syncope.core.persistence.dao.
 public class VirAttrDAOImpl extends AbstractDAOImpl implements VirAttrDAO {
 
     @Override
-    public <T extends AbstractVirAttr> T find(
-            final Long id, final Class<T> reference) {
+    public <T extends AbstractVirAttr> T find(final Long id, final Class<T> reference) {
 
         return entityManager.find(reference, id);
     }
 
     @Override
-    public <T extends AbstractVirAttr> List<T> findAll(
-            final Class<T> reference) {
+    public <T extends AbstractVirAttr> List<T> findAll(final Class<T> reference) {
 
-        Query query = entityManager.createQuery(
-                "SELECT e FROM " + reference.getSimpleName() + " e");
+        Query query = entityManager.createQuery("SELECT e FROM " + reference.getSimpleName() + " e");
         return query.getResultList();
     }
 
     @Override
-    public <T extends AbstractVirAttr> T save(
-            final T virtualAttribute) {
+    public <T extends AbstractVirAttr> T save(final T virtualAttribute) {
 
         return entityManager.merge(virtualAttribute);
     }
 
     @Override
-    public <T extends AbstractVirAttr> void delete(
-            final Long id, final Class<T> reference) {
+    public <T extends AbstractVirAttr> void delete(final Long id, final Class<T> reference) {
 
         T virtualAttribute = find(id, reference);
         if (virtualAttribute == null) {
@@ -63,12 +58,10 @@ public class VirAttrDAOImpl extends Abst
     }
 
     @Override
-    public <T extends AbstractVirAttr> void delete(
-            final T virtualAttribute) {
+    public <T extends AbstractVirAttr> void delete(final T virtualAttribute) {
 
         if (virtualAttribute.getOwner() != null) {
-            virtualAttribute.getOwner().
-                    removeVirtualAttribute(virtualAttribute);
+            virtualAttribute.getOwner().removeVirtualAttribute(virtualAttribute);
         }
 
         entityManager.remove(virtualAttribute);

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/dao/impl/VirSchemaDAOImpl.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/dao/impl/VirSchemaDAOImpl.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/dao/impl/VirSchemaDAOImpl.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/dao/impl/VirSchemaDAOImpl.java Thu Mar 15 10:17:12 2012
@@ -41,18 +41,15 @@ public class VirSchemaDAOImpl extends Ab
     private ResourceDAO resourceDAO;
 
     @Override
-    public <T extends AbstractVirSchema> T find(final String name,
-            final Class<T> reference) {
+    public <T extends AbstractVirSchema> T find(final String name, final Class<T> reference) {
 
         return entityManager.find(reference, name);
     }
 
     @Override
-    public <T extends AbstractVirSchema> List<T> findAll(
-            final Class<T> reference) {
+    public <T extends AbstractVirSchema> List<T> findAll(final Class<T> reference) {
 
-        Query query = entityManager.createQuery(
-                "SELECT e FROM " + reference.getSimpleName() + " e");
+        Query query = entityManager.createQuery("SELECT e FROM " + reference.getSimpleName() + " e");
         return query.getResultList();
     }
 
@@ -62,22 +59,18 @@ public class VirSchemaDAOImpl extends Ab
     }
 
     @Override
-    public void delete(final String name,
-            final AttributableUtil attributableUtil) {
+    public void delete(final String name, final AttributableUtil attributableUtil) {
 
-        final AbstractVirSchema virtualSchema =
-                find(name, attributableUtil.virtualSchemaClass());
+        final AbstractVirSchema virtualSchema = find(name, attributableUtil.virtualSchemaClass());
 
         if (virtualSchema == null) {
             return;
         }
 
-        List<? extends AbstractVirAttr> attributes = getAttributes(
-                virtualSchema,
-                attributableUtil.virtualAttributeClass());
+        List<? extends AbstractVirAttr> attributes = getAttributes(virtualSchema, attributableUtil
+                .virtualAttributeClass());
 
-        final Set<Long> virtualAttributeIds =
-                new HashSet<Long>(attributes.size());
+        final Set<Long> virtualAttributeIds = new HashSet<Long>(attributes.size());
 
         Class attributeClass = null;
 
@@ -90,18 +83,16 @@ public class VirSchemaDAOImpl extends Ab
             virtualAttributeDAO.delete(virtualAttributeId, attributeClass);
         }
 
-        resourceDAO.deleteMappings(
-                name, attributableUtil.virtualIntMappingType());
+        resourceDAO.deleteMappings(name, attributableUtil.virtualIntMappingType());
 
         entityManager.remove(virtualSchema);
     }
 
     @Override
-    public <T extends AbstractVirAttr> List<T> getAttributes(
-            final AbstractVirSchema virtualSchema, final Class<T> reference) {
+    public <T extends AbstractVirAttr> List<T> getAttributes(final AbstractVirSchema virtualSchema,
+            final Class<T> reference) {
 
-        Query query = entityManager.createQuery(
-                "SELECT e FROM " + reference.getSimpleName() + " e"
+        Query query = entityManager.createQuery("SELECT e FROM " + reference.getSimpleName() + " e"
                 + " WHERE e.virtualSchema=:schema");
         query.setParameter("schema", virtualSchema);
 

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/AbstractValidator.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/AbstractValidator.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/AbstractValidator.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/AbstractValidator.java Thu Mar 15 10:17:12 2012
@@ -36,8 +36,7 @@ public abstract class AbstractValidator 
     /*
      * Logger
      */
-    protected static final Logger LOG = LoggerFactory.getLogger(
-            AbstractValidator.class);
+    protected static final Logger LOG = LoggerFactory.getLogger(AbstractValidator.class);
 
     protected final AbstractSchema schema;
 
@@ -46,16 +45,14 @@ public abstract class AbstractValidator 
     }
 
     @Override
-    public <T extends AbstractAttrValue> void validate(final String value,
-            T attributeValue)
+    public <T extends AbstractAttrValue> void validate(final String value, T attributeValue)
             throws ParsingValidationException, InvalidAttrValueException {
 
         parseValue(value, attributeValue);
         doValidate(attributeValue);
     }
 
-    private <T extends AbstractAttrValue> void parseValue(final String value,
-            final T attributeValue)
+    private <T extends AbstractAttrValue> void parseValue(final String value, final T attributeValue)
             throws ParsingValidationException {
 
         Exception exception = null;
@@ -76,9 +73,8 @@ public abstract class AbstractValidator 
                     if (schema.getFormatter() == null) {
                         attributeValue.setLongValue(Long.valueOf(value));
                     } else {
-                        attributeValue.setLongValue(Long.valueOf(
-                                ((DecimalFormat) schema.getFormatter()).parse(
-                                value).longValue()));
+                        attributeValue.setLongValue(Long.valueOf(((DecimalFormat) schema.getFormatter()).parse(value)
+                                .longValue()));
                     }
                 } catch (Exception pe) {
                     exception = pe;
@@ -90,8 +86,7 @@ public abstract class AbstractValidator 
                     if (schema.getFormatter() == null) {
                         attributeValue.setDoubleValue(Double.valueOf(value));
                     } else {
-                        attributeValue.setDoubleValue(Double.valueOf(
-                                ((DecimalFormat) schema.getFormatter()).parse(
+                        attributeValue.setDoubleValue(Double.valueOf(((DecimalFormat) schema.getFormatter()).parse(
                                 value).doubleValue()));
                     }
                 } catch (Exception pe) {
@@ -102,12 +97,10 @@ public abstract class AbstractValidator 
             case Date:
                 try {
                     if (schema.getFormatter() == null) {
-                        attributeValue.setDateValue(DateUtils.parseDate(
-                                value, SyncopeConstants.DATE_PATTERNS));
+                        attributeValue.setDateValue(DateUtils.parseDate(value, SyncopeConstants.DATE_PATTERNS));
                     } else {
-                        attributeValue.setDateValue(new Date(
-                                ((DateFormat) schema.getFormatter()).parse(
-                                value).getTime()));
+                        attributeValue.setDateValue(new Date(((DateFormat) schema.getFormatter()).parse(value)
+                                .getTime()));
                     }
                 } catch (Exception pe) {
                     exception = pe;
@@ -118,12 +111,9 @@ public abstract class AbstractValidator 
         }
 
         if (exception != null) {
-            throw new ParsingValidationException("While trying to parse '"
-                    + value + "'", exception);
+            throw new ParsingValidationException("While trying to parse '" + value + "'", exception);
         }
     }
 
-    protected abstract <T extends AbstractAttrValue> void doValidate(
-            T attributeValue)
-            throws InvalidAttrValueException;
+    protected abstract <T extends AbstractAttrValue> void doValidate(T attributeValue) throws InvalidAttrValueException;
 }

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/AlwaysTrueValidator.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/AlwaysTrueValidator.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/AlwaysTrueValidator.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/AlwaysTrueValidator.java Thu Mar 15 10:17:12 2012
@@ -29,8 +29,7 @@ public class AlwaysTrueValidator extends
     }
 
     @Override
-    protected void doValidate(AbstractAttrValue attributeValue)
-            throws InvalidAttrValueException {
+    protected void doValidate(AbstractAttrValue attributeValue) throws InvalidAttrValueException {
 
         Boolean value = attributeValue.getValue();
         if (!value) {

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/BasicValidator.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/BasicValidator.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/BasicValidator.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/BasicValidator.java Thu Mar 15 10:17:12 2012
@@ -31,13 +31,10 @@ public class BasicValidator extends Abst
     }
 
     @Override
-    protected void doValidate(AbstractAttrValue attributeValue)
-            throws InvalidAttrValueException {
+    protected void doValidate(AbstractAttrValue attributeValue) throws InvalidAttrValueException {
 
         if (SchemaType.Enum.equals(schema.getType())) {
-            final String[] enumeration =
-                    schema.getEnumerationValues().split(
-                    AbstractSchema.enumValuesSeparator);
+            final String[] enumeration = schema.getEnumerationValues().split(AbstractSchema.enumValuesSeparator);
 
             final String value = attributeValue.getValueAsString();
 

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/EmailAddressValidator.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/EmailAddressValidator.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/EmailAddressValidator.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/EmailAddressValidator.java Thu Mar 15 10:17:12 2012
@@ -26,19 +26,16 @@ import org.syncope.core.persistence.bean
 public class EmailAddressValidator extends AbstractValidator {
 
     private static final Pattern EMAIL_PATTERN = Pattern.compile(
-            "^[\\w\\-]([\\.\\w])+[\\w]+@([\\w\\-]+\\.)+[A-Z]{2,4}$",
-            Pattern.CASE_INSENSITIVE);
+            "^[\\w\\-]([\\.\\w])+[\\w]+@([\\w\\-]+\\.)+[A-Z]{2,4}$", Pattern.CASE_INSENSITIVE);
 
     public EmailAddressValidator(final AbstractSchema schema) {
         super(schema);
     }
 
     @Override
-    protected void doValidate(final AbstractAttrValue attributeValue)
-            throws InvalidAttrValueException {
+    protected void doValidate(final AbstractAttrValue attributeValue) throws InvalidAttrValueException {
 
-        Matcher matcher = EMAIL_PATTERN.matcher(
-                (CharSequence) attributeValue.getValue());
+        Matcher matcher = EMAIL_PATTERN.matcher((CharSequence) attributeValue.getValue());
         if (!matcher.matches()) {
             throw new InvalidAttrValueException(attributeValue);
         }

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/InvalidAttrValueException.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/InvalidAttrValueException.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/InvalidAttrValueException.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/InvalidAttrValueException.java Thu Mar 15 10:17:12 2012
@@ -27,8 +27,7 @@ public class InvalidAttrValueException e
         super("Could not validate " + value);
     }
 
-    public InvalidAttrValueException(
-            final AbstractAttrValue value, Throwable t) {
+    public InvalidAttrValueException(final AbstractAttrValue value, Throwable t) {
         super("Could not validate " + value, t);
     }
 }

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/Validator.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/Validator.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/Validator.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/attrvalue/Validator.java Thu Mar 15 10:17:12 2012
@@ -22,7 +22,6 @@ import org.syncope.core.persistence.bean
 
 public interface Validator {
 
-    <T extends AbstractAttrValue> void validate(String value,
-            T attributeValue)
+    <T extends AbstractAttrValue> void validate(String value, T attributeValue)
             throws ParsingValidationException, InvalidAttrValueException;
 }

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AbstractValidator.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AbstractValidator.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AbstractValidator.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AbstractValidator.java Thu Mar 15 10:17:12 2012
@@ -26,7 +26,6 @@ public abstract class AbstractValidator 
     /**
      * Logger.
      */
-    protected static final Logger LOG = LoggerFactory.getLogger(
-            AbstractValidator.class);
+    protected static final Logger LOG = LoggerFactory.getLogger(AbstractValidator.class);
 
 }

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AttrCheck.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AttrCheck.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AttrCheck.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AttrCheck.java Thu Mar 15 10:17:12 2012
@@ -26,9 +26,7 @@ import java.lang.annotation.Target;
 import javax.validation.Constraint;
 import javax.validation.Payload;
 
-@Target({
-    ElementType.TYPE
-})
+@Target( { ElementType.TYPE })
 @Retention(RetentionPolicy.RUNTIME)
 @Constraint(validatedBy = AttrValidator.class)
 @Documented

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AttrValidator.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AttrValidator.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AttrValidator.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AttrValidator.java Thu Mar 15 10:17:12 2012
@@ -23,16 +23,14 @@ import javax.validation.ConstraintValida
 import org.syncope.core.persistence.beans.AbstractAttr;
 import org.syncope.types.EntityViolationType;
 
-public class AttrValidator extends AbstractValidator
-        implements ConstraintValidator<AttrCheck, AbstractAttr> {
+public class AttrValidator extends AbstractValidator implements ConstraintValidator<AttrCheck, AbstractAttr> {
 
     @Override
     public void initialize(final AttrCheck constraintAnnotation) {
     }
 
     @Override
-    public boolean isValid(final AbstractAttr object,
-            final ConstraintValidatorContext context) {
+    public boolean isValid(final AbstractAttr object, final ConstraintValidatorContext context) {
 
         boolean isValid;
 
@@ -40,11 +38,9 @@ public class AttrValidator extends Abstr
             isValid = true;
         } else {
             if (object.getSchema().isUniqueConstraint()) {
-                isValid = object.getValues().isEmpty()
-                        && object.getUniqueValue() != null;
+                isValid = object.getValues().isEmpty() && object.getUniqueValue() != null;
             } else {
-                isValid = !object.getValues().isEmpty()
-                        && object.getUniqueValue() == null;
+                isValid = !object.getValues().isEmpty() && object.getUniqueValue() == null;
 
                 if (!object.getSchema().isMultivalue()) {
                     isValid &= object.getValues().size() == 1;
@@ -52,17 +48,13 @@ public class AttrValidator extends Abstr
             }
 
             if (!isValid) {
-                LOG.error("Invalid values for attribute " + object + ": "
-                        + "schema=" + object.getSchema().getName() + ", "
-                        + "values={}", object.getValuesAsStrings());
+                LOG.error("Invalid values for attribute " + object + ": " + "schema=" + object.getSchema().getName()
+                        + ", " + "values={}", object.getValuesAsStrings());
 
                 context.disableDefaultConstraintViolation();
-                context.buildConstraintViolationWithTemplate(
-                        EntityViolationType.InvalidValueList.toString()).
-                        addNode(object
-                        + "(" + object.getSchema().getName() + ")"
-                        + "{" + object.getValuesAsStrings() + "}").
-                        addConstraintViolation();
+                context.buildConstraintViolationWithTemplate(EntityViolationType.InvalidValueList.toString()).addNode(
+                        object + "(" + object.getSchema().getName() + ")" + "{" + object.getValuesAsStrings() + "}")
+                        .addConstraintViolation();
             }
         }
 

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AttrValueCheck.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AttrValueCheck.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AttrValueCheck.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AttrValueCheck.java Thu Mar 15 10:17:12 2012
@@ -26,9 +26,7 @@ import java.lang.annotation.Target;
 import javax.validation.Constraint;
 import javax.validation.Payload;
 
-@Target({
-    ElementType.TYPE
-})
+@Target( { ElementType.TYPE })
 @Retention(RetentionPolicy.RUNTIME)
 @Constraint(validatedBy = AttrValueValidator.class)
 @Documented

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AttrValueValidator.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AttrValueValidator.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AttrValueValidator.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/AttrValueValidator.java Thu Mar 15 10:17:12 2012
@@ -25,16 +25,15 @@ import org.syncope.core.persistence.bean
 import org.syncope.core.persistence.beans.AbstractSchema;
 import org.syncope.types.EntityViolationType;
 
-public class AttrValueValidator extends AbstractValidator
-        implements ConstraintValidator<AttrValueCheck, AbstractAttrValue> {
+public class AttrValueValidator extends AbstractValidator implements
+        ConstraintValidator<AttrValueCheck, AbstractAttrValue> {
 
     @Override
     public void initialize(final AttrValueCheck constraintAnnotation) {
     }
 
     @Override
-    public boolean isValid(final AbstractAttrValue object,
-            final ConstraintValidatorContext context) {
+    public boolean isValid(final AbstractAttrValue object, final ConstraintValidatorContext context) {
 
         boolean isValid;
 
@@ -63,32 +62,25 @@ public class AttrValueValidator extends 
                 LOG.error("More than one non-null value for " + object);
 
                 context.disableDefaultConstraintViolation();
-                context.buildConstraintViolationWithTemplate(
-                        EntityViolationType.MoreThanOneNonNull.toString()).
-                        addNode(object.toString().replaceAll("\\n", " ")).
-                        addConstraintViolation();
+                context.buildConstraintViolationWithTemplate(EntityViolationType.MoreThanOneNonNull.toString())
+                        .addNode(object.toString().replaceAll("\\n", " ")).addConstraintViolation();
             } else if (object instanceof AbstractAttrUniqueValue) {
-                AbstractSchema uniqueValueSchema =
-                        ((AbstractAttrUniqueValue) object).getSchema();
+                AbstractSchema uniqueValueSchema = ((AbstractAttrUniqueValue) object).getSchema();
                 AbstractSchema attrSchema = object.getAttribute().getSchema();
 
                 isValid = uniqueValueSchema.equals(attrSchema);
 
                 if (!isValid) {
-                    LOG.error("Unique value schema for "
-                            + object.getClass().getSimpleName()
-                            + "[" + object.getId() + "]"
-                            + " is " + uniqueValueSchema + ", while owning "
-                            + "attribute schema is " + attrSchema);
+                    LOG.error("Unique value schema for " + object.getClass().getSimpleName() + "[" + object.getId()
+                            + "]" + " is " + uniqueValueSchema + ", while owning " + "attribute schema is "
+                            + attrSchema);
 
                     context.disableDefaultConstraintViolation();
                     context.buildConstraintViolationWithTemplate(
-                            EntityViolationType.valueOf("Invalid"
-                            + attrSchema.getClass().getSimpleName()).toString()).
-                            addNode(object.getClass().getSimpleName()
-                            + "[" + object.getId() + "].schema="
-                            + uniqueValueSchema
-                            + " != " + attrSchema).addConstraintViolation();
+                            EntityViolationType.valueOf("Invalid" + attrSchema.getClass().getSimpleName()).toString())
+                            .addNode(
+                                    object.getClass().getSimpleName() + "[" + object.getId() + "].schema="
+                                            + uniqueValueSchema + " != " + attrSchema).addConstraintViolation();
                 }
             }
         }

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/EntitlementCheck.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/EntitlementCheck.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/EntitlementCheck.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/EntitlementCheck.java Thu Mar 15 10:17:12 2012
@@ -26,9 +26,7 @@ import java.lang.annotation.Target;
 import javax.validation.Constraint;
 import javax.validation.Payload;
 
-@Target({
-    ElementType.TYPE
-})
+@Target( { ElementType.TYPE })
 @Retention(RetentionPolicy.RUNTIME)
 @Constraint(validatedBy = EntitlementValidator.class)
 @Documented

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/EntitlementValidator.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/EntitlementValidator.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/EntitlementValidator.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/EntitlementValidator.java Thu Mar 15 10:17:12 2012
@@ -25,19 +25,17 @@ import javax.validation.ConstraintValida
 import org.syncope.core.persistence.beans.Entitlement;
 import org.syncope.types.EntityViolationType;
 
-public class EntitlementValidator extends AbstractValidator
-        implements ConstraintValidator<EntitlementCheck, Entitlement> {
+public class EntitlementValidator extends AbstractValidator implements
+        ConstraintValidator<EntitlementCheck, Entitlement> {
 
-    private static final Pattern ROLE_ENTITLEMENT_NAME_PATTERN =
-            Pattern.compile("^ROLE_([\\d])+");
+    private static final Pattern ROLE_ENTITLEMENT_NAME_PATTERN = Pattern.compile("^ROLE_([\\d])+");
 
     @Override
     public void initialize(final EntitlementCheck constraintAnnotation) {
     }
 
     @Override
-    public boolean isValid(final Entitlement object,
-            final ConstraintValidatorContext context) {
+    public boolean isValid(final Entitlement object, final ConstraintValidatorContext context) {
 
         boolean isValid = false;
 
@@ -47,20 +45,16 @@ public class EntitlementValidator extend
             if (object.getName() == null) {
                 isValid = false;
             } else {
-                Matcher matcher = ROLE_ENTITLEMENT_NAME_PATTERN.matcher(
-                        object.getName());
+                Matcher matcher = ROLE_ENTITLEMENT_NAME_PATTERN.matcher(object.getName());
                 isValid = !matcher.matches();
             }
 
             if (!isValid) {
-                LOG.error(object + " cannot have name "
-                        + "starting by ROLE_");
+                LOG.error(object + " cannot have name " + "starting by ROLE_");
 
                 context.disableDefaultConstraintViolation();
-                context.buildConstraintViolationWithTemplate(
-                        EntityViolationType.InvalidEntitlementName.toString()).
-                        addNode(object.toString()).
-                        addConstraintViolation();
+                context.buildConstraintViolationWithTemplate(EntityViolationType.InvalidEntitlementName.toString())
+                        .addNode(object.toString()).addConstraintViolation();
             }
         }
 

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/EntityValidationInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/EntityValidationInterceptor.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/EntityValidationInterceptor.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/EntityValidationInterceptor.java Thu Mar 15 10:17:12 2012
@@ -39,8 +39,7 @@ public class EntityValidationInterceptor
     /**
      * Logger.
      */
-    private static final Logger LOG = LoggerFactory.getLogger(
-            EntityValidationInterceptor.class);
+    private static final Logger LOG = LoggerFactory.getLogger(EntityValidationInterceptor.class);
 
     @Autowired
     private Validator validator;
@@ -53,15 +52,12 @@ public class EntityValidationInterceptor
      * @throws Throwable if anything goes wrong
      */
     @Around("execution(* org.syncope.core.persistence.dao..*.save(..))")
-    public final Object save(final ProceedingJoinPoint pjp)
-            throws Throwable {
+    public final Object save(final ProceedingJoinPoint pjp) throws Throwable {
 
-        Set<ConstraintViolation<Object>> violations =
-                validator.validate(pjp.getArgs()[0]);
+        Set<ConstraintViolation<Object>> violations = validator.validate(pjp.getArgs()[0]);
         if (!violations.isEmpty()) {
             LOG.error("Bean validation errors found: {}", violations);
-            throw new InvalidEntityException(
-                    pjp.getArgs()[0].getClass().getSimpleName(), violations);
+            throw new InvalidEntityException(pjp.getArgs()[0].getClass().getSimpleName(), violations);
         }
 
         return pjp.proceed();

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/ExternalResourceCheck.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/ExternalResourceCheck.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/ExternalResourceCheck.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/ExternalResourceCheck.java Thu Mar 15 10:17:12 2012
@@ -26,9 +26,7 @@ import java.lang.annotation.Target;
 import javax.validation.Constraint;
 import javax.validation.Payload;
 
-@Target({
-    ElementType.TYPE
-})
+@Target( { ElementType.TYPE })
 @Retention(RetentionPolicy.RUNTIME)
 @Constraint(validatedBy = ExternalResourceValidator.class)
 @Documented

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/ExternalResourceValidator.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/ExternalResourceValidator.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/ExternalResourceValidator.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/ExternalResourceValidator.java Thu Mar 15 10:17:12 2012
@@ -24,16 +24,15 @@ import org.syncope.core.persistence.bean
 import org.syncope.core.persistence.beans.ExternalResource;
 import org.syncope.types.EntityViolationType;
 
-public class ExternalResourceValidator extends AbstractValidator
-        implements ConstraintValidator<ExternalResourceCheck, ExternalResource> {
+public class ExternalResourceValidator extends AbstractValidator implements
+        ConstraintValidator<ExternalResourceCheck, ExternalResource> {
 
     @Override
     public void initialize(final ExternalResourceCheck constraintAnnotation) {
     }
 
     @Override
-    public boolean isValid(final ExternalResource object,
-            final ConstraintValidatorContext context) {
+    public boolean isValid(final ExternalResource object, final ConstraintValidatorContext context) {
 
         boolean isValid;
 
@@ -49,14 +48,11 @@ public class ExternalResourceValidator e
             isValid = accountIds == 1;
 
             if (!isValid) {
-                LOG.error("Mappings for " + object
-                        + " have 0 or >1 account ids");
+                LOG.error("Mappings for " + object + " have 0 or >1 account ids");
 
                 context.disableDefaultConstraintViolation();
-                context.buildConstraintViolationWithTemplate(
-                        EntityViolationType.InvalidAccountIdCount.toString()).
-                        addNode(object + ".accountIds.size==" + accountIds).
-                        addConstraintViolation();
+                context.buildConstraintViolationWithTemplate(EntityViolationType.InvalidAccountIdCount.toString())
+                        .addNode(object + ".accountIds.size==" + accountIds).addConstraintViolation();
             }
         }
 

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/InvalidEntityException.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/InvalidEntityException.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/InvalidEntityException.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/InvalidEntityException.java Thu Mar 15 10:17:12 2012
@@ -34,8 +34,7 @@ public class InvalidEntityException exte
 
     private final Map<Class, Set<EntityViolationType>> violations;
 
-    public InvalidEntityException(final String entityClassSimpleName,
-            final Set<ConstraintViolation<Object>> violations) {
+    public InvalidEntityException(final String entityClassSimpleName, final Set<ConstraintViolation<Object>> violations) {
 
         super();
 
@@ -45,24 +44,18 @@ public class InvalidEntityException exte
         EntityViolationType entityViolationType;
         for (ConstraintViolation<Object> violation : violations) {
             try {
-                entityViolationType = EntityViolationType.valueOf(
-                        violation.getMessageTemplate());
+                entityViolationType = EntityViolationType.valueOf(violation.getMessageTemplate());
             } catch (IllegalArgumentException e) {
                 entityViolationType = EntityViolationType.Standard;
-                entityViolationType.setMessageTemplate(
-                        violation.getPropertyPath() + ": "
-                        + violation.getMessage());
+                entityViolationType.setMessageTemplate(violation.getPropertyPath() + ": " + violation.getMessage());
             }
 
-            if (!this.violations.containsKey(
-                    violation.getLeafBean().getClass())) {
+            if (!this.violations.containsKey(violation.getLeafBean().getClass())) {
 
-                this.violations.put(violation.getLeafBean().getClass(),
-                        EnumSet.noneOf(EntityViolationType.class));
+                this.violations.put(violation.getLeafBean().getClass(), EnumSet.noneOf(EntityViolationType.class));
             }
 
-            this.violations.get(violation.getLeafBean().getClass()).
-                    add(entityViolationType);
+            this.violations.get(violation.getLeafBean().getClass()).add(entityViolationType);
         }
     }
 
@@ -90,9 +83,7 @@ public class InvalidEntityException exte
         StringBuilder sb = new StringBuilder();
 
         for (Class entity : violations.keySet()) {
-            sb.append(entity.getSimpleName()).append(" ").
-                    append(violations.get(entity).toString()).
-                    append(", ");
+            sb.append(entity.getSimpleName()).append(" ").append(violations.get(entity).toString()).append(", ");
         }
         sb.delete(sb.lastIndexOf(", "), sb.length());
 

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/NotificationCheck.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/NotificationCheck.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/NotificationCheck.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/NotificationCheck.java Thu Mar 15 10:17:12 2012
@@ -26,9 +26,7 @@ import java.lang.annotation.Target;
 import javax.validation.Constraint;
 import javax.validation.Payload;
 
-@Target({
-    ElementType.TYPE
-})
+@Target( { ElementType.TYPE })
 @Retention(RetentionPolicy.RUNTIME)
 @Constraint(validatedBy = NotificationValidator.class)
 @Documented

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/NotificationValidator.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/NotificationValidator.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/NotificationValidator.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/NotificationValidator.java Thu Mar 15 10:17:12 2012
@@ -23,17 +23,15 @@ import javax.validation.ConstraintValida
 import org.syncope.core.persistence.beans.Notification;
 import org.syncope.types.EntityViolationType;
 
-public class NotificationValidator extends AbstractValidator
-        implements ConstraintValidator<NotificationCheck, Notification> {
+public class NotificationValidator extends AbstractValidator implements
+        ConstraintValidator<NotificationCheck, Notification> {
 
     @Override
     public void initialize(final NotificationCheck constraintAnnotation) {
     }
 
     @Override
-    public boolean isValid(
-            final Notification value,
-            final ConstraintValidatorContext context) {
+    public boolean isValid(final Notification value, final ConstraintValidatorContext context) {
 
         context.disableDefaultConstraintViolation();
 
@@ -43,24 +41,19 @@ public class NotificationValidator exten
             isValid = false;
 
             context.buildConstraintViolationWithTemplate("No events").addNode(
-                    EntityViolationType.InvalidNotification.toString()).
-                    addNode("events").addConstraintViolation();
+                    EntityViolationType.InvalidNotification.toString()).addNode("events").addConstraintViolation();
         }
         if (!value.getAbout().checkValidity()) {
             isValid = false;
 
-            context.buildConstraintViolationWithTemplate(
-                    "Invalid about search condition").addNode(
-                    EntityViolationType.InvalidNotification.toString()).
-                    addNode("about").addConstraintViolation();
+            context.buildConstraintViolationWithTemplate("Invalid about search condition").addNode(
+                    EntityViolationType.InvalidNotification.toString()).addNode("about").addConstraintViolation();
         }
         if (!value.getRecipients().checkValidity()) {
             isValid = false;
 
-            context.buildConstraintViolationWithTemplate(
-                    "Invalid recipients search condition").addNode(
-                    EntityViolationType.InvalidNotification.toString()).
-                    addNode("recipients").addConstraintViolation();
+            context.buildConstraintViolationWithTemplate("Invalid recipients search condition").addNode(
+                    EntityViolationType.InvalidNotification.toString()).addNode("recipients").addConstraintViolation();
         }
 
         return isValid;

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/PolicyCheck.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/PolicyCheck.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/PolicyCheck.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/PolicyCheck.java Thu Mar 15 10:17:12 2012
@@ -26,9 +26,7 @@ import java.lang.annotation.Target;
 import javax.validation.Constraint;
 import javax.validation.Payload;
 
-@Target({
-    ElementType.TYPE
-})
+@Target( { ElementType.TYPE })
 @Retention(RetentionPolicy.RUNTIME)
 @Constraint(validatedBy = PolicyValidator.class)
 @Documented

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/PolicyValidator.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/PolicyValidator.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/PolicyValidator.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/PolicyValidator.java Thu Mar 15 10:17:12 2012
@@ -31,8 +31,7 @@ import org.syncope.types.EntityViolation
 import org.syncope.types.PasswordPolicySpec;
 import org.syncope.types.SyncPolicySpec;
 
-public class PolicyValidator extends AbstractValidator
-        implements ConstraintValidator<PolicyCheck, Policy> {
+public class PolicyValidator extends AbstractValidator implements ConstraintValidator<PolicyCheck, Policy> {
 
     @Autowired
     private PolicyDAO policyDAO;
@@ -42,43 +41,32 @@ public class PolicyValidator extends Abs
     }
 
     @Override
-    public boolean isValid(
-            final Policy object,
-            final ConstraintValidatorContext context) {
+    public boolean isValid(final Policy object, final ConstraintValidatorContext context) {
 
         context.disableDefaultConstraintViolation();
 
         if (object.getSpecification() != null
-                && ((object instanceof PasswordPolicy
-                && !(object.getSpecification() instanceof PasswordPolicySpec))
-                || ((object instanceof AccountPolicy
-                && !(object.getSpecification() instanceof AccountPolicySpec)))
-                || ((object instanceof SyncPolicy
-                && !(object.getSpecification() instanceof SyncPolicySpec))))) {
-
-            context.buildConstraintViolationWithTemplate(
-                    "Invalid policy specification").
-                    addNode(EntityViolationType.valueOf(
-                    "Invalid" + object.getClass().getSimpleName()).name()).
-                    addConstraintViolation();
+                && ((object instanceof PasswordPolicy && !(object.getSpecification() instanceof PasswordPolicySpec))
+                        || ((object instanceof AccountPolicy && !(object.getSpecification() instanceof AccountPolicySpec))) || ((object instanceof SyncPolicy && !(object
+                        .getSpecification() instanceof SyncPolicySpec))))) {
+
+            context.buildConstraintViolationWithTemplate("Invalid policy specification").addNode(
+                    EntityViolationType.valueOf("Invalid" + object.getClass().getSimpleName()).name())
+                    .addConstraintViolation();
 
             return false;
         }
 
         switch (object.getType()) {
             case GLOBAL_PASSWORD:
-                
+
                 // just one GLOBAL_PASSWORD policy
-                final PasswordPolicy passwordPolicy =
-                        policyDAO.getGlobalPasswordPolicy();
+                final PasswordPolicy passwordPolicy = policyDAO.getGlobalPasswordPolicy();
 
-                if (passwordPolicy != null
-                        && !passwordPolicy.getId().equals(object.getId())) {
+                if (passwordPolicy != null && !passwordPolicy.getId().equals(object.getId())) {
 
-                    context.buildConstraintViolationWithTemplate(
-                            "Password policy already exists").addNode(
-                            EntityViolationType.InvalidPasswordPolicy.name()).
-                            addConstraintViolation();
+                    context.buildConstraintViolationWithTemplate("Password policy already exists").addNode(
+                            EntityViolationType.InvalidPasswordPolicy.name()).addConstraintViolation();
 
                     return false;
                 }
@@ -90,16 +78,12 @@ public class PolicyValidator extends Abs
             case GLOBAL_ACCOUNT:
 
                 // just one GLOBAL_ACCOUNT policy
-                final AccountPolicy accountPolicy =
-                        policyDAO.getGlobalAccountPolicy();
+                final AccountPolicy accountPolicy = policyDAO.getGlobalAccountPolicy();
 
-                if (accountPolicy != null
-                        && !accountPolicy.getId().equals(object.getId())) {
+                if (accountPolicy != null && !accountPolicy.getId().equals(object.getId())) {
 
-                    context.buildConstraintViolationWithTemplate(
-                            "Global Account policy already exists").addNode(
-                            EntityViolationType.InvalidAccountPolicy.name()).
-                            addConstraintViolation();
+                    context.buildConstraintViolationWithTemplate("Global Account policy already exists").addNode(
+                            EntityViolationType.InvalidAccountPolicy.name()).addConstraintViolation();
 
                     return false;
                 }
@@ -111,16 +95,12 @@ public class PolicyValidator extends Abs
             case GLOBAL_SYNC:
 
                 // just one GLOBAL_SYNC policy
-                final SyncPolicy syncPolicy =
-                        policyDAO.getGlobalSyncPolicy();
+                final SyncPolicy syncPolicy = policyDAO.getGlobalSyncPolicy();
 
-                if (syncPolicy != null
-                        && !syncPolicy.getId().equals(object.getId())) {
+                if (syncPolicy != null && !syncPolicy.getId().equals(object.getId())) {
 
-                    context.buildConstraintViolationWithTemplate(
-                            "Global Sync policy already exists").addNode(
-                            EntityViolationType.InvalidSyncPolicy.name()).
-                            addConstraintViolation();
+                    context.buildConstraintViolationWithTemplate("Global Sync policy already exists").addNode(
+                            EntityViolationType.InvalidSyncPolicy.name()).addConstraintViolation();
 
                     return false;
                 }

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/PropagationTaskCheck.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/PropagationTaskCheck.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/PropagationTaskCheck.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/PropagationTaskCheck.java Thu Mar 15 10:17:12 2012
@@ -26,9 +26,7 @@ import java.lang.annotation.Target;
 import javax.validation.Constraint;
 import javax.validation.Payload;
 
-@Target({
-    ElementType.TYPE
-})
+@Target( { ElementType.TYPE })
 @Retention(RetentionPolicy.RUNTIME)
 @Constraint(validatedBy = PropagationTaskValidator.class)
 @Documented

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/PropagationTaskValidator.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/PropagationTaskValidator.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/PropagationTaskValidator.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/PropagationTaskValidator.java Thu Mar 15 10:17:12 2012
@@ -27,16 +27,15 @@ import org.syncope.types.EntityViolation
 import org.syncope.types.PropagationOperation;
 import org.syncope.types.PropagationTaskExecStatus;
 
-public class PropagationTaskValidator extends AbstractValidator
-        implements ConstraintValidator<PropagationTaskCheck, PropagationTask> {
+public class PropagationTaskValidator extends AbstractValidator implements
+        ConstraintValidator<PropagationTaskCheck, PropagationTask> {
 
     @Override
     public void initialize(final PropagationTaskCheck constraintAnnotation) {
     }
 
     @Override
-    public boolean isValid(final PropagationTask object,
-            final ConstraintValidatorContext context) {
+    public boolean isValid(final PropagationTask object, final ConstraintValidatorContext context) {
 
         boolean isValid;
 
@@ -47,19 +46,15 @@ public class PropagationTaskValidator ex
                     && object.getPropagationOperation() != null
                     && !object.getAttributes().isEmpty()
                     && object.getResource() != null
-                    && (PropagationOperation.DELETE == object.
-                    getPropagationOperation()
-                    || object.getSyncopeUser() != null);
+                    && (PropagationOperation.DELETE == object.getPropagationOperation() || object.getSyncopeUser() != null);
 
             if (isValid) {
                 List<TaskExec> executions = object.getExecs();
                 for (TaskExec execution : executions) {
                     try {
-                        PropagationTaskExecStatus.valueOf(
-                                execution.getStatus());
+                        PropagationTaskExecStatus.valueOf(execution.getStatus());
                     } catch (IllegalArgumentException e) {
-                        LOG.error("Invalid execution status '"
-                                + execution.getStatus() + "'", e);
+                        LOG.error("Invalid execution status '" + execution.getStatus() + "'", e);
                         isValid = false;
                     }
                 }
@@ -67,9 +62,8 @@ public class PropagationTaskValidator ex
 
             if (!isValid) {
                 context.disableDefaultConstraintViolation();
-                context.buildConstraintViolationWithTemplate(
-                        EntityViolationType.InvalidPropagationTask.toString()).
-                        addConstraintViolation();
+                context.buildConstraintViolationWithTemplate(EntityViolationType.InvalidPropagationTask.toString())
+                        .addConstraintViolation();
             }
         }
 

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/ReportCheck.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/ReportCheck.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/ReportCheck.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/ReportCheck.java Thu Mar 15 10:17:12 2012
@@ -26,9 +26,7 @@ import java.lang.annotation.Target;
 import javax.validation.Constraint;
 import javax.validation.Payload;
 
-@Target({
-    ElementType.TYPE
-})
+@Target( { ElementType.TYPE })
 @Retention(RetentionPolicy.RUNTIME)
 @Constraint(validatedBy = ReportValidator.class)
 @Documented

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/ReportValidator.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/ReportValidator.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/ReportValidator.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/ReportValidator.java Thu Mar 15 10:17:12 2012
@@ -28,8 +28,7 @@ import org.syncope.client.report.Reportl
 import org.syncope.core.persistence.beans.Report;
 import org.syncope.types.EntityViolationType;
 
-public class ReportValidator extends AbstractValidator
-        implements ConstraintValidator<ReportCheck, Report> {
+public class ReportValidator extends AbstractValidator implements ConstraintValidator<ReportCheck, Report> {
 
     @Override
     public void initialize(final ReportCheck constraintAnnotation) {
@@ -37,8 +36,7 @@ public class ReportValidator extends Abs
 
     @Override
     @SuppressWarnings("ResultOfObjectAllocationIgnored")
-    public boolean isValid(final Report object,
-            final ConstraintValidatorContext context) {
+    public boolean isValid(final Report object, final ConstraintValidatorContext context) {
 
         boolean isValid = true;
 
@@ -46,14 +44,12 @@ public class ReportValidator extends Abs
             try {
                 new CronExpression(object.getCronExpression());
             } catch (ParseException e) {
-                LOG.error("Invalid cron expression '"
-                        + object.getCronExpression() + "'", e);
+                LOG.error("Invalid cron expression '" + object.getCronExpression() + "'", e);
                 isValid = false;
 
                 context.disableDefaultConstraintViolation();
-                context.buildConstraintViolationWithTemplate(EntityViolationType.InvalidReport.name()).
-                        addNode(object + ".cronExpression==" + object.getCronExpression()).
-                        addConstraintViolation();
+                context.buildConstraintViolationWithTemplate(EntityViolationType.InvalidReport.name()).addNode(
+                        object + ".cronExpression==" + object.getCronExpression()).addConstraintViolation();
             }
         }
 
@@ -66,9 +62,8 @@ public class ReportValidator extends Abs
             isValid = false;
 
             context.disableDefaultConstraintViolation();
-            context.buildConstraintViolationWithTemplate(EntityViolationType.InvalidReport.name()).
-                    addNode(object + ".reportletConfs with duplicate names").
-                    addConstraintViolation();
+            context.buildConstraintViolationWithTemplate(EntityViolationType.InvalidReport.name()).addNode(
+                    object + ".reportletConfs with duplicate names").addConstraintViolation();
         }
 
         return isValid;

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/SchedTaskCheck.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/SchedTaskCheck.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/SchedTaskCheck.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/SchedTaskCheck.java Thu Mar 15 10:17:12 2012
@@ -26,9 +26,7 @@ import java.lang.annotation.Target;
 import javax.validation.Constraint;
 import javax.validation.Payload;
 
-@Target({
-    ElementType.TYPE
-})
+@Target( { ElementType.TYPE })
 @Retention(RetentionPolicy.RUNTIME)
 @Constraint(validatedBy = SchedTaskValidator.class)
 @Documented

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/SchedTaskValidator.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/SchedTaskValidator.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/SchedTaskValidator.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/SchedTaskValidator.java Thu Mar 15 10:17:12 2012
@@ -26,16 +26,14 @@ import org.syncope.core.persistence.bean
 import org.syncope.core.scheduling.AbstractTaskJob;
 import org.syncope.types.EntityViolationType;
 
-public class SchedTaskValidator extends AbstractValidator
-        implements ConstraintValidator<SchedTaskCheck, SchedTask> {
+public class SchedTaskValidator extends AbstractValidator implements ConstraintValidator<SchedTaskCheck, SchedTask> {
 
     @Override
     public void initialize(final SchedTaskCheck constraintAnnotation) {
     }
 
     @Override
-    public boolean isValid(final SchedTask object,
-            final ConstraintValidatorContext context) {
+    public boolean isValid(final SchedTask object, final ConstraintValidatorContext context) {
 
         boolean isValid = true;
 
@@ -51,27 +49,20 @@ public class SchedTaskValidator extends 
             isValid = false;
 
             context.disableDefaultConstraintViolation();
-            context.buildConstraintViolationWithTemplate(
-                    EntityViolationType.InvalidSchedTask.toString()).
-                    addNode(object
-                    + ".jobClassName is not valid").
-                    addConstraintViolation();
+            context.buildConstraintViolationWithTemplate(EntityViolationType.InvalidSchedTask.toString()).addNode(
+                    object + ".jobClassName is not valid").addConstraintViolation();
         }
 
         if (isValid && object.getCronExpression() != null) {
             try {
                 new CronExpression(object.getCronExpression());
             } catch (ParseException e) {
-                LOG.error("Invalid cron expression '"
-                        + object.getCronExpression() + "'", e);
+                LOG.error("Invalid cron expression '" + object.getCronExpression() + "'", e);
                 isValid = false;
 
                 context.disableDefaultConstraintViolation();
-                context.buildConstraintViolationWithTemplate(
-                        EntityViolationType.InvalidSchedTask.toString()).
-                        addNode(object + ".cronExpression=="
-                        + object.getCronExpression()).
-                        addConstraintViolation();
+                context.buildConstraintViolationWithTemplate(EntityViolationType.InvalidSchedTask.toString()).addNode(
+                        object + ".cronExpression==" + object.getCronExpression()).addConstraintViolation();
             }
         }
 

Modified: incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/SchemaCheck.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/SchemaCheck.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/SchemaCheck.java (original)
+++ incubator/syncope/trunk/core/src/main/java/org/syncope/core/persistence/validation/entity/SchemaCheck.java Thu Mar 15 10:17:12 2012
@@ -26,9 +26,7 @@ import java.lang.annotation.Target;
 import javax.validation.Constraint;
 import javax.validation.Payload;
 
-@Target({
-    ElementType.TYPE
-})
+@Target( { ElementType.TYPE })
 @Retention(RetentionPolicy.RUNTIME)
 @Constraint(validatedBy = SchemaValidator.class)
 @Documented



Mime
View raw message