|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.shindig.gadgets.http.CacheKeyBuilder
public class CacheKeyBuilder
Builds the cache key object.
Takes extra care to build the cache keys that don't thrash persistent caches.
| Constructor Summary | |
|---|---|
CacheKeyBuilder()
|
|
| Method Summary | |
|---|---|
String |
build()
Inserting the keys from the parameter map only if the keys are defined, prevents thrashing the existing persistent caches at rolling restart of high-traffic servers. |
CacheKeyBuilder |
setLegacyParam(int index,
Object value)
Sets a legacy cache key parameter. |
CacheKeyBuilder |
setParam(String name,
Object value)
Sets a cache key parameter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CacheKeyBuilder()
| Method Detail |
|---|
public CacheKeyBuilder setLegacyParam(int index,
Object value)
The legacy cache key parameters have a fixed order. Since the cache key is not required to have all of the legacy parameters filled in, the index of the parameter must be given.
index - the index to place this parameter at; valid values are 0 to
- 1value - the object that determines the legacy parameter
public CacheKeyBuilder setParam(String name,
Object value)
Each parameter needs to be inserted in the cache key builder manually, so that the user has an option to select the parameters that need to become part of the key.
name - the parameter name; if null, the param will not be insertedvalue - the object that determines the value of the parameterpublic String build()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||