| 1 | |
package org.webslinger.servlet; |
| 2 | |
|
| 3 | |
import java.io.BufferedReader; |
| 4 | |
import java.io.IOException; |
| 5 | |
import java.io.InputStream; |
| 6 | |
import java.io.InputStreamReader; |
| 7 | |
import java.io.Serializable; |
| 8 | |
import java.util.Collection; |
| 9 | |
import java.util.HashMap; |
| 10 | |
import java.util.Locale; |
| 11 | |
import java.util.HashSet; |
| 12 | |
import java.util.Map; |
| 13 | |
import java.util.Set; |
| 14 | |
import javax.servlet.ServletInputStream; |
| 15 | |
import javax.servlet.ServletRequest; |
| 16 | |
import javax.servlet.RequestDispatcher; |
| 17 | |
|
| 18 | 1052 | public class ServletRequestConfig implements Serializable { |
| 19 | |
protected String localAddr; |
| 20 | |
protected String localName; |
| 21 | |
protected int localPort; |
| 22 | |
protected String remoteAddr; |
| 23 | |
protected String remoteHost; |
| 24 | |
protected int remotePort; |
| 25 | |
protected String scheme; |
| 26 | |
protected String serverName; |
| 27 | |
protected int serverPort; |
| 28 | |
protected boolean isSecure; |
| 29 | 1052 | protected Locale locale = Locale.getDefault(); |
| 30 | 1052 | protected final Set<Locale> locales = new HashSet<Locale>(); |
| 31 | |
protected String protocol; |
| 32 | |
|
| 33 | |
public String getLocalAddr() { |
| 34 | 0 | return localAddr; |
| 35 | |
} |
| 36 | |
|
| 37 | |
public void setLocalAddr(String localAddr) { |
| 38 | 0 | this.localAddr = localAddr; |
| 39 | 0 | } |
| 40 | |
|
| 41 | |
public Locale getLocale() { |
| 42 | 0 | return locale; |
| 43 | |
} |
| 44 | |
|
| 45 | |
public void setLocale(Locale locale) { |
| 46 | 0 | this.locale = locale; |
| 47 | 0 | } |
| 48 | |
|
| 49 | |
public Collection<Locale> getLocales() { |
| 50 | 0 | return locales; |
| 51 | |
} |
| 52 | |
|
| 53 | |
public void addLocale(Locale locale) { |
| 54 | 0 | if (locales.isEmpty()) this.locale = locale; |
| 55 | 0 | locales.add(locale); |
| 56 | 0 | } |
| 57 | |
|
| 58 | |
public void removeLocale(Locale locale) { |
| 59 | 0 | locales.remove(locale); |
| 60 | 0 | } |
| 61 | |
|
| 62 | |
public String getLocalName() { |
| 63 | 0 | return localName; |
| 64 | |
} |
| 65 | |
|
| 66 | |
public void setLocalName(String localName) { |
| 67 | 0 | this.localName = localName; |
| 68 | 0 | } |
| 69 | |
|
| 70 | |
public int getLocalPort() { |
| 71 | 0 | return localPort; |
| 72 | |
} |
| 73 | |
|
| 74 | |
public void setLocalPort(int localPort) { |
| 75 | 0 | this.localPort = localPort; |
| 76 | 0 | } |
| 77 | |
|
| 78 | |
public String getProtocol() { |
| 79 | 0 | return protocol; |
| 80 | |
} |
| 81 | |
|
| 82 | |
public void setProtocol(String protocol) { |
| 83 | 0 | this.protocol = protocol; |
| 84 | 0 | } |
| 85 | |
|
| 86 | |
public String getRemoteAddr() { |
| 87 | 0 | return remoteAddr; |
| 88 | |
} |
| 89 | |
|
| 90 | |
public void setRemoteAddr(String remoteAddr) { |
| 91 | 0 | this.remoteAddr = remoteAddr; |
| 92 | 0 | } |
| 93 | |
|
| 94 | |
public String getRemoteHost() { |
| 95 | 0 | return remoteHost; |
| 96 | |
} |
| 97 | |
|
| 98 | |
public void setRemoteHost(String remoteHost) { |
| 99 | 0 | this.remoteHost = remoteHost; |
| 100 | 0 | } |
| 101 | |
|
| 102 | |
public int getRemotePort() { |
| 103 | 0 | return remotePort; |
| 104 | |
} |
| 105 | |
|
| 106 | |
public void setRemotePort(int remotePort) { |
| 107 | 0 | this.remotePort = remotePort; |
| 108 | 0 | } |
| 109 | |
|
| 110 | |
public String getScheme() { |
| 111 | 0 | return scheme; |
| 112 | |
} |
| 113 | |
|
| 114 | |
public String getServerName() { |
| 115 | 0 | return serverName; |
| 116 | |
} |
| 117 | |
|
| 118 | |
public void setServerName(String serverName) { |
| 119 | 0 | this.serverName = serverName; |
| 120 | 0 | } |
| 121 | |
|
| 122 | |
public int getServerPort() { |
| 123 | 0 | return serverPort; |
| 124 | |
} |
| 125 | |
|
| 126 | |
public void setServerPort(int serverPort) { |
| 127 | 0 | this.serverPort = serverPort; |
| 128 | 0 | } |
| 129 | |
|
| 130 | |
public boolean isSecure() { |
| 131 | 0 | return isSecure; |
| 132 | |
} |
| 133 | |
|
| 134 | |
public void setIsSecure(boolean isSecure) { |
| 135 | 0 | this.isSecure = isSecure; |
| 136 | 0 | } |
| 137 | |
|
| 138 | |
public void setScheme(String scheme) { |
| 139 | 0 | this.scheme = scheme; |
| 140 | 0 | } |
| 141 | |
} |