Tabnine Logo
HttpRequest.setIgnoreCache
Code IndexAdd Tabnine to your IDE (free)

How to use
setIgnoreCache
method
in
org.apache.shindig.gadgets.http.HttpRequest

Best Java code snippets using org.apache.shindig.gadgets.http.HttpRequest.setIgnoreCache (Showing top 20 results out of 315)

origin: com.lmco.shindig/shindig-gadgets

private static HttpRequest createIgnoreCacheRequest() {
 return new HttpRequest(SPEC_URL)
   .setIgnoreCache(true)
   .setGadget(SPEC_URL)
   .setContainer(ContainerConfig.DEFAULT_CONTAINER);
}
origin: org.apache.shindig/shindig-gadgets

@Test
public void ignoreCacheAddsPragmaHeader() throws Exception {
 HttpRequest request = new HttpRequest(DEFAULT_URI).setIgnoreCache(true);
 assertTrue("Pragma: no-cache not added when ignoreCache == true",
   request.getHeaders("Pragma").contains("no-cache"));
}
origin: org.apache.shindig/shindig-gadgets

private static HttpRequest createIgnoreCacheRequest() {
 return new HttpRequest(SPEC_URL)
   .setIgnoreCache(true)
   .setGadget(SPEC_URL)
   .setContainer(ContainerConfig.DEFAULT_CONTAINER);
}
origin: com.lmco.shindig/shindig-gadgets

@Test
public void ignoreCacheAddsPragmaHeader() throws Exception {
 HttpRequest request = new HttpRequest(DEFAULT_URI).setIgnoreCache(true);
 assertTrue("Pragma: no-cache not added when ignoreCache == true",
   request.getHeaders("Pragma").contains("no-cache"));
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

@Test
public void ignoreCacheAddsPragmaHeader() throws Exception {
 HttpRequest request = new HttpRequest(DEFAULT_URI).setIgnoreCache(true);
 assertTrue("Pragma: no-cache not added when ignoreCache == true",
   request.getHeaders("Pragma").contains("no-cache"));
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

private static HttpRequest createIgnoreCacheRequest() {
 return new HttpRequest(SPEC_URL)
   .setIgnoreCache(true)
   .setGadget(SPEC_URL)
   .setContainer(ContainerConfig.DEFAULT_CONTAINER);
}
origin: com.lmco.shindig/shindig-gadgets

@Test
public void addResponseIgnoreCache() {
 HttpRequest request = new HttpRequest(DEFAULT_URI)
   .setIgnoreCache(true);
 HttpResponse response = new HttpResponse("does not matter");
 assertFalse("response should not have been cached", cache.addResponse(request, response));
 assertEquals(0, cache.map.size());
}
origin: com.lmco.shindig/shindig-gadgets

@Test
public void getResponseIgnoreCache() {
 HttpRequest request = new HttpRequest(DEFAULT_URI);
 String key = cache.createKey(request);
 HttpResponse response = new HttpResponse("result");
 cache.map.put(key, response);
 request.setIgnoreCache(true);
 assertNull("Did not return null when ignoreCache was true", cache.getResponse(request));
}
origin: org.apache.shindig/shindig-gadgets

@Test
public void getResponseIgnoreCache() {
 HttpRequest request = new HttpRequest(DEFAULT_URI);
 String key = cache.createKey(request);
 HttpResponse response = new HttpResponse("result");
 cache.map.put(key, response);
 request.setIgnoreCache(true);
 assertNull("Did not return null when ignoreCache was true", cache.getResponse(request));
 extendedStrictNoCacheTtlCache.map.put(key, response);
 assertNull("Did not return null when ignoreCache was true",
       extendedStrictNoCacheTtlCache.getResponse(request));
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

@Test
public void getResponseIgnoreCache() {
 HttpRequest request = new HttpRequest(DEFAULT_URI);
 String key = cache.createKey(request);
 HttpResponse response = new HttpResponse("result");
 cache.map.put(key, response);
 request.setIgnoreCache(true);
 assertNull("Did not return null when ignoreCache was true", cache.getResponse(request));
 extendedStrictNoCacheTtlCache.map.put(key, response);
 assertNull("Did not return null when ignoreCache was true",
       extendedStrictNoCacheTtlCache.getResponse(request));
}
origin: org.apache.shindig/shindig-gadgets

@Test
public void addResponseIgnoreCache() {
 HttpRequest request = new HttpRequest(DEFAULT_URI)
   .setIgnoreCache(true);
 HttpResponse response = new HttpResponse("does not matter");
 assertNull("response should not have been cached", cache.addResponse(request, response));
 assertEquals(0, cache.map.size());
 assertNull("response should not have been cached",
       extendedStrictNoCacheTtlCache.addResponse(request, response));
 assertEquals(0, extendedStrictNoCacheTtlCache.map.size());
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

@Test
public void addResponseIgnoreCache() {
 HttpRequest request = new HttpRequest(DEFAULT_URI)
   .setIgnoreCache(true);
 HttpResponse response = new HttpResponse("does not matter");
 assertNull("response should not have been cached", cache.addResponse(request, response));
 assertEquals(0, cache.map.size());
 assertNull("response should not have been cached",
       extendedStrictNoCacheTtlCache.addResponse(request, response));
 assertEquals(0, extendedStrictNoCacheTtlCache.map.size());
}
origin: com.lmco.shindig/shindig-gadgets

@Test
public void testNoCache() throws Exception {
 String url = "http://example.org/file.evil";
 String domain = "example.org";
 setupProxyRequestMock(domain, url, true, -1, null, null);
 HttpRequest req = new HttpRequest(Uri.parse(url)).setIgnoreCache(true);
 HttpResponse resp = new HttpResponse("Hello");
 expect(pipeline.execute(req)).andReturn(resp);
 replay();
 proxyHandler.fetch(request);
 verify();
}
origin: com.lmco.shindig/shindig-gadgets

@Test
public void testWithBadTtl() throws Exception {
 String url = "http://example.org/file.evil";
 String domain = "example.org";
 setupProxyRequestMock(domain, url, false, -1, null, null);
 
 HttpRequest req = new HttpRequestCache(Uri.parse(url)).setCacheTtl(-1).setIgnoreCache(false);
 HttpResponse resp = new HttpResponse("Hello");
 expect(pipeline.execute(req)).andReturn(resp);
 replay();
 proxyHandler.fetch(request);
 verify();
}
origin: com.lmco.shindig/shindig-gadgets

@Test
public void testWithCache() throws Exception {
 String url = "http://example.org/file.evil";
 String domain = "example.org";
 setupProxyRequestMock(domain, url, false, 120, null, null);
 
 HttpRequest req = new HttpRequestCache(Uri.parse(url)).setCacheTtl(120).setIgnoreCache(false);
 HttpResponse resp = new HttpResponse("Hello");
 expect(pipeline.execute(req)).andReturn(resp);
 replay();
 proxyHandler.fetch(request);
 verify();
}
origin: com.lmco.shindig/shindig-gadgets

public static HttpRequest newHttpRequest(GadgetContext context,
  RequestAuthenticationInfo authenticationInfo) throws GadgetException {
 return new HttpRequest(authenticationInfo.getHref())
   .setSecurityToken(context.getToken())
   .setOAuthArguments(new OAuthArguments(authenticationInfo))
   .setAuthType(authenticationInfo.getAuthType())
   .setContainer(context.getContainer())
   .setGadget(context.getUrl())
   .setIgnoreCache(context.getIgnoreCache());
}
origin: org.gatein.shindig/shindig-gadgets

public static HttpRequest newHttpRequest(GadgetContext context,
  RequestAuthenticationInfo authenticationInfo) throws GadgetException {
 return new HttpRequest(authenticationInfo.getHref())
   .setSecurityToken(context.getToken())
   .setOAuthArguments(new OAuthArguments(authenticationInfo))
   .setAuthType(authenticationInfo.getAuthType())
   .setContainer(context.getContainer())
   .setGadget(context.getUrl())
   .setIgnoreCache(context.getIgnoreCache());
}
origin: org.apache.shindig/shindig-gadgets

public static HttpRequest newHttpRequest(GadgetContext context,
  RequestAuthenticationInfo authenticationInfo) throws GadgetException {
 return new HttpRequest(authenticationInfo.getHref())
   .setSecurityToken(context.getToken())
   .setOAuthArguments(new OAuthArguments(authenticationInfo))
   .setOAuth2Arguments(new OAuth2Arguments(authenticationInfo))
   .setAuthType(authenticationInfo.getAuthType())
   .setContainer(context.getContainer())
   .setGadget(context.getUrl())
   .setIgnoreCache(context.getIgnoreCache());
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

/**
 * Send an OAuth GET request to the given URL.
 */
public HttpResponse sendGet(String target) throws Exception {
 HttpRequest request = new HttpRequest(Uri.parse(target));
 request.setOAuthArguments(recallState());
 OAuthRequest dest = createRequest();
 request.setIgnoreCache(ignoreCache);
 request.setSecurityToken(securityToken);
 HttpResponse response = dest.fetch(request);
 saveState(response);
 return response;
}
origin: org.apache.shindig/shindig-gadgets

@Test
public void authTypeNoneIgnoreCache() throws Exception {
 HttpRequest request = new HttpRequest(DEFAULT_URI).setAuthType(AuthType.NONE).setIgnoreCache(
     true);
 HttpResponse fetched = new HttpResponse("fetched");
 fetcher.response = fetched;
 HttpResponse response = pipeline.execute(request);
 assertEquals(fetched, response);
 assertEquals(request, fetcher.request);
 assertEquals(0, cache.readCount);
 assertEquals(0, cache.writeCount);
 assertEquals(1, fetcher.fetchCount);
}
org.apache.shindig.gadgets.httpHttpRequestsetIgnoreCache

Popular methods of HttpRequest

  • <init>
    Clone an existing HttpRequest.
  • addHeader
    Add a single header to the request. If a value for the given name is already set, a second value is
  • getAuthType
  • getCacheTtl
  • getContainer
  • getFollowRedirects
  • getGadget
  • getHeader
  • getHeaders
  • getIgnoreCache
  • getMethod
  • getOAuthArguments
  • getMethod,
  • getOAuthArguments,
  • getParam,
  • getParamAsInteger,
  • getPostBody,
  • getPostBodyAsString,
  • getPostBodyLength,
  • getRewriteMimeType,
  • getSecurityToken,
  • getUri

Popular in Java

  • Making http requests using okhttp
  • setRequestProperty (URLConnection)
  • startActivity (Activity)
  • findViewById (Activity)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Join (org.hibernate.mapping)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now