Interface RedirectCache
- All Known Implementing Classes:
RedirectCache.Default
public interface RedirectCache
A cache for HTTP redirects.
For a request that is redirected, implementations may cache the redirected HTTP method and URI, so that following requests for the same original HTTP method and URI are performed using the redirected HTTP method and URI.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classDefault implementation ofRedirectCache.static final recordA cached redirect entry used for both source and target. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears all cached redirects.get(RedirectCache.MethodOriginTarget original) Returns a cached redirect for the given method and URI.voidput(RedirectCache.MethodOriginTarget original, int status, RedirectCache.MethodOriginTarget redirect) Caches a redirect.intsize()
-
Method Details
-
get
Returns a cached redirect for the given method and URI.
- Parameters:
original- the original method and URI- Returns:
- the redirect method and URI, or
nullif not found
-
put
void put(RedirectCache.MethodOriginTarget original, int status, RedirectCache.MethodOriginTarget redirect) Caches a redirect.
- Parameters:
original- the original method and URIredirect- the redirect method and URI
-
size
int size()- Returns:
- the number of cached redirects
-
clear
void clear()Clears all cached redirects.
-