org.apache.shindig.gadgets.uri
Class AllJsIframeVersioner

java.lang.Object
  extended by org.apache.shindig.gadgets.uri.AllJsIframeVersioner
All Implemented Interfaces:
IframeUriManager.Versioner

public class AllJsIframeVersioner
extends Object
implements IframeUriManager.Versioner

Simple, but naive, implementation of an IFRAME version generator that returns the same version value for all renders: the hash of all JS in the feature system. This serves as an implicit version of the whole build. While often a reasonable heuristic, use of this versioner completely ignores code changes. For instance, a rewriter may be deployed, yet if no JS changed, it would never run since a generated/versioned URL would cache the previously-generated render. More sophisticated Versioner implementations may take these sorts of scenarios into consideration, and even go further, retrieving the referenced gadget from the GadgetSpecFactory. Such an implementation's performance is highly installation-specific, however, so is left as an exercise to integrators to achieve effectively.


Constructor Summary
AllJsIframeVersioner(FeatureRegistry registry)
           
 
Method Summary
 UriStatus validate(Uri gadgetUri, String container, String value)
           
 String version(Uri gadgetUri, String container)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AllJsIframeVersioner

@Inject
public AllJsIframeVersioner(FeatureRegistry registry)
Method Detail

version

public String version(Uri gadgetUri,
                      String container)
Specified by:
version in interface IframeUriManager.Versioner
Parameters:
gadgetUri - Gadget whose content to version.
container - Container in which gadget is being rendered.
Returns:
Version string for the pair.

validate

public UriStatus validate(Uri gadgetUri,
                          String container,
                          String value)
Specified by:
validate in interface IframeUriManager.Versioner
Parameters:
gadgetUri - Gadget whose version to validate.
container - Container in which gadget is being rendered.
value - Previously returned version string for the pair.
Returns:
UriStatus indicating version (mis)match.


Copyright © 2007-2012. All Rights Reserved.