Codota Logo
HttpRequest.setIgnoreCache
Code IndexAdd Codota 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)

  • Common ways to obtain HttpRequest
private void myMethod () {
HttpRequest h =
  • Codota IconUri uri;new HttpRequest(uri)
  • Codota IconString text;new HttpRequest(Uri.parse(text))
  • Codota IconUri uri;AuthType authType;new HttpRequest(uri).setAuthType(authType)
  • Smart code suggestions by Codota
}
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

private static HttpRequest createIgnoreCacheRequest() {
 return new HttpRequest(SPEC_URL)
   .setIgnoreCache(true)
   .setGadget(SPEC_URL)
   .setContainer(ContainerConfig.DEFAULT_CONTAINER);
}
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: 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 post requests using okhttp
  • getExternalFilesDir (Context)
  • findViewById (Activity)
  • getApplicationContext (Context)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • BoxLayout (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now