(no commit message)
[utils] / crawler / basic / src / org / wamblee / crawler / impl / ConfigurationParser.java
index 89e815c8c943375165d9a9c83a7b015ae0667139..dafbc832b5f12583a96f119f6e86953496661c7d 100644 (file)
@@ -49,6 +49,9 @@ public class ConfigurationParser {
     private static final String METHOD_POST = "post";
     private static final String METHOD_GET = "get";
     
+    private static final int MAX_TRIES = 3; 
+    private static final int MAX_DELAY = 5000;
+    
     private PrintStream _os; 
     
     public ConfigurationParser(PrintStream aOs) {
@@ -122,10 +125,10 @@ public class ConfigurationParser {
         NameValuePair[] paramsArray = params.toArray(new NameValuePair[0]);
         PageRequest request; 
         if ( METHOD_POST.equals(method)) { 
-            request = new PostPageRequest(paramsArray, xslt, _os);
+            request = new PostPageRequest(MAX_TRIES, MAX_DELAY, paramsArray, xslt, _os);
         }
         else if ( METHOD_GET.equals(method) || method == null ){
-            request = new GetPageRequest(paramsArray, xslt, _os);
+            request = new GetPageRequest(MAX_TRIES, MAX_DELAY, paramsArray, xslt, _os);
         } else { 
             throw new RuntimeException("Unknown request method '" + method + "'. Only " + 
                     METHOD_GET + " and " + METHOD_POST + " are supported");