/** * Check whether we need to generate a response for this request. Set the necessary headers on the response, and if * we don't need to provide content, set the response status to 304. * * If this method returns true, the caller should not perform any more processing on the request. * * @return true if we don't need to provide any data to satisfy this request */ public boolean checkRequest(HttpServletRequest request, HttpServletResponse response) { return checkRequest(request, response, etag); }
/** * This static method is used when the resource being served by the servlet keeps track of the object hashcode, * and so no state needs to be maintained by this handler. */ public static boolean checkRequest(HttpServletRequest request, HttpServletResponse response, int hashCode) { return checkRequest(request, response, calculateEtag(hashCode)); }
private void processPeerResponse(final HttpServletRequest request, final HttpServletResponse response, final ApplicationLink link) throws IOException { // returned from peer final RendererContextBuilder contextBuilder = new RendererContextBuilder(); if (!peerWasSuccessful(request)) { contextBuilder.put("error", messageFactory.newI18nMessage("auth.trusted.config.consumer.save.peer.failed", request.getParameter("message"))); } render(link, request, response, contextBuilder.build()); }
/** * ONLY to be used if the caller is <strong>certain</strong> that the base and path will form a valid URI when concatenated. */ public static URI uncheckedConcatenateAndToUri(final String base, final String... paths) { return uncheckedToUri(concatenate(base, paths)); }
public boolean responseShouldRedirect(final Response response) { return isRedirectStatusCode(response) && hasLocation(response) && notExceededMaximumRedirects(); }
public URI getUrl() { return URIUtil.copyOf(url); }
public String uriEncode(final String url) { return URIUtil.encodeWithinQuery(url); }
public AbstractApplicationLinkResponseHandler(String url, ApplicationLinkRequest wrappedRequest, boolean followRedirects) { this.wrappedRequest = wrappedRequest; this.followRedirects = followRedirects; this.redirectHelper = new RedirectHelper(url); } }
public URI getDocumentationBaseUrl() { return URIUtil.uncheckedCreate("http://confluence.atlassian.com/display/APPLINKS"); }
public HashChangedHandler(int hashCode) { modified(hashCode); }
private void modified(int hashCode) { etag = calculateEtag(hashCode); }
/** * ONLY to be used if the caller is <strong>certain</strong> that the base and path will form a valid URI when concatenated. */ public static URI uncheckedConcatenateAndToUri(final String base, final String... paths) { return uncheckedToUri(concatenate(base, paths)); }
public boolean responseShouldRedirect(final Response response) { return isRedirectStatusCode(response) && hasLocation(response) && notExceededMaximumRedirects(); }
public URI getDisplayUrl() { return copyOf(displayUrl); }
public String uriEncode(final String url) { return URIUtil.encodeWithinQuery(url); }
public URI getUrl() { return URIUtil.copyOf(url); }
public String uriEncode(final String url) { return URIUtil.encodeWithinQuery(url); }
public URI getUrl() { return URIUtil.copyOf(url); }
public String uriEncode(final String url) { return URIUtil.encodeWithinQuery(url); }