View Javadoc

1   package org.kuali.common.http;
2   
3   import java.util.Arrays;
4   import java.util.List;
5   
6   public class HttpContext {
7   
8   	// Url to contact
9   	String url;
10  
11  	// HTTP codes signifying success
12  	List<Integer> successCodes = Arrays.asList(200);
13  
14  	// If Tomcat is fronted by an Apache web server, and Apache is up and running but Tomcat is still starting, http 503 is returned by Apache
15  	// We don't want to fail if we get a 503, just continue waiting
16  	List<Integer> continueWaitingCodes = Arrays.asList(503);
17  
18  	// Millis to wait before an individual http request times out (3 seconds)
19  	int requestTimeoutMillis = 3000;
20  
21  	// Millis to wait in between http requests (3 seconds)
22  	int sleepIntervalMillis = 3000;
23  
24  	// Total number of millis to wait before timing out (3 minutes)
25  	int overallTimeoutMillis = 1000 * 60 * 3;
26  
27  	public String getUrl() {
28  		return url;
29  	}
30  
31  	public void setUrl(String url) {
32  		this.url = url;
33  	}
34  
35  	public List<Integer> getSuccessCodes() {
36  		return successCodes;
37  	}
38  
39  	public void setSuccessCodes(List<Integer> successCodes) {
40  		this.successCodes = successCodes;
41  	}
42  
43  	public int getRequestTimeoutMillis() {
44  		return requestTimeoutMillis;
45  	}
46  
47  	public void setRequestTimeoutMillis(int requestTimeout) {
48  		this.requestTimeoutMillis = requestTimeout;
49  	}
50  
51  	public int getSleepIntervalMillis() {
52  		return sleepIntervalMillis;
53  	}
54  
55  	public void setSleepIntervalMillis(int sleepInterval) {
56  		this.sleepIntervalMillis = sleepInterval;
57  	}
58  
59  	public int getOverallTimeoutMillis() {
60  		return overallTimeoutMillis;
61  	}
62  
63  	public void setOverallTimeoutMillis(int overallTimeout) {
64  		this.overallTimeoutMillis = overallTimeout;
65  	}
66  
67  	public List<Integer> getContinueWaitingCodes() {
68  		return continueWaitingCodes;
69  	}
70  
71  	public void setContinueWaitingCodes(List<Integer> continueWaitingCodes) {
72  		this.continueWaitingCodes = continueWaitingCodes;
73  	}
74  
75  }