Package com.atlassian.bamboo.util
Class RequestCacheThreadLocal
java.lang.Object
com.atlassian.bamboo.util.RequestCacheThreadLocal
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic voidThis method should only be called from the RequestCacheThreadLocalFilterstatic @Nullable Stringstatic @NotNull javax.servlet.http.HttpServletRequeststatic @NotNull javax.servlet.http.HttpServletResponsestatic @Nullable javax.servlet.http.HttpServletRequeststatic @Nullable javax.servlet.http.HttpServletResponsestatic voidsetRequestCache(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) Initialise the threadlocal request cache.static voidupdate(@NotNull javax.servlet.http.HttpServletRequest request)
-
Field Details
-
CONTEXT_PATH_KEY
- See Also:
-
-
Method Details
-
getRequestCache
-
setRequestCache
public static void setRequestCache(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) Initialise the threadlocal request cache.- Throws:
IllegalArgumentException- in case XSS is suspected in the request
-
clearRequestCache
public static void clearRequestCache()This method should only be called from the RequestCacheThreadLocalFilter -
getContextPath
-
getRequest
@Nullable public static @Nullable javax.servlet.http.HttpServletRequest getRequest() -
getResponse
@Nullable public static @Nullable javax.servlet.http.HttpServletResponse getResponse() -
canRequestMutateState
public static boolean canRequestMutateState()- Returns:
- true iff we are in a request context and the request is allowed to mutate state
-
update
public static void update(@NotNull @NotNull javax.servlet.http.HttpServletRequest request) - Throws:
IllegalArgumentException- in case XSS is suspected in the request
-
getNonNullRequest
@NotNull public static @NotNull javax.servlet.http.HttpServletRequest getNonNullRequest() -
getNonNullResponse
@NotNull public static @NotNull javax.servlet.http.HttpServletResponse getNonNullResponse()- Returns:
- current
HttpServletResponse. ThrowsIllegalStateExceptionif called outside of HTTP request context
-