Commit 99182e3b authored by Andre Freyssinet's avatar Andre Freyssinet

JORAM-345: Temporary fix the URI (For compatibility reason the URI

allowing to use Form-Params is suffixed with "-fp"). This patch shall be
removed in next release.
parent 137d611c
......@@ -27,6 +27,7 @@ import java.io.IOException;
import java.io.ObjectOutputStream;
import java.lang.reflect.Constructor;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
......@@ -144,6 +145,13 @@ public class RESTAcquisition implements AcquisitionHandler {
}
uriCreateConsumer = response.getLink("create-consumer").getUri();
try {
// TODO (AF): to remove (use FormParam alternate URI)
uriCreateConsumer = new URI(uriCreateConsumer.toString() + "-fp");
} catch (URISyntaxException exc) {
logger.log(BasicLevel.ERROR, "RESTAcquisition.createConsumer: use FormParam alternate URI", exc);
uriCreateConsumer = null;
}
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, "RESTAcquisition.createConsumer: uriCreateConsumer = " + uriCreateConsumer);
......@@ -154,6 +162,7 @@ public class RESTAcquisition implements AcquisitionHandler {
wTarget = wTarget.queryParam("user", userName);
if (password != null)
wTarget = wTarget.queryParam("password", password);
response = wTarget.request().accept(MediaType.TEXT_PLAIN).post(Entity.entity(null, MediaType.APPLICATION_FORM_URLENCODED));
// if (logger.isLoggable(BasicLevel.DEBUG))
// logger.log(BasicLevel.DEBUG, "RESTAcquisition.createConsumer: response = " + response);
......
......@@ -178,6 +178,8 @@ public class RESTDistribution implements DistributionHandler {
try {
URI uriCreateProducer = response.getLink("create-producer").getUri();
// TODO (AF): to remove (use FormParam alternate URI)
uriCreateProducer = new URI(uriCreateProducer.toString() + "-fp");
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG,
"RestDistribution.createProducer(): create-producer = " + uriCreateProducer);
......
......@@ -212,8 +212,7 @@ public class RestAcquisitionAsync implements AcquisitionDaemon {
// Get the destination
Response response = null;
try {
response = client.target(base).path("jndi").path(destName)
.request().accept(MediaType.TEXT_PLAIN).head();
response = client.target(base).path("jndi").path(destName).request().accept(MediaType.TEXT_PLAIN).head();
} catch (Exception exc) {
if (logger.isLoggable(BasicLevel.ERROR))
logger.log(BasicLevel.ERROR,
......@@ -248,7 +247,9 @@ public class RestAcquisitionAsync implements AcquisitionDaemon {
if (userName != null) target = target.queryParam("user", userName);
if (password != null) target = target.queryParam("password", password);
response = target.request().accept(MediaType.TEXT_PLAIN).post(Entity.entity(null, MediaType.APPLICATION_FORM_URLENCODED));
// TODO (AF): to remove (use FormParam alternate URI)
// response = target.request().accept(MediaType.TEXT_PLAIN).post(Entity.entity(null, MediaType.APPLICATION_FORM_URLENCODED));
response = target.request().accept(MediaType.TEXT_PLAIN).post(null);
} catch (Exception exc) {
if (logger.isLoggable(BasicLevel.ERROR))
logger.log(BasicLevel.ERROR,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment