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

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

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

origin: org.gatein.shindig/shindig-gadgets

@Override
public boolean getIgnoreCache() {
 return request.getIgnoreCache();
}
origin: org.apache.shindig/shindig-gadgets

@Override
public boolean getIgnoreCache() {
 return request.getIgnoreCache();
}
origin: com.lmco.shindig/shindig-gadgets

@Override
public boolean getIgnoreCache() {
 return request.getIgnoreCache();
}
origin: org.apache.shindig/shindig-gadgets

@Override
public boolean getIgnoreCache() {
 return request.getIgnoreCache();
}
origin: org.apache.shindig/shindig-gadgets

/**
 * Check the HttpRequest object has already allow caching and if do try to get it from cache.
 * Override this if you want to add additional logic to get response for the request from cache.
 *
 * @param request
 * @return HttpResponse object which either the cached response or null
 */
protected HttpResponse checkCachedResponse(HttpRequest request) {
 HttpResponse cachedResponse;
 if (!request.getIgnoreCache()) {
  cachedResponse = httpCache.getResponse(request);
 } else {
  cachedResponse = null;
 }
 return cachedResponse;
}
origin: com.lmco.shindig/shindig-gadgets

protected boolean isCacheable(HttpRequest request) {
 if (request.getIgnoreCache()) {
  return false;
 }
 return ("GET".equals(request.getMethod()) ||
     "GET".equals(request.getHeader("X-Method-Override")));
}
origin: org.gatein.shindig/shindig-gadgets

protected boolean isCacheable(HttpRequest request) {
 if (request.getIgnoreCache()) {
  return false;
 }
 return ("GET".equals(request.getMethod()) ||
     "GET".equals(request.getHeader("X-Method-Override")));
}
origin: org.apache.shindig/shindig-gadgets

protected boolean isCacheable(HttpRequest request) {
 if (request.getIgnoreCache()) {
  return false;
 }
 return ("GET".equals(request.getMethod()) ||
     "GET".equals(request.getHeader("X-Method-Override")));
}
origin: org.apache.shindig/shindig-gadgets

public Config get(HttpRequest request) {
 GadgetSpec spec;
 final Uri gadgetUrl = request.getGadget();
 final boolean isIgnoreCache = request.getIgnoreCache();
 if (gadgetUrl != null) {
  try {
   GadgetContext context = new GadgetContext() {
    @Override
    public Uri getUrl() {
     return gadgetUrl;
    }
    @Override
    public boolean getIgnoreCache() {
     return isIgnoreCache;
    }
   };
   spec = specFactory.getGadgetSpec(context);
   if (spec != null) {
    return get(spec);
   }
  } catch (GadgetException ge) {
   // Falls through to default.
  }
 }
 return defaultConfig.get();
}
origin: org.apache.shindig/shindig-gadgets

/**
 * Cache the HttpResponse object before being returned to caller.
 * The default implementation also invalidate the response object by marking it as valid so the
 * next request can detect if it has been invalidated.
 * Override this if you need to add additional processing to cache the response.
 *
 * @param request
 * @param fetchedResponse
 * @return HttpResponse object that has been updated with some metadata tags.
 */
protected HttpResponse cacheFetchedResponse(HttpRequest request, HttpResponse fetchedResponse) {
 if (!request.getIgnoreCache()) {
  // Mark the response with invalidation information prior to caching
  if (fetchedResponse.getCacheTtl() > 0) {
   fetchedResponse = invalidationService.markResponse(request, fetchedResponse);
  }
  HttpResponse cached = httpCache.addResponse(request, fetchedResponse);
  if (cached != null) {
   fetchedResponse = cached; // possibly modified response.
  }
 }
 return fetchedResponse;
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

@Override
public boolean equals(Object obj) {
 if (obj == this) {
  return true;
 }
 if (!(obj instanceof HttpRequest)) {
  return false;
 }
 HttpRequest req = (HttpRequest)obj;
 return super.equals(obj) && req.getCacheTtl() == getCacheTtl() &&
     req.getIgnoreCache() == getIgnoreCache();
}
origin: org.apache.shindig/shindig-gadgets

@Override
public boolean equals(Object obj) {
 if (obj == this) {
  return true;
 }
 if (!(obj instanceof HttpRequest)) {
  return false;
 }
 HttpRequest req = (HttpRequest)obj;
 return super.equals(obj) && req.getCacheTtl() == getCacheTtl() &&
     req.getIgnoreCache() == getIgnoreCache();
}
origin: com.lmco.shindig/shindig-gadgets

@Override
public boolean equals(Object obj) {
 if (obj == this) {
  return true;
 }
 if (!(obj instanceof HttpRequest)) {
  return false;
 }
 HttpRequest req = (HttpRequest)obj;
 return super.equals(obj) && req.getCacheTtl() == getCacheTtl() &&
     req.getIgnoreCache() == getIgnoreCache();
}
origin: org.apache.shindig/shindig-gadgets

@Test
public void normalPreloads() throws Exception {
 String xml =
   "<Module><ModulePrefs title=''>" +
   " <Preload href='" + PRELOAD_HREF + "'/>" +
   "</ModulePrefs><Content/></Module>";
 GadgetSpec spec = new GadgetSpec(GADGET_URL, xml);
 Preloader preloader = new HttpPreloader(requestPipeline);
 Gadget gadget = new Gadget()
   .setContext(context)
   .setSpec(spec)
   .setCurrentView(spec.getView(GadgetSpec.DEFAULT_VIEW));
 Collection<Callable<PreloadedData>> preloaded =
   preloader.createPreloadTasks(gadget);
 assertEquals(1, preloaded.size());
 PreloadedData data = preloaded.iterator().next().call();
 checkRequest(plainFetcher.requests.get(0));
 assertFalse("request should not ignore cache", plainFetcher.requests.get(0).getIgnoreCache());
 checkResults(data.toJson().iterator().next());
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

@Test
public void normalPreloads() throws Exception {
 String xml =
   "<Module><ModulePrefs title=''>" +
   " <Preload href='" + PRELOAD_HREF + "'/>" +
   "</ModulePrefs><Content/></Module>";
 GadgetSpec spec = new GadgetSpec(GADGET_URL, xml);
 Preloader preloader = new HttpPreloader(requestPipeline);
 Gadget gadget = new Gadget()
   .setContext(context)
   .setSpec(spec)
   .setCurrentView(spec.getView(GadgetSpec.DEFAULT_VIEW));
 Collection<Callable<PreloadedData>> preloaded =
   preloader.createPreloadTasks(gadget);
 assertEquals(1, preloaded.size());
 PreloadedData data = preloaded.iterator().next().call();
 checkRequest(plainFetcher.requests.get(0));
 assertFalse("request should not ignore cache", plainFetcher.requests.get(0).getIgnoreCache());
 checkResults(data.toJson().iterator().next());
}
origin: com.lmco.shindig/shindig-gadgets

@Test
public void normalPreloads() throws Exception {
 String xml =
   "<Module><ModulePrefs title=''>" +
   " <Preload href='" + PRELOAD_HREF + "'/>" +
   "</ModulePrefs><Content/></Module>";
 GadgetSpec spec = new GadgetSpec(GADGET_URL, xml);
 Preloader preloader = new HttpPreloader(requestPipeline);
 Gadget gadget = new Gadget()
   .setContext(context)
   .setSpec(spec)
   .setCurrentView(spec.getView(GadgetSpec.DEFAULT_VIEW));
 Collection<Callable<PreloadedData>> preloaded =
   preloader.createPreloadTasks(gadget);
 assertEquals(1, preloaded.size());
 PreloadedData data = preloaded.iterator().next().call();
 checkRequest(plainFetcher.requests.get(0));
 assertFalse("request should not ignore cache", plainFetcher.requests.get(0).getIgnoreCache());
 checkResults(data.toJson().iterator().next());
}

origin: com.lmco.shindig/shindig-gadgets

@Test
public void ignoreCachePreloads() throws Exception {
 String xml =
   "<Module><ModulePrefs title=''>" +
   " <Preload href='" + PRELOAD_HREF + "' authz='signed' sign_viewer='false'/>" +
   "</ModulePrefs><Content/></Module>";
 GadgetSpec spec = new GadgetSpec(GADGET_URL, xml);
 Preloader preloader = new HttpPreloader(requestPipeline);
 
 ignoreCache = true;
 
 Gadget gadget = new Gadget()
   .setContext(context)
   .setSpec(spec)
   .setCurrentView(spec.getView(GadgetSpec.DEFAULT_VIEW));
 Collection<Callable<PreloadedData>> preloaded =
   preloader.createPreloadTasks(gadget);
 assertEquals(1, preloaded.size());
 preloaded.iterator().next().call();
 HttpRequest request = oauthFetcher.requests.get(0);
 assertTrue("request should ignore cache", request.getIgnoreCache());
 checkRequest(request);
}
origin: org.apache.shindig/shindig-gadgets

@Test
public void ignoreCachePreloads() throws Exception {
 String xml =
   "<Module><ModulePrefs title=''>" +
   " <Preload href='" + PRELOAD_HREF + "' authz='signed' sign_viewer='false'/>" +
   "</ModulePrefs><Content/></Module>";
 GadgetSpec spec = new GadgetSpec(GADGET_URL, xml);
 Preloader preloader = new HttpPreloader(requestPipeline);
 ignoreCache = true;
 Gadget gadget = new Gadget()
   .setContext(context)
   .setSpec(spec)
   .setCurrentView(spec.getView(GadgetSpec.DEFAULT_VIEW));
 Collection<Callable<PreloadedData>> preloaded =
   preloader.createPreloadTasks(gadget);
 assertEquals(1, preloaded.size());
 preloaded.iterator().next().call();
 HttpRequest request = oauthFetcher.requests.get(0);
 assertTrue("request should ignore cache", request.getIgnoreCache());
 checkRequest(request);
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

@Test
public void ignoreCachePreloads() throws Exception {
 String xml =
   "<Module><ModulePrefs title=''>" +
   " <Preload href='" + PRELOAD_HREF + "' authz='signed' sign_viewer='false'/>" +
   "</ModulePrefs><Content/></Module>";
 GadgetSpec spec = new GadgetSpec(GADGET_URL, xml);
 Preloader preloader = new HttpPreloader(requestPipeline);
 ignoreCache = true;
 Gadget gadget = new Gadget()
   .setContext(context)
   .setSpec(spec)
   .setCurrentView(spec.getView(GadgetSpec.DEFAULT_VIEW));
 Collection<Callable<PreloadedData>> preloaded =
   preloader.createPreloadTasks(gadget);
 assertEquals(1, preloaded.size());
 preloaded.iterator().next().call();
 HttpRequest request = oauthFetcher.requests.get(0);
 assertTrue("request should ignore cache", request.getIgnoreCache());
 checkRequest(request);
}
origin: org.apache.shindig/shindig-gadgets

@Test
public void testTemplateRequestAnonymousSecurityToken() throws GadgetException {
 CapturingPipeline pipeline = new CapturingPipeline();
 TemplateLibraryFactory factory = new TemplateLibraryFactory( pipeline, null );
 GadgetContext context = new GadgetContext() {
  @Override
  public Uri getUrl() {
   return SPEC_URL;
  }
  @Override
  public String getContainer() {
   return "default";
  }
  @Override
  public boolean getDebug() {
   return false;
  }
  @Override
  public boolean getIgnoreCache() {
   return true;
  }
 };
 factory.loadTemplateLibrary(context, TEMPLATE_URL);
 assertNotNull( pipeline.request );
 SecurityToken st = pipeline.request.getSecurityToken();
 assertNotNull( st );
 assertTrue( st.isAnonymous() );
 assertEquals( SPEC_URL.toString(), st.getAppUrl() );
 assertTrue(pipeline.request.getIgnoreCache());
}
org.apache.shindig.gadgets.httpHttpRequestgetIgnoreCache

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
  • getMethod
  • getOAuthArguments
  • getParam
  • getOAuthArguments,
  • getParam,
  • getParamAsInteger,
  • getPostBody,
  • getPostBodyAsString,
  • getPostBodyLength,
  • getRewriteMimeType,
  • getSecurityToken,
  • getUri

Popular in Java

  • Updating database using SQL prepared statement
  • compareTo (BigDecimal)
  • getSystemService (Context)
  • runOnUiThread (Activity)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • JButton (javax.swing)
  • 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