1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.esigate;
17
18 import org.esigate.authentication.RemoteUserAuthenticationHandler;
19 import org.esigate.cache.BasicCacheStorage;
20 import org.esigate.cookie.DefaultCookieManager;
21 import org.esigate.extension.ConfigReloadOnChange;
22 import org.esigate.extension.Esi;
23 import org.esigate.extension.FetchLogging;
24 import org.esigate.extension.FragmentLogging;
25 import org.esigate.extension.ResourceFixup;
26 import org.esigate.extension.XPoweredBy;
27 import org.esigate.extension.surrogate.Surrogate;
28 import org.esigate.util.Parameter;
29 import org.esigate.util.ParameterArray;
30 import org.esigate.util.ParameterBoolean;
31 import org.esigate.util.ParameterCollection;
32 import org.esigate.util.ParameterFloat;
33 import org.esigate.util.ParameterInteger;
34 import org.esigate.util.ParameterString;
35
36 import java.util.Collection;
37
38
39
40
41
42
43
44 public final class Parameters {
45
46
47 public static final Parameter<String[]> REMOTE_URL_BASE = new ParameterArray("remoteUrlBase");
48 public static final Parameter<Collection<String>> MAPPINGS = new ParameterCollection("mappings");
49 public static final Parameter<Boolean> STRIP_MAPPING_PATH = new ParameterBoolean("stripMappingPath", false);
50 public static final Parameter<String> URI_ENCODING = new ParameterString("uriEncoding", "ISO-8859-1");
51 public static final Parameter<Collection<String>> PARSABLE_CONTENT_TYPES = new ParameterCollection(
52 "parsableContentTypes", "text/html", "application/xhtml+xml");
53
54 public static final Parameter<Integer> MAX_CONNECTIONS_PER_HOST = new ParameterInteger("maxConnectionsPerHost", 20);
55 public static final Parameter<Integer> CONNECT_TIMEOUT = new ParameterInteger("connectTimeout", 1000);
56 public static final Parameter<Integer> SOCKET_TIMEOUT = new ParameterInteger("socketTimeout", 10000);
57
58 public static final Parameter<String> PROXY_HOST = new ParameterString("proxyHost");
59 public static final Parameter<Integer> PROXY_PORT = new ParameterInteger("proxyPort", 0);
60 public static final Parameter<String> PROXY_USER = new ParameterString("proxyUser");
61 public static final Parameter<String> PROXY_PASSWORD = new ParameterString("proxyPassword");
62
63 public static final Parameter<Boolean> PRESERVE_HOST = new ParameterBoolean("preserveHost", true);
64
65 public static final Parameter<String> COOKIE_MANAGER = new ParameterString("cookieManager",
66 DefaultCookieManager.class.getName());
67 public static final Parameter<Collection<String>> DISCARD_COOKIES = new ParameterCollection("discardCookies");
68 public static final Parameter<Collection<String>> STORE_COOKIES_IN_SESSION = new ParameterCollection(
69 "storeCookiesInSession");
70 public static final Parameter<String> VISIBLE_URL_BASE = new ParameterString("visibleUrlBase");
71
72 public static final String STICKYSESSION = "stickysession";
73 public static final String IPHASH = "iphash";
74 public static final String ROUNDROBIN = "roundrobin";
75
76 public static final Parameter<String> REMOTE_URL_BASE_STRATEGY = new ParameterString("remoteUrlBaseStrategy",
77 Parameters.ROUNDROBIN);
78
79 public static final Parameter<Collection<String>> EXTENSIONS = new ParameterCollection("extensions",
80 FragmentLogging.class.getName(), FetchLogging.class.getName(),
81 RemoteUserAuthenticationHandler.class.getName(), Esi.class.getName(), ResourceFixup.class.getName(),
82 XPoweredBy.class.getName(), Surrogate.class.getName(), ConfigReloadOnChange.class.getName());
83
84 public static final Parameter<Boolean> USE_CACHE = new ParameterBoolean("useCache", true);
85 public static final Parameter<Integer> MAX_CACHE_ENTRIES = new ParameterInteger("maxCacheEntries", 1000);
86 public static final Parameter<Integer> MAX_OBJECT_SIZE = new ParameterInteger("maxObjectSize", 1000000);
87 public static final Parameter<String> CACHE_STORAGE = new ParameterString("cacheStorage",
88 BasicCacheStorage.class.getName());
89 public static final Parameter<Boolean> X_CACHE_HEADER = new ParameterBoolean("xCacheHeader", false);
90 public static final Parameter<Boolean> VIA_HEADER = new ParameterBoolean("viaHeader", true);
91
92 public static final Parameter<Integer> TTL = new ParameterInteger("ttl", 0);
93
94 public static final Parameter<Boolean> HEURISTIC_CACHING_ENABLED = new ParameterBoolean("heuristicCachingEnabled",
95 true);
96
97
98 public static final Parameter<Float> HEURISTIC_COEFFICIENT = new ParameterFloat("heuristicCoefficient", 0.1f);
99
100 public static final Parameter<Integer> HEURISTIC_DEFAULT_LIFETIME_SECS = new ParameterInteger(
101 "heuristicDefaultLifetimeSecs", 0);
102
103 public static final Parameter<Integer> STALE_WHILE_REVALIDATE = new ParameterInteger("staleWhileRevalidate", 0);
104 public static final Parameter<Integer> STALE_IF_ERROR = new ParameterInteger("staleIfError", 0);
105 public static final Parameter<Integer> MIN_ASYNCHRONOUS_WORKERS = new ParameterInteger("minAsynchronousWorkers", 0);
106 public static final Parameter<Integer> MAX_ASYNCHRONOUS_WORKERS = new ParameterInteger("maxAsynchronousWorkers", 0);
107 public static final Parameter<Integer> ASYNCHRONOUS_WORKER_IDLE_LIFETIME_SECS = new ParameterInteger(
108 "asynchronousWorkerIdleLifetimeSecs", 60);
109 public static final Parameter<Integer> MAX_UPDATE_RETRIES = new ParameterInteger("maxUpdateRetries", 1);
110 public static final Parameter<Integer> REVALIDATION_QUEUE_SIZE = new ParameterInteger("revalidationQueueSize", 100);
111
112 public static final Parameter<String> EHCACHE_CACHE_NAME_PROPERTY = new ParameterString("ehcache.cacheName",
113 "esigate");
114 public static final Parameter<String> EHCACHE_CONFIGURATION_FILE_PROPERTY = new ParameterString(
115 "ehcache.configurationFile");
116
117 public static final Parameter<Collection<String>> MEMCACHED_SERVERS_PROPERTY = new ParameterCollection(
118 "memcached.servers");
119
120 public static final int DEFAULT_BUFFER_SIZE = 1024;
121
122 public static final int SMALL_BUFFER_SIZE = 256;
123
124 private Parameters() {
125
126 }
127 }