Commits

Ruwan Linton  committed 173c3cb

Removing deprecated QUERY_PARAM_MAP property and completely relying on the QUERY_PARAM_MAP_WDUPS property, anyway users are not supposed to use that property either, they should go through the HTTPSupport API.

  • Participants
  • Parent commits 0e718e5

Comments (0)

Files changed (13)

File modules/api/src/main/java/org/adroitlogic/ultraesb/api/management/EndpointDefinition.java

     }
 
     /**
-     * @deprecated use the {@link #addAddress(AddressDefinition)} instead
-     * @param a address to be added
-     */
-    @Deprecated
-    public void addAddress(Address a) {
-        addresses.add(a);
-    }
-
-    /**
      * Gets the list of addresses associated with the endpoint definition
      * @return the list of address definitions of this endpoint
      */
     }
 
     /**
-     * @deprecated use the {@link #setType(org.adroitlogic.ultraesb.api.management.EndpointDefinition.Type)} instead
-     * @param type the string representation of the type
-     */
-    @Deprecated
-    public void setType(String type) {
-        this.type = Type.enumOf(type);
-    }
-
-    /**
      * Gets the type of the endpoint
      * @return the type enum constant representing the endpoint type
      */
             }
         }
     }
-
-    /**
-     * @deprecated use the {@link AddressDefinition} instead
-     */
-    @Deprecated
-    public static class Address extends AddressDefinition {
-
-        /**
-         * @deprecated use {@link AddressDefinition#AddressDefinition(String)} instead
-         * @param value the url of the address
-         */
-        @Deprecated
-        public Address(String value) {
-            super(value);
-        }
-
-        /**
-         * @deprecated use {@link AddressDefinition#AddressDefinition(String, String)} instead
-         * @param id the identifier of the address
-         * @param value the url of the address
-         */
-        @Deprecated
-        public Address(String id, String value) {
-            super(id, value);
-        }
-
-        /**
-         * @deprecated use {@link AddressDefinition#AddressDefinition(String,
-         * org.adroitlogic.ultraesb.api.management.AddressDefinition.Type, String)} instead
-         * @param id the identifier of the address
-         * @param type the string representation of the type of the address
-         * @param value the address url or the url prefix
-         */
-        @Deprecated
-        public Address(String id, String type, String value) {
-            super(id, AddressDefinition.Type.valueOf(type.trim().toUpperCase()), value);
-        }
-
-        /**
-         * @deprecated use {@link AddressDefinition#AddressDefinition(String,
-         * org.adroitlogic.ultraesb.api.management.AddressDefinition.Type, String, double)} instead
-         * @param id the identifier of the address
-         * @param weight the weight of the address
-         * @param type the string representation of the type of the address
-         * @param value the address url or the url prefix
-         */
-        @Deprecated
-        public Address(String id, double weight, String type, String value) {
-            super(id, AddressDefinition.Type.valueOf(type.trim().toUpperCase()), value, weight);
-        }
-    }
 }

File modules/api/src/main/java/org/adroitlogic/ultraesb/api/mediation/HTTPSupport.java

      * @param msg the message
      * @param key the name or key of the query parameter
      */
-    void removeRequestParameter(Message msg, String key);
+    List<String> removeRequestParameter(Message msg, String key);
 
     /**
      * Add an outgoing query parameter with the given name
 
     /**
      * Gives a String representation of URL query parameters of the given message received over HTTP/S transport. This
-     * query string will contain what came in the message and any alternations to the
-     * {@link org.adroitlogic.ultraesb.api.transport.http.HttpConstants.MessageProperties#QUERY_PARAM_MAP} wont be
-     * reflected in the QUERY_STRING, even though both refers to effectively the same value set initially. The
+     * query string will contain what came in the message and any alternations to the query parameters in the mediation
+     * wont be reflected in the QUERY_STRING, even though both refers to effectively the same value set initially. The
      * QUERY_STRING property value does not include the "?" prefix
      * @param msg the message of which the query string to be retrieved
      * @return the query string of the given message

File modules/api/src/main/java/org/adroitlogic/ultraesb/api/mediation/XMLSupport.java

                    Map<String, Object> parameters, final String[]... ns);
 
     /**
-     * @deprecated in favor of {@link #transform(org.adroitlogic.ultraesb.api.Message, String, String, boolean, java.util.Map, String[]...)}
-     * Transform the message payload by XSLT
-     * @param msg current message
-     * @param xsltFilename the XSLT filename
-     * @param exprn an optional XPath expression to select the source node for XSLT, and node to replace with the result
-     * @param ns an optional array of namespace prefixes and namespace urls
-     * @param domResult is the result desired as a DOM payload? (useful for further XML processing)
-     * @param parameters any XSLT parameters to be passed to the transformation
-     */
-    @Deprecated
-    void transform(Message msg, final String xsltFilename, String exprn, final String[][] ns,
-                   boolean domResult, Map<String, Object> parameters);
-
-    /**
      * Transform the message payload by XSLT (without any parameters), assuming a non DOM result
      * @param msg current message
      * @param xsltFilename the XSLT filename
     boolean filter(Message m, String exprn, String regex, final String[]... ns);
 
     /**
-     * @deprecated in favor of {@link #filter(org.adroitlogic.ultraesb.api.Message, String, String, String[]...)}
-     * Evaluate the given XPath expression over the XML payload and compare the resulting String value with the
-     * regular expression for a match. This method converts the current payload into a DOMMessage
-     * @param m the current message
-     * @param exprn the XPath expression to evaluate against the message payload
-     * @param ns an optional array of namespace prefixes and namespace urls
-     * @param regex an optional regular expression to evaluate the XPath results' String value against
-     * @return true if the regular expression matches the String result of the XPath expression
-     */
-    @Deprecated
-    boolean filter(Message m, String exprn, final String[][] ns, String regex);
-
-    /**
      * Evaluate the given boolean XPath expression over the XML payload
      * @param m the current message
      * @param exprn the XPath expression to evaluate against the message payload

File modules/api/src/main/java/org/adroitlogic/ultraesb/api/transport/http/HttpConstants.java

     /** Enforcing the constant class to be used as an static reference and not to instantiate */
     private HttpConstants() {}
 
-    /** @deprecated since 2.0, use {@link MessageProperties#REMOTE_ADDRESS} */
-    @Deprecated public static final String REMOTE_ADDRESS               = MessageProperties.REMOTE_ADDRESS;
-    /** @deprecated since 2.0, use {@link MessageProperties#REMOTE_PORT} */
-    @Deprecated public static final String REMOTE_PORT                  = MessageProperties.REMOTE_PORT;
-    /** @deprecated since 2.0, use {@link MessageProperties#LOCAL_ADDRESS} */
-    @Deprecated public static final String LOCAL_ADDRESS                = MessageProperties.LOCAL_ADDRESS;
-    /** @deprecated since 2.0, use {@link MessageProperties#LOCAL_PORT} */
-    @Deprecated public static final String LOCAL_PORT                   = MessageProperties.LOCAL_PORT;
-    /** @deprecated since 2.0, use {@link MessageProperties#SSL_CLIENT_DN} */
-    @Deprecated public static final String SSL_CLIENT_DN                = MessageProperties.SSL_CLIENT_DN;
-    /** @deprecated since 2.0, use {@link MessageProperties#SSL_CLIENT_CERTS} */
-    @Deprecated public static final String SSL_CLIENT_CERTS             = MessageProperties.SSL_CLIENT_CERTS;
-    /** @deprecated since 2.0, use {@link MessageProperties#METHOD} */
-    @Deprecated public static final String METHOD                       = MessageProperties.METHOD;
-    /** @deprecated since 2.0, use {@link MessageProperties#MESSAGE_SIZE} */
-    @Deprecated public static final String MESSAGE_SIZE                 = MessageProperties.MESSAGE_SIZE;
-    /** @deprecated since 2.0, use {@link MessageProperties#RESPONSE_STATUS_CODE} */
-    @Deprecated public static final String RESPONSE_STATUS_CODE         = MessageProperties.RESPONSE_STATUS_CODE;
-    /** @deprecated since 2.0, use {@link MessageProperties#USERNAME} */
-    @Deprecated public static final String USERNAME                     = MessageProperties.USERNAME;
-    /** @deprecated since 2.0, use {@link MessageProperties#USERROLES} */
-    @Deprecated public static final String USERROLES                    = MessageProperties.USERROLES;
-    /** @deprecated since 2.0, use {@link MessageProperties#USERROLES_ARRAY} */
-    @Deprecated public static final String USERROLES_ARRAY              = MessageProperties.USERROLES_ARRAY;
-    /** @deprecated since 2.0, use {@link MessageProperties#FORWARD_URL_POSTFIX} */
-    @Deprecated public static final String FORWARD_URL_POSTFIX          = MessageProperties.FORWARD_URL_POSTFIX;
-    /** @deprecated since 2.0, use {@link MessageProperties#QUERY_STRING} */
-    @Deprecated public static final String QUERY_STRING                 = MessageProperties.QUERY_STRING;
-    /** @deprecated since 2.0, use {@link MessageProperties#QUERY_PARAM_MAP} */
-    @Deprecated public static final String QUERY_PARAM_MAP              = MessageProperties.QUERY_PARAM_MAP;
-    /** @deprecated since 2.0, use {@link MessageProperties#QUERY_PARAM_MAP_WDUPS} */
-    @Deprecated public static final String QUERY_PARAM_MAP_WDUPS        = MessageProperties.QUERY_PARAM_MAP_WDUPS;
-    /** @deprecated since 2.0, use {@link MessageProperties#SERVICE_URL} */
-    @Deprecated public static final String SERVICE_URL                  = MessageProperties.SERVICE_URL;
-    /** @deprecated since 2.0, use {@link MessageProperties#SERVICE_TRP_PROPS} */
-    @Deprecated public static final String SERVICE_TRP_PROPS            = MessageProperties.SERVICE_TRP_PROPS;
-    /** @deprecated since 2.0, use {@link MessageProperties#AUTH_USERNAME} */
-    @Deprecated public static final String AUTH_USERNAME                = MessageProperties.AUTH_USERNAME;
-    /** @deprecated since 2.0, use {@link MessageProperties#AUTH_PASSWORD} */
-    @Deprecated public static final String AUTH_PASSWORD                = MessageProperties.AUTH_PASSWORD;
-    /** @deprecated since 2.0, use {@link MessageProperties#NTLM_DOMAIN} */
-    @Deprecated public static final String NTLM_DOMAIN                  = MessageProperties.NTLM_DOMAIN;
-    /** @deprecated since 2.0, use {@link MessageProperties#NTLM_WORKSTATION} */
-    @Deprecated public static final String NTLM_WORKSTATION             = MessageProperties.NTLM_WORKSTATION;
-    /** @deprecated since 2.0, use {@link MessageProperties#AUTH_CONNECTION} */
-    @Deprecated public static final String AUTH_CONNECTION              = MessageProperties.AUTH_CONNECTION;
-    /** @deprecated since 2.0, use {@link MessageProperties#AUTH_SCHEME_HOLDER} */
-    @Deprecated public static final String AUTH_SCHEME_HOLDER           = MessageProperties.AUTH_SCHEME_HOLDER;
-    /** @deprecated since 2.0, use {@link MessageProperties#AUTH_SCHEME} */
-    @Deprecated public static final String AUTH_SCHEME                  = MessageProperties.AUTH_SCHEME;
-
     // todo : can we make these enum variables ??
     /** The constant indicating pre-emptive basic authentication */
     public static final String AUTH_SCHEME_BASIC            = "basic";
 
         /**
          * The name of the message property that holds a String representation of URL query parameters. This query string
-         * will contain what came in the message and any alternations to the
-         * {@link HttpConstants.MessageProperties#QUERY_PARAM_MAP} wont be reflected in the QUERY_STRING, even though
-         * both refers to effectively the same value set initially. This property value; i.e. the query string MUST be
-         * treated as read-only and any changes to this string wont be effective for the message being sent out from the
-         * ESB after the mediation. For such alternation use the {@link HttpConstants.MessageProperties#QUERY_PARAM_MAP}
-         * property instead of the QUERY_STRING. The QUERY_STRING property value does not include the "?" prefix
+         * will contain what came in the message and any alternations to the query parameters in the mediation wont be
+         * reflected in the QUERY_STRING, even though both refers to effectively the same value set initially.
+         * This property value; i.e. the query string MUST be treated as read-only and any changes to this string wont
+         * be effective for the message being sent out from the ESB after the mediation. For such alternation use the
+         * {@link org.adroitlogic.ultraesb.api.mediation.HTTPSupport#addRequestParameter(org.adroitlogic.ultraesb.api.Message, String, String)}
+         * method instead of the QUERY_STRING. The QUERY_STRING property value does not include the "?" prefix
          */
         public static final String QUERY_STRING                 = "ultra.http.query_string";
 
         public static final String QUERY_PARAM_MAP_WDUPS        = "ultra.http.query_param_map_wdups";
 
         /**
-         * @deprecated since 2.0
-         * The name of the message property that holds a Map<String, String> of URL query parameters. This Map can be
-         * changed during mediation, and the resulting values re-used if the message is forwarded
-         */
-        public static final String QUERY_PARAM_MAP              = "ultra.http.query_param_map";
-
-        /**
          * The mapped placeholders in the URI pattern as URI path parameters specified in the {@link #PATH_PATTERN}
          * transport property, these will be looked up by the
          * {@link org.adroitlogic.ultraesb.api.mediation.HTTPSupport#getFirstRequestParameter(org.adroitlogic.ultraesb.api.Message, String)}
 
         /** The error code indicating a connection close by the remote party */
         public static final int SND_CLOSED_SENDING          = 101505;
-
-
-        //----------------------------- DEPRECATED -----------------------------------
-        /** @deprecated  use SND_TIMEOUT_RECEIVING or SND_TIMEOUT_SENDING */
-        @Deprecated public static final int SND_CONNECTION_TIMEOUT      = SND_TIMEOUT_RECEIVING;
-
-        /** @deprecated  use SND_CLOSED_RECEIVING or SND_CLOSED_SENDING */
-        @Deprecated public static final int SND_CONNECTION_CLOSED       = SND_CLOSED_RECEIVING;
     }
 
 }

File modules/core/src/main/java/org/adroitlogic/ultraesb/core/MessageImpl.java

 import org.adroitlogic.logging.api.LoggerFactory;
 import org.adroitlogic.ultraesb.api.*;
 import org.adroitlogic.ultraesb.api.format.MessageFormat;
-import org.adroitlogic.ultraesb.api.transport.http.HttpConstants;
 import org.adroitlogic.ultraesb.core.endpoint.Endpoint;
 import org.adroitlogic.ultraesb.core.format.RawFileMessage;
 import org.adroitlogic.ultraesb.core.spring.SpringPlatformTransactionManager;
     @Override
     public synchronized void addMessageProperty(String key, Object value) {
         if (currentMessageProperties == null) {
-            if (originalMessageProperties == null) {
-                currentMessageProperties = new HashMap<>();
-            } else {
-                currentMessageProperties = new HashMap<>(originalMessageProperties);
-            }
+            currentMessageProperties = originalMessageProperties != null ?
+                    new HashMap<>(originalMessageProperties) : new HashMap<String, Object>();
         }
         currentMessageProperties.put(key, value);
     }
      */
     @Override
     public synchronized Object getMessageProperty(String key) {
-        if (currentMessageProperties == null) {
-            if (originalMessageProperties == null) {
-                return null;
-            } else {
-                if (HttpConstants.MessageProperties.QUERY_PARAM_MAP.equals(key)) {
-                    originalMessageProperties.remove(HttpConstants.MessageProperties.QUERY_PARAM_MAP_WDUPS);
-                }
-                return originalMessageProperties.get(key);
-            }
-        } else {
-            if (HttpConstants.MessageProperties.QUERY_PARAM_MAP.equals(key)) {
-                currentMessageProperties.remove(HttpConstants.MessageProperties.QUERY_PARAM_MAP_WDUPS);
-            }
-            return currentMessageProperties.get(key);
-        }
+        return currentMessageProperties != null ? currentMessageProperties.get(key) :
+                originalMessageProperties != null ? originalMessageProperties.get(key) : null;
     }
 
     /** {@inheritDoc} */

File modules/core/src/main/java/org/adroitlogic/ultraesb/core/mediation/HTTPSupportImpl.java

 
     /** {@inheritDoc} */
     @Override
-    public void removeRequestParameter(Message msg, String key) {
-        List<String> values = getRequestParameterValues(msg, key);
-        if (!values.isEmpty()) {
-            values.clear();
-        }
+    public List<String> removeRequestParameter(Message msg, String key) {
+        return getRequestParameterMap(msg).remove(key);
     }
 
     /** {@inheritDoc} */

File modules/core/src/main/java/org/adroitlogic/ultraesb/core/mediation/XMLSupportImpl.java

     }
 
     /**
-     * @deprecated in favor of {@link #transform(org.adroitlogic.ultraesb.api.Message, String, String, boolean, java.util.Map, String[]...)}
-     * Transform the message payload by XSLT
-     * @param msg current message
-     * @param xsltFilename the XSLT filename
-     * @param exprn an optional XPath expression to select the source node for XSLT, and node to replace with the result
-     * @param ns an optional array of namespace prefixes and namespace urls
-     * @param domResult is the result desired as a DOM payload? (useful for further XML processing)
-     * @param parameters any XSLT parameters to be passed to the transformation
-     */
-    @Override
-    @Deprecated
-    public void transform(Message msg, final String xsltFilename, String exprn, final String[][] ns,
-                          boolean domResult, Map<String, Object> parameters) {
-        transform(msg, xsltFilename, exprn, domResult, parameters, ns);
-    }
-
-    /**
      * Transform the message payload by XSLT (without any parameters), assuming a non DOM result
      * @param msg current message
      * @param xsltFilename the XSLT filename
     }
 
     /**
-     * @deprecated in favor of {@link #filter(org.adroitlogic.ultraesb.api.Message, String, String, String[]...)}
-     * Evaluate the given XPath expression over the XML payload and compare the resulting String value with the
-     * regular expression for a match. This method converts the current payload into a DOMMessage
-     * @param m the current message
-     * @param exprn the XPath expression to evaluate against the message payload
-     * @param ns an optional array of namespace prefixes and namespace urls
-     * @param regex an optional regular expression to evaluate the XPath results' String value against
-     * @return true if the regular expression matches the String result of the XPath expression
-     */
-    @Override
-    @Deprecated
-    public boolean filter(org.adroitlogic.ultraesb.api.Message m, String exprn, final String[][] ns, String regex) {
-        return filter(m, exprn, regex, ns);
-    }
-
-    /**
      * Evaluate the given boolean XPath expression over the XML payload
      * @param m the current message
      * @param exprn the XPath expression to evaluate against the message payload

File modules/core/src/main/java/org/adroitlogic/ultraesb/transport/http/HttpNIOSender.java

             }
         } else {
             @SuppressWarnings("unchecked")
-            Map<String, String> queryParams = (Map<String, String>) msg.getMessageProperty(
-                    HttpConstants.MessageProperties.QUERY_PARAM_MAP);
+            Map<String, List<String>> queryParams = (Map<String, List<String>>) msg.getMessageProperty(
+                    HttpConstants.MessageProperties.QUERY_PARAM_MAP_WDUPS);
             if (queryParams != null) {
                 boolean first = true;
-                for (Map.Entry<String, String> e : queryParams.entrySet()) {
-                    if (!first) {
-                        sb.append('&');
-                    } else {
-                        first = false;
+                for (Map.Entry<String, List<String>> e : queryParams.entrySet()) {
+                    for (String val : e.getValue()) {
+                        if (!first) {
+                            sb.append('&');
+                        } else {
+                            first = false;
+                        }
+                        sb.append(e.getKey()).append('=').append(val);
                     }
-                    sb.append(e.getKey()).append('=').append(e.getValue());
                 }
             } else {
                 Object qryStr = msg.getMessageProperty(HttpConstants.MessageProperties.QUERY_STRING);
     }
 
     public void toDetailedViewExt(TransportView view) {
-        Map<String, KeepaliveStats> stats = new HashMap<String, KeepaliveStats>();
+        Map<String, KeepaliveStats> stats = new HashMap<>();
         for (Map.Entry<HttpHost, InternalKeepaliveStats>  e : connectionPool.getStats().entrySet()) {
             HttpHost host = e.getKey();
             InternalKeepaliveStats val = e.getValue();

File modules/core/src/main/java/org/adroitlogic/ultraesb/transport/http/custom/listener/UltraAsyncRequestConsumer.java

             String substring = fullURL.substring(pos + 1);
             message.addMessageProperty(QUERY_STRING, substring);
 
-            Map<String, String> nonDupMap = new HashMap<>();
             Map<String, List<String>> dupMap = new HashMap<>();
 
             StringTokenizer st = new StringTokenizer(substring, "&");
                     try {
                         final String key = tok.substring(0, pos);
                         final String value = URLDecoder.decode(tok.substring(pos + 1), "UTF-8");
-                        nonDupMap.put(key, value);
 
                         List<String> dupElements = dupMap.get(key);
                         if (dupElements == null) {
                     }
                 }
             }
-            message.addMessageProperty(QUERY_PARAM_MAP, nonDupMap);
             message.addMessageProperty(QUERY_PARAM_MAP_WDUPS, dupMap);
 
         } else {
-            message.addMessageProperty(QUERY_PARAM_MAP, Collections.emptyMap());
             message.addMessageProperty(QUERY_PARAM_MAP_WDUPS, Collections.emptyMap());
         }
     }
 
-    private Map<String, String> getQueryParamMap(String fullURL) {
-        int pos = fullURL.indexOf('?');
-        if (pos != -1) {
-            Map<String, String> parms = new HashMap<String, String>();
-            StringTokenizer st = new StringTokenizer(fullURL.substring(pos + 1), "&");
-            while (st.hasMoreTokens()) {
-                String tok = st.nextToken();
-                pos = tok.indexOf('=');
-                if (pos != -1) {
-                    parms.put(tok.substring(0, pos), tok.substring(pos + 1));
-                }
-            }
-            return parms;
-        }
-        return Collections.emptyMap();
-    }
-
     private String getForwardURLPostfix(String fullURL, String proxyServiceID) {
         String stripPrefix = stripURLPrefixes.get(proxyServiceID);
         int pos = fullURL.indexOf(stripPrefix);

File modules/sample/src/main/java/samples/json/JsonCRUDSequence.java

 import java.sql.PreparedStatement;
 import java.sql.SQLException;
 import java.sql.Statement;
+import java.util.List;
 import java.util.Map;
 
 /**
                 JSONUtils.getRowAsJson(
                     "select * from EMPLOYEE where employeeId = ?", dataSource, null, new Object[]{id}, msg);
             } else {
-                Map<String, String> params = (Map<String, String>) msg.getMessageProperty(HttpConstants.MessageProperties.QUERY_PARAM_MAP);
+                Map<String, List<String>> params = mediation.getHTTPSupport().getRequestParameterMap(msg);
                 if (params.isEmpty()) {
                     // return all
                     JSONUtils.getRowsAsJson(
                 } else if (params.containsKey("salary")) {
                     JSONUtils.getRowsAsJson(
                         "select * from EMPLOYEE where salary > ?", dataSource, null,
-                        new Object[] { Double.parseDouble(params.get("salary"))}, msg);
+                        new Object[] { Double.parseDouble(params.get("salary").get(0))}, msg);
                 }
             }
             msg.getTransportHeaders().clear();

File modules/sample/src/test/conf/query-param-test.xml

         <u:target inDestination="echo-back-ep" outDestination="response">
             <u:inSequence>
                 <u:java import="java.util.*; org.adroitlogic.ultraesb.api.transport.http.HttpConstants;"><![CDATA[
-                        Map<String, String> params = (Map<String, String>) msg.getMessageProperty(HttpConstants.QUERY_PARAM_MAP);
-                        params.put("foo", params.get("foo") + "modified");
+                        Map<String, List<String>> params = (Map<String, List<String>>)
+                                msg.getMessageProperty(HttpConstants.MessageProperties.QUERY_PARAM_MAP_WDUPS);
+                        List<String> list = new ArrayList<String>();
+                        list.add(params.get("foo").get(0) + "modified");
+                        params.put("foo", list);
                     ]]></u:java>
             </u:inSequence>
         </u:target>
         <u:transport id="http-8280"/>
         <u:target inDestination="echo-back-ep" outDestination="response">
             <u:inSequence>
-                <u:java import="java.util.*; org.adroitlogic.ultraesb.api.transport.http.HttpConstants;"><![CDATA[
-                        Map<String, List<String>> params = (Map<String, List<String>>) msg.getMessageProperty(HttpConstants.MessageProperties.QUERY_PARAM_MAP_WDUPS);
-                        List<String> newParamList = new ArrayList<String>();
-                        newParamList.add(params.get("foo").get(0) + "modifiedwdups");
-                        params.put("foo", newParamList);
+                <u:java><![CDATA[
+                        org.adroitlogic.ultraesb.api.mediation.HTTPSupport httpSupport = mediation.getHTTPSupport();
+                        httpSupport.addRequestParameter(msg, "foo", httpSupport.getFirstRequestParameter(msg, "foo") + "modifiedwdups");
                     ]]></u:java>
             </u:inSequence>
         </u:target>
         <u:target inDestination="echo-back-ep" outDestination="response">
             <u:inSequence>
                 <u:java import="java.util.*; org.adroitlogic.ultraesb.api.transport.http.HttpConstants;"><![CDATA[
-                        String param = mediation.getHTTPSupport().getFirstRequestParameter(msg, "foo");
-                        mediation.getHTTPSupport().removeRequestParameter(msg, "foo");
+                        String param = mediation.getHTTPSupport().removeRequestParameter(msg, "foo").get(0);
                         mediation.getHTTPSupport().addRequestParameter(msg, "foo", param + "modifiedapi");
                     ]]></u:java>
             </u:inSequence>

File modules/sample/src/test/java/org/adroitlogic/ultraesb/rest/WebProxyTest.java

         response = client.execute(httpget);
         Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
         Assert.assertTrue(EntityUtils.toString(response.getEntity()).contains(
-                "Parameters<br/>key: b values: 7<br/>key: c values: 6<br/>key: a values: 4"));
+                "Parameters<br/>key: b values: 7<br/>key: c values: 6<br/>key: a values: 1 4"));
 
         //test parameter re-writing
         httpget = new HttpGet("http://localhost:8281/vpathgroovy?x=6&y=5&z=4&x=3");
         response = client.execute(httpget);
         Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
         Assert.assertTrue(EntityUtils.toString(response.getEntity()).contains(
-                "Parameters<br/>key: b values: 5<br/>key: c values: 4<br/>key: a values: 3"));
+                "Parameters<br/>key: b values: 5<br/>key: c values: 4<br/>key: a values: 6 3"));
     }
 }

File resources/samples/conf/ultra-sample-102.xml

         <u:target>
             <u:inSequence>
                 <u:script ><![CDATA[
-                    var map = msg.getMessageProperty("ultra.http.query_param_map");
+                    var map = msg.getMessageProperty("ultra.http.query_param_map_wdups");
                     var val = map.remove('x');
                     if (val != null) map.put('a', val);
                     val = map.remove('y');
                 <u:script language="groovy"><![CDATA[
                     println "Executing inline Groovy Script"
 
-                    Map map = msg.getMessageProperty("ultra.http.query_param_map");
+                    Map map = msg.getMessageProperty("ultra.http.query_param_map_wdups");
                     Object val = map.remove('x');
                     if (val != null) map.put('a', val);
                     val = map.remove('y');