Commit edce3dd5 authored by Andre Freyssinet's avatar Andre Freyssinet

Allows to configure useOldAPI.

parent d3b160d4
......@@ -39,6 +39,7 @@ import org.objectweb.joram.shared.DestinationConstants;
* The valid properties define by this destination are:<ul>
* <li>rest.host: hostname or IP address of remote JMS REST server, by default "localhost".</li>
* <li>rest.port: listening port of remote JMS REST server, by default 8989.</li>
* <li>rest.useOldAPI: if true, use the old Rest/JMS API with authentication through query parameters.</li>
* <li>rest.user: user name needed to connect to remote JMS REST server, by default "anonymous".</li>
* <li>rest.pass: password needed to connect to remote JMS REST server, by default "anonymous".</li>
* <li>rest.mediaTypeJson: if true the acquisition queue accepts JSON message, default true.</li>
......@@ -60,6 +61,7 @@ public class RestAcquisitionQueue {
private String host = "localhost";
private int port = 8989;
private boolean useOldAPI = false;
private String username = "anonymous";
private String password = "anonymous";
private boolean mediaTypeJson = true;
......@@ -97,6 +99,21 @@ public class RestAcquisitionQueue {
return this;
}
/**
* @return the useOldAPI
*/
public boolean isUseOldAPI() {
return useOldAPI;
}
/**
* @param useOldAPI the useOldAPI to set
*/
public RestAcquisitionQueue setUseOldAPI(boolean useOldAPI) {
this.useOldAPI = useOldAPI;
return this;
}
/**
* @return the userName
*/
......@@ -288,11 +305,14 @@ public class RestAcquisitionQueue {
if (props == null)
props = new Properties();
// TODO: It seems that only Async Acquisition can be activated.
props.setProperty(DestinationConstants.ACQUISITION_CLASS_NAME, RESTAcquisition);
if (!props.containsKey(DestinationConstants.REST_HOST_PROP))
props.setProperty(DestinationConstants.REST_HOST_PROP, host);
if (!props.containsKey(DestinationConstants.REST_PORT_PROP))
props.setProperty(DestinationConstants.REST_PORT_PROP, "" + port);
if (!props.containsKey(DestinationConstants.REST_USE_OLD_API))
props.setProperty(DestinationConstants.REST_USE_OLD_API, ""+useOldAPI);
if (!props.containsKey(DestinationConstants.REST_USERNAME_PROP))
props.setProperty(DestinationConstants.REST_USERNAME_PROP, username);
if (!props.containsKey(DestinationConstants.REST_PASSWORD_PROP))
......
......@@ -39,6 +39,7 @@ import org.objectweb.joram.shared.DestinationConstants;
* The valid properties define by this destination are:<ul>
* <li>rest.host: hostname or IP address of remote JMS REST server, by default "localhost".</li>
* <li>rest.port: listening port of remote JMS REST server, by default 8989.</li>
* <li>rest.useOldAPI: if true, use the old Rest/JMS API with authentication through query parameters.</li>
* <li>rest.user: user name needed to connect to remote JMS REST server, by default "anonymous".</li>
* <li>rest.pass: password needed to connect to remote JMS REST server, by default "anonymous".</li>
* <li>distribution.async: default true.<li>
......@@ -58,6 +59,7 @@ public class RestDistributionQueue {
private String host = "localhost";
private int port = 8989;
private boolean useOldAPI = false;
private String userName = "anonymous";
private String password = "anonymous";
private boolean batch = true;
......@@ -92,6 +94,21 @@ public class RestDistributionQueue {
return this;
}
/**
* @return the useOldAPI
*/
public boolean isUseOldAPI() {
return useOldAPI;
}
/**
* @param useOldAPI the useOldAPI to set
*/
public RestDistributionQueue setUseOldAPI(boolean useOldAPI) {
this.useOldAPI = useOldAPI;
return this;
}
/**
* @return the userName
*/
......@@ -291,6 +308,8 @@ public class RestDistributionQueue {
props.setProperty(DestinationConstants.REST_HOST_PROP, host);
if (!props.containsKey(DestinationConstants.REST_PORT_PROP))
props.setProperty(DestinationConstants.REST_PORT_PROP, ""+port);
if (!props.containsKey(DestinationConstants.REST_USE_OLD_API))
props.setProperty(DestinationConstants.REST_USE_OLD_API, ""+useOldAPI);
if (!props.containsKey(DestinationConstants.REST_USERNAME_PROP))
props.setProperty(DestinationConstants.REST_USERNAME_PROP, userName);
if (!props.containsKey(DestinationConstants.REST_PASSWORD_PROP))
......
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