Skip to content
Snippets Groups Projects
Commit 29d39ea8 authored by felmer's avatar felmer
Browse files

LMS-2580 Timeout set to 5 minutes.

SVN: 23343
parent 0c1802e6
No related branches found
No related tags found
No related merge requests found
...@@ -26,10 +26,12 @@ import java.util.regex.Matcher; ...@@ -26,10 +26,12 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpConnectionManager;
import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.StringRequestEntity; import org.apache.commons.httpclient.methods.StringRequestEntity;
import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.xml.sax.InputSource; import org.xml.sax.InputSource;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
...@@ -58,6 +60,8 @@ import ch.systemsx.cisd.common.logging.LogFactory; ...@@ -58,6 +60,8 @@ import ch.systemsx.cisd.common.logging.LogFactory;
*/ */
public class CrowdAuthenticationService implements IAuthenticationService public class CrowdAuthenticationService implements IAuthenticationService
{ {
private static final int CONNECTION_TIMEOUT = (int) (5 * DateUtils.MILLIS_PER_MINUTE);
private static final String DUMMY_TOKEN_STR = "DUMMY-TOKEN"; private static final String DUMMY_TOKEN_STR = "DUMMY-TOKEN";
private static final String EMAIL_PROPERTY_KEY = "mail"; private static final String EMAIL_PROPERTY_KEY = "mail";
...@@ -144,6 +148,8 @@ public class CrowdAuthenticationService implements IAuthenticationService ...@@ -144,6 +148,8 @@ public class CrowdAuthenticationService implements IAuthenticationService
try try
{ {
final HttpClient client = new HttpClient(); final HttpClient client = new HttpClient();
HttpConnectionManager connectionManager = client.getHttpConnectionManager();
connectionManager.getParams().setConnectionTimeout(CONNECTION_TIMEOUT);
final PostMethod post = new PostMethod(serviceUrl); final PostMethod post = new PostMethod(serviceUrl);
final StringRequestEntity entity = final StringRequestEntity entity =
new StringRequestEntity(message, "application/soap+xml", "utf-8"); new StringRequestEntity(message, "application/soap+xml", "utf-8");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment