syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [40/43] syncope git commit: Removing JAXB in favor of jackson-dataformat-xml: currently the only missing part is XSD in WADL
Date Wed, 20 Jul 2016 14:58:34 GMT
http://git-wip-us.apache.org/repos/asf/syncope/blob/480387d6/core/rest-cxf/pom.xml
----------------------------------------------------------------------
diff --git a/core/rest-cxf/pom.xml b/core/rest-cxf/pom.xml
index cb4da8a..6230abe 100644
--- a/core/rest-cxf/pom.xml
+++ b/core/rest-cxf/pom.xml
@@ -71,14 +71,14 @@ under the License.
     </dependency>
     
     <dependency>
-      <groupId>com.fasterxml.jackson.datatype</groupId>
-      <artifactId>jackson-datatype-joda</artifactId>
-    </dependency>    
-    <dependency>
       <groupId>com.fasterxml.jackson.jaxrs</groupId>
       <artifactId>jackson-jaxrs-json-provider</artifactId>
     </dependency>
     <dependency>
+      <groupId>com.fasterxml.jackson.jaxrs</groupId>
+      <artifactId>jackson-jaxrs-xml-provider</artifactId>
+    </dependency>
+    <dependency>
       <groupId>com.fasterxml.jackson.module</groupId>
       <artifactId>jackson-module-afterburner</artifactId>
     </dependency>

http://git-wip-us.apache.org/repos/asf/syncope/blob/480387d6/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/JacksonXMLProvider.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/JacksonXMLProvider.java
b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/JacksonXMLProvider.java
new file mode 100644
index 0000000..9e469d1
--- /dev/null
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/JacksonXMLProvider.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.rest.cxf;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Produces;
+import javax.ws.rs.ext.Provider;
+
+/**
+ * Extends {@link com.fasterxml.jackson.jaxrs.xml.JacksonXMLProvider} only for setting correct
{@link Produces} and
+ * {link Consumes} annotations for usage with Apache CXF.
+ */
+@Produces({ "application/xml", "application/*+xml", "text/xml" })
+@Consumes({ "application/xml", "application/*+xml", "text/xml" })
+@Provider
+public class JacksonXMLProvider extends com.fasterxml.jackson.jaxrs.xml.JacksonXMLProvider
{
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/480387d6/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/UnwrappedObjectMapper.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/UnwrappedObjectMapper.java
b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/UnwrappedObjectMapper.java
deleted file mode 100644
index 31b1dfd..0000000
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/UnwrappedObjectMapper.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.core.rest.cxf;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.datatype.joda.JodaModule;
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.util.Map;
-
-/**
- * Jackson ObjectMapper that unwraps singleton map values and enable default
- * typing for handling abstract types serialization.
- */
-public class UnwrappedObjectMapper extends ObjectMapper {
-
-    private static final long serialVersionUID = -317191546835195103L;
-
-    public UnwrappedObjectMapper() {
-        super();
-
-        registerModule(new JodaModule());
-        configure(com.fasterxml.jackson.databind.SerializationFeature.WRITE_DATES_AS_TIMESTAMPS,
false);
-    }
-
-    /**
-     * Unwraps the given value if it implements the Map interface and contains only a single
entry, otherwise the
-     * value is returned unmodified.
-     *
-     * @param value the potential Map to unwrap
-     * @return the unwrapped map or the original value
-     */
-    private Object unwrapMap(final Object value) {
-        if (value instanceof Map) {
-            Map<?, ?> map = (Map<?, ?>) value;
-            if (map.size() == 1) {
-                return map.values().iterator().next();
-            }
-        }
-
-        return value;
-    }
-
-    @Override
-    public void writeValue(final JsonGenerator jgen, final Object value) throws IOException
{
-        super.writeValue(jgen, unwrapMap(value));
-    }
-
-    @Override
-    public void writeValue(final File resultFile, final Object value) throws IOException
{
-        super.writeValue(resultFile, unwrapMap(value));
-    }
-
-    @Override
-    public void writeValue(final OutputStream out, final Object value) throws IOException
{
-        super.writeValue(out, unwrapMap(value));
-    }
-
-    @Override
-    public void writeValue(final Writer writer, final Object value) throws IOException {
-        super.writeValue(writer, unwrapMap(value));
-    }
-
-    @Override
-    public byte[] writeValueAsBytes(final Object value) throws JsonProcessingException {
-        return super.writeValueAsBytes(unwrapMap(value));
-    }
-
-    @Override
-    public String writeValueAsString(final Object value) throws JsonProcessingException {
-        return super.writeValueAsString(unwrapMap(value));
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/480387d6/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/AbstractAnyService.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/AbstractAnyService.java
b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/AbstractAnyService.java
index 7a19af1..020cf57 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/AbstractAnyService.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/AbstractAnyService.java
@@ -247,14 +247,14 @@ public abstract class AbstractAnyService<TO extends AnyTO, P extends
AnyPatch>
 
         if (patch.getAction() == ResourceDeassociationAction.UNLINK) {
             for (String resource : patch.getResources()) {
-                result.getResults().put(resource,
+                result.add(resource,
                         updated.getEntity().getResources().contains(resource)
                         ? BulkActionResult.Status.FAILURE
                         : BulkActionResult.Status.SUCCESS);
             }
         } else {
             for (PropagationStatus propagationStatusTO : updated.getPropagationStatuses())
{
-                result.getResults().put(propagationStatusTO.getResource(),
+                result.add(propagationStatusTO.getResource(),
                         BulkActionResult.Status.valueOf(propagationStatusTO.getStatus().toString()));
             }
         }
@@ -304,14 +304,14 @@ public abstract class AbstractAnyService<TO extends AnyTO, P extends
AnyPatch>
 
         if (patch.getAction() == ResourceAssociationAction.LINK) {
             for (String resource : patch.getResources()) {
-                result.getResults().put(resource,
+                result.add(resource,
                         updated.getEntity().getResources().contains(resource)
                         ? BulkActionResult.Status.SUCCESS
                         : BulkActionResult.Status.FAILURE);
             }
         } else {
             for (PropagationStatus propagationStatusTO : updated.getPropagationStatuses())
{
-                result.getResults().put(propagationStatusTO.getResource(),
+                result.add(propagationStatusTO.getResource(),
                         BulkActionResult.Status.valueOf(propagationStatusTO.getStatus().toString()));
             }
         }
@@ -334,12 +334,12 @@ public abstract class AbstractAnyService<TO extends AnyTO, P extends
AnyPatch>
                             userPatch.setKey(key);
                             userPatch.setMustChangePassword(new BooleanReplacePatchItem.Builder().value(true).build());
 
-                            result.getResults().put(
+                            result.add(
                                     ((UserLogic) logic).update(userPatch, false).getEntity().getKey(),
                                     BulkActionResult.Status.SUCCESS);
                         } catch (Exception e) {
                             LOG.error("Error performing delete for user {}", key, e);
-                            result.getResults().put(key, BulkActionResult.Status.FAILURE);
+                            result.add(key, BulkActionResult.Status.FAILURE);
                         }
                     }
                 } else {
@@ -350,12 +350,12 @@ public abstract class AbstractAnyService<TO extends AnyTO, P extends
AnyPatch>
             case DELETE:
                 for (String key : bulkAction.getTargets()) {
                     try {
-                        result.getResults().put(
+                        result.add(
                                 logic.delete(key, isNullPriorityAsync()).getEntity().getKey(),
                                 BulkActionResult.Status.SUCCESS);
                     } catch (Exception e) {
                         LOG.error("Error performing delete for user {}", key, e);
-                        result.getResults().put(key, BulkActionResult.Status.FAILURE);
+                        result.add(key, BulkActionResult.Status.FAILURE);
                     }
                 }
                 break;
@@ -369,13 +369,13 @@ public abstract class AbstractAnyService<TO extends AnyTO, P extends
AnyPatch>
                         statusPatch.setOnSyncope(true);
 
                         try {
-                            result.getResults().put(
+                            result.add(
                                     ((UserLogic) logic).
                                     status(statusPatch, isNullPriorityAsync()).getEntity().getKey(),
                                     BulkActionResult.Status.SUCCESS);
                         } catch (Exception e) {
                             LOG.error("Error performing suspend for user {}", key, e);
-                            result.getResults().put(key, BulkActionResult.Status.FAILURE);
+                            result.add(key, BulkActionResult.Status.FAILURE);
                         }
                     }
                 } else {
@@ -392,13 +392,13 @@ public abstract class AbstractAnyService<TO extends AnyTO, P extends
AnyPatch>
                         statusPatch.setOnSyncope(true);
 
                         try {
-                            result.getResults().put(
+                            result.add(
                                     ((UserLogic) logic).
                                     status(statusPatch, isNullPriorityAsync()).getEntity().getKey(),
                                     BulkActionResult.Status.SUCCESS);
                         } catch (Exception e) {
                             LOG.error("Error performing reactivate for user {}", key, e);
-                            result.getResults().put(key, BulkActionResult.Status.FAILURE);
+                            result.add(key, BulkActionResult.Status.FAILURE);
                         }
                     }
                 } else {

http://git-wip-us.apache.org/repos/asf/syncope/blob/480387d6/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ConnectorServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ConnectorServiceImpl.java
b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ConnectorServiceImpl.java
index a5ebee1..5fc1902 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ConnectorServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ConnectorServiceImpl.java
@@ -101,10 +101,10 @@ public class ConnectorServiceImpl extends AbstractServiceImpl implements
Connect
         if (bulkAction.getType() == BulkAction.Type.DELETE) {
             for (String key : bulkAction.getTargets()) {
                 try {
-                    result.getResults().put(logic.delete(key).getKey(), BulkActionResult.Status.SUCCESS);
+                    result.add(logic.delete(key).getKey(), BulkActionResult.Status.SUCCESS);
                 } catch (Exception e) {
                     LOG.error("Error performing delete for connector {}", key, e);
-                    result.getResults().put(key, BulkActionResult.Status.FAILURE);
+                    result.add(key, BulkActionResult.Status.FAILURE);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/480387d6/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceServiceImpl.java
b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceServiceImpl.java
index 2bfba5a..9b32caa 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/ResourceServiceImpl.java
@@ -172,10 +172,10 @@ public class ResourceServiceImpl extends AbstractServiceImpl implements
Resource
                     default:
                 }
 
-                result.getResults().put(anyKey, BulkActionResult.Status.SUCCESS);
+                result.add(anyKey, BulkActionResult.Status.SUCCESS);
             } catch (Exception e) {
                 LOG.warn("While executing {} on {} {}", patch.getAction(), patch.getAnyTypeKey(),
anyKey, e);
-                result.getResults().put(anyKey, BulkActionResult.Status.FAILURE);
+                result.add(anyKey, BulkActionResult.Status.FAILURE);
             }
         }
 
@@ -189,10 +189,10 @@ public class ResourceServiceImpl extends AbstractServiceImpl implements
Resource
         if (bulkAction.getType() == BulkAction.Type.DELETE) {
             for (String key : bulkAction.getTargets()) {
                 try {
-                    result.getResults().put(logic.delete(key).getKey(), BulkActionResult.Status.SUCCESS);
+                    result.add(logic.delete(key).getKey(), BulkActionResult.Status.SUCCESS);
                 } catch (Exception e) {
                     LOG.error("Error performing delete for resource {}", key, e);
-                    result.getResults().put(key, BulkActionResult.Status.FAILURE);
+                    result.add(key, BulkActionResult.Status.FAILURE);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/480387d6/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
index 2dd64dd..32618b7 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
@@ -113,10 +113,10 @@ public class TaskServiceImpl extends AbstractExecutableService implements
TaskSe
             case DELETE:
                 for (String key : bulkAction.getTargets()) {
                     try {
-                        result.getResults().put(logic.delete(key).getKey(), BulkActionResult.Status.SUCCESS);
+                        result.add(logic.delete(key).getKey(), BulkActionResult.Status.SUCCESS);
                     } catch (Exception e) {
                         LOG.error("Error performing delete for task {}", key, e);
-                        result.getResults().put(key, BulkActionResult.Status.FAILURE);
+                        result.add(key, BulkActionResult.Status.FAILURE);
                     }
                 }
                 break;
@@ -125,10 +125,10 @@ public class TaskServiceImpl extends AbstractExecutableService implements
TaskSe
                 for (String key : bulkAction.getTargets()) {
                     try {
                         logic.execute(key, null, true);
-                        result.getResults().put(key, BulkActionResult.Status.SUCCESS);
+                        result.add(key, BulkActionResult.Status.SUCCESS);
                     } catch (Exception e) {
                         LOG.error("Error performing dryrun for task {}", key, e);
-                        result.getResults().put(key, BulkActionResult.Status.FAILURE);
+                        result.add(key, BulkActionResult.Status.FAILURE);
                     }
                 }
                 break;
@@ -137,10 +137,10 @@ public class TaskServiceImpl extends AbstractExecutableService implements
TaskSe
                 for (String key : bulkAction.getTargets()) {
                     try {
                         logic.execute(key, null, false);
-                        result.getResults().put(key, BulkActionResult.Status.SUCCESS);
+                        result.add(key, BulkActionResult.Status.SUCCESS);
                     } catch (Exception e) {
                         LOG.error("Error performing execute for task {}", key, e);
-                        result.getResults().put(key, BulkActionResult.Status.FAILURE);
+                        result.add(key, BulkActionResult.Status.FAILURE);
                     }
                 }
                 break;

http://git-wip-us.apache.org/repos/asf/syncope/blob/480387d6/core/rest-cxf/src/main/resources/restCXFContext.xml
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/resources/restCXFContext.xml b/core/rest-cxf/src/main/resources/restCXFContext.xml
index f7714a1..df3716d 100644
--- a/core/rest-cxf/src/main/resources/restCXFContext.xml
+++ b/core/rest-cxf/src/main/resources/restCXFContext.xml
@@ -36,35 +36,15 @@ under the License.
 
   <context:component-scan base-package="org.apache.syncope.core.rest.cxf.service"/>
 
 
-  <bean id="jaxbProvider" class="org.apache.cxf.jaxrs.provider.JAXBElementProvider">
-    <property name="namespacePrefixes">
-      <map>
-        <entry key="http://syncope.apache.org/2.0">
-          <value>syncope</value>
-        </entry>
-      </map>      
-    </property>
-    <property name="depthProperties">
-      <bean id="depthProperties" class="org.apache.cxf.staxutils.DocumentDepthProperties">
-        <property name="innerElementCountThreshold" value="500"/>
-      </bean>
-    </property>
-    <property name="collectionWrapperMap">
-      <map>
-        <entry>
-          <key>
-            <value>org.apache.syncope.common.lib.policy.AbstractPolicyTO</value>
-          </key>
-          <value>policies</value>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
   <bean id="dateParamConverterProvider" class="org.apache.syncope.common.rest.api.DateParamConverterProvider"/>
 
-  <bean id="jacksonObjectMapper" class="org.apache.syncope.core.rest.cxf.UnwrappedObjectMapper"/>
-  <bean id="jsonProvider" class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider">
+  <bean id="jacksonXmlMapper" class="org.apache.syncope.common.lib.jackson.UnwrappedXmlMapper"/>
+  <bean id="xmlProvider" class="org.apache.syncope.core.rest.cxf.JacksonXMLProvider">
+    <property name="mapper" ref="jacksonXmlMapper"/>
+  </bean>
+
+  <bean id="jacksonObjectMapper" class="org.apache.syncope.common.lib.jackson.UnwrappedObjectMapper"/>
+  <bean id="jsonProvider" class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider">
     <property name="mapper" ref="jacksonObjectMapper"/>
   </bean>
 
@@ -91,9 +71,8 @@ under the License.
   
   <bean id="wadlGenerator" class="org.apache.syncope.core.rest.cxf.WadlGenerator">
     <property name="applicationTitle" value="Apache Syncope ${syncope.version}"/>
-    <property name="namespacePrefix" value="syncope"/>
     <property name="linkAnyMediaTypeToXmlSchema" value="true"/>
-    <property name="useJaxbContextForQnames" value="true"/>
+    <property name="useJaxbContextForQnames" value="false"/>
     <property name="addResourceAndMethodIds" value="true"/>
     <property name="ignoreMessageWriters" value="true"/>
     <property name="usePathParamsToCompareOperations" value="false"/>
@@ -130,7 +109,7 @@ under the License.
     </jaxrs:outInterceptors>
     <jaxrs:providers>
       <ref bean="dateParamConverterProvider"/>
-      <ref bean="jaxbProvider"/>
+      <ref bean="xmlProvider"/>
       <ref bean="jsonProvider"/>
       <ref bean="exceptionMapper"/>
       <ref bean="searchContextProvider"/>

http://git-wip-us.apache.org/repos/asf/syncope/blob/480387d6/ext/camel/common-lib/src/main/java/org/apache/syncope/common/lib/to/CamelMetrics.java
----------------------------------------------------------------------
diff --git a/ext/camel/common-lib/src/main/java/org/apache/syncope/common/lib/to/CamelMetrics.java
b/ext/camel/common-lib/src/main/java/org/apache/syncope/common/lib/to/CamelMetrics.java
index 050c63c..2d4df04 100644
--- a/ext/camel/common-lib/src/main/java/org/apache/syncope/common/lib/to/CamelMetrics.java
+++ b/ext/camel/common-lib/src/main/java/org/apache/syncope/common/lib/to/CamelMetrics.java
@@ -18,23 +18,14 @@
  */
 package org.apache.syncope.common.lib.to;
 
-import com.fasterxml.jackson.annotation.JsonProperty;
 import java.util.ArrayList;
 import java.util.List;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
 import org.apache.syncope.common.lib.AbstractBaseBean;
 
-@XmlRootElement(name = "camelMetrics")
-@XmlType
 public class CamelMetrics extends AbstractBaseBean {
 
     private static final long serialVersionUID = -391404198406614231L;
 
-    @XmlRootElement(name = "meanRate")
-    @XmlType
     public static class MeanRate extends AbstractBaseBean {
 
         private static final long serialVersionUID = -233921226510124154L;
@@ -63,9 +54,6 @@ public class CamelMetrics extends AbstractBaseBean {
 
     private final List<MeanRate> responseMeanRates = new ArrayList<>();
 
-    @XmlElementWrapper(name = "responseMeanRates")
-    @XmlElement(name = "meanRate")
-    @JsonProperty("responseMeanRates")
     public List<MeanRate> getResponseMeanRates() {
         return responseMeanRates;
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/480387d6/ext/camel/common-lib/src/main/java/org/apache/syncope/common/lib/to/CamelRouteTO.java
----------------------------------------------------------------------
diff --git a/ext/camel/common-lib/src/main/java/org/apache/syncope/common/lib/to/CamelRouteTO.java
b/ext/camel/common-lib/src/main/java/org/apache/syncope/common/lib/to/CamelRouteTO.java
index cb64fb6..8c18403 100644
--- a/ext/camel/common-lib/src/main/java/org/apache/syncope/common/lib/to/CamelRouteTO.java
+++ b/ext/camel/common-lib/src/main/java/org/apache/syncope/common/lib/to/CamelRouteTO.java
@@ -19,13 +19,9 @@ package org.apache.syncope.common.lib.to;
  * under the License.
  */
 import javax.ws.rs.PathParam;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
 import org.apache.syncope.common.lib.AbstractBaseBean;
 import org.apache.syncope.common.lib.types.AnyTypeKind;
 
-@XmlRootElement(name = "camelRoute")
-@XmlType
 public class CamelRouteTO extends AbstractBaseBean {
 
     private static final long serialVersionUID = 6431992877435181674L;

http://git-wip-us.apache.org/repos/asf/syncope/blob/480387d6/fit/core-reference/src/main/resources/jboss/restCXFContext.xml
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/main/resources/jboss/restCXFContext.xml b/fit/core-reference/src/main/resources/jboss/restCXFContext.xml
index 2417c35..53483cb 100644
--- a/fit/core-reference/src/main/resources/jboss/restCXFContext.xml
+++ b/fit/core-reference/src/main/resources/jboss/restCXFContext.xml
@@ -36,35 +36,15 @@ under the License.
 
   <context:component-scan base-package="org.apache.syncope.core.rest.cxf.service"/>
 
 
-  <bean id="jaxbProvider" class="org.apache.cxf.jaxrs.provider.JAXBElementProvider">
-    <property name="namespacePrefixes">
-      <map>
-        <entry key="http://syncope.apache.org/2.0">
-          <value>syncope</value>
-        </entry>
-      </map>      
-    </property>
-    <property name="depthProperties">
-      <bean id="depthProperties" class="org.apache.cxf.staxutils.DocumentDepthProperties">
-        <property name="innerElementCountThreshold" value="500"/>
-      </bean>
-    </property>
-    <property name="collectionWrapperMap">
-      <map>
-        <entry>
-          <key>
-            <value>org.apache.syncope.common.lib.policy.AbstractPolicyTO</value>
-          </key>
-          <value>policies</value>
-        </entry>
-      </map>
-    </property>
-  </bean>
-
   <bean id="dateParamConverterProvider" class="org.apache.syncope.common.rest.api.DateParamConverterProvider"/>
 
-  <bean id="jacksonObjectMapper" class="org.apache.syncope.core.rest.cxf.UnwrappedObjectMapper"/>
-  <bean id="jsonProvider" class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider">
+  <bean id="jacksonXmlMapper" class="org.apache.syncope.common.lib.jackson.UnwrappedXmlMapper"/>
+  <bean id="xmlProvider" class="org.apache.syncope.core.rest.cxf.JacksonXMLProvider">
+    <property name="mapper" ref="jacksonXmlMapper"/>
+  </bean>
+
+  <bean id="jacksonObjectMapper" class="org.apache.syncope.common.lib.jackson.UnwrappedObjectMapper"/>
+  <bean id="jsonProvider" class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider">
     <property name="mapper" ref="jacksonObjectMapper"/>
   </bean>
 
@@ -91,9 +71,8 @@ under the License.
   
   <bean id="wadlGenerator" class="org.apache.syncope.core.rest.cxf.WadlGenerator">
     <property name="applicationTitle" value="Apache Syncope ${syncope.version}"/>
-    <property name="namespacePrefix" value="syncope"/>
     <property name="linkAnyMediaTypeToXmlSchema" value="true"/>
-    <property name="useJaxbContextForQnames" value="true"/>
+    <property name="useJaxbContextForQnames" value="false"/>
     <property name="addResourceAndMethodIds" value="true"/>
     <property name="ignoreMessageWriters" value="true"/>
     <property name="usePathParamsToCompareOperations" value="false"/>
@@ -109,7 +88,7 @@ under the License.
     <property name="title" value="Apache Syncope"/>
     <property name="version" value="${syncope.version}"/>
     <property name="description" value="Apache Syncope ${syncope.version}"/>    
-    <property name="contact" value="dev@syncope.apache.org"/>
+    <property name="contact" value="dev@syncope.apache.org"/>    
     
     <property name="resourcePackage" value="org.apache.syncope.common.rest.api.service"/>
     <property name="scanAllResources" value="true"/>
@@ -142,7 +121,7 @@ under the License.
     </jaxrs:outInterceptors>
     <jaxrs:providers>
       <ref bean="dateParamConverterProvider"/>
-      <ref bean="jaxbProvider"/>
+      <ref bean="xmlProvider"/>
       <ref bean="jsonProvider"/>
       <ref bean="exceptionMapper"/>
       <ref bean="searchContextProvider"/>

http://git-wip-us.apache.org/repos/asf/syncope/blob/480387d6/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportITCase.java
index 651e9bb..8d2f077 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportITCase.java
@@ -250,8 +250,8 @@ public class ReportITCase extends AbstractITCase {
         assertNotNull(result);
 
         assertEquals(1, result.getResults().size());
-        assertEquals(execKey, result.getResults().keySet().iterator().next());
-        assertEquals(BulkActionResult.Status.SUCCESS, result.getResults().entrySet().iterator().next().getValue());
+        assertEquals(execKey, result.getResultMap().keySet().iterator().next());
+        assertEquals(BulkActionResult.Status.SUCCESS, result.getResultMap().entrySet().iterator().next().getValue());
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/syncope/blob/480387d6/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
index febe081..88792cd 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
@@ -26,6 +26,7 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.security.AccessControlException;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
@@ -118,6 +119,18 @@ public class UserITCase extends AbstractITCase {
         return userTO;
     }
 
+    private List<String> getResultByStatus(final BulkActionResult bulkActionResult,
final Status status) {
+        List<String> result = new ArrayList<>();
+
+        for (Map.Entry<String, Status> entry : bulkActionResult.getResultMap().entrySet())
{
+            if (entry.getValue() == status) {
+                result.add(entry.getKey());
+            }
+        }
+
+        return Collections.unmodifiableList(result);
+    }
+
     @Test
     public void createUserWithNoPropagation() {
         // create a new user
@@ -1036,20 +1049,20 @@ public class UserITCase extends AbstractITCase {
 
         bulkAction.setType(BulkAction.Type.SUSPEND);
         BulkActionResult res = userService.bulk(bulkAction).readEntity(BulkActionResult.class);
-        assertEquals(10, res.getResultByStatus(Status.SUCCESS).size());
-        assertEquals(1, res.getResultByStatus(Status.FAILURE).size());
-        assertEquals("suspended", userService.read(res.getResultByStatus(Status.SUCCESS).get(3)).getStatus());
+        assertEquals(10, getResultByStatus(res, Status.SUCCESS).size());
+        assertEquals(1, getResultByStatus(res, Status.FAILURE).size());
+        assertEquals("suspended", userService.read(getResultByStatus(res, Status.SUCCESS).get(3)).getStatus());
 
         bulkAction.setType(BulkAction.Type.REACTIVATE);
         res = userService.bulk(bulkAction).readEntity(BulkActionResult.class);
-        assertEquals(10, res.getResultByStatus(Status.SUCCESS).size());
-        assertEquals(1, res.getResultByStatus(Status.FAILURE).size());
-        assertEquals("active", userService.read(res.getResultByStatus(Status.SUCCESS).get(3)).getStatus());
+        assertEquals(10, getResultByStatus(res, Status.SUCCESS).size());
+        assertEquals(1, getResultByStatus(res, Status.FAILURE).size());
+        assertEquals("active", userService.read(getResultByStatus(res, Status.SUCCESS).get(3)).getStatus());
 
         bulkAction.setType(BulkAction.Type.DELETE);
         res = userService.bulk(bulkAction).readEntity(BulkActionResult.class);
-        assertEquals(10, res.getResultByStatus(Status.SUCCESS).size());
-        assertEquals(1, res.getResultByStatus(Status.FAILURE).size());
+        assertEquals(10, getResultByStatus(res, Status.SUCCESS).size());
+        assertEquals(1, getResultByStatus(res, Status.FAILURE).size());
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/syncope/blob/480387d6/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index bce0ee7..06d3416 100644
--- a/pom.xml
+++ b/pom.xml
@@ -528,11 +528,6 @@ under the License.
       </dependency>
       <dependency>
         <groupId>org.apache.cxf</groupId>
-        <artifactId>cxf-rt-databinding-jaxb</artifactId>
-        <version>${cxf.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.cxf</groupId>
         <artifactId>cxf-rt-rs-client</artifactId>
         <version>${cxf.version}</version>
       </dependency>
@@ -668,6 +663,11 @@ under the License.
         <version>${jackson.version}</version>
       </dependency>
       <dependency>
+        <groupId>com.fasterxml.jackson.jaxrs</groupId>
+        <artifactId>jackson-jaxrs-xml-provider</artifactId>
+        <version>${jackson.version}</version>
+      </dependency>
+      <dependency>
         <groupId>com.fasterxml.jackson.module</groupId>
         <artifactId>jackson-module-afterburner</artifactId>
         <version>${jackson.version}</version>


Mime
View raw message