org.apache.shindig.gadgets.uri
Class DefaultProxyUriManager

java.lang.Object
  extended by org.apache.shindig.gadgets.uri.DefaultProxyUriManager
All Implemented Interfaces:
ProxyUriManager

public class DefaultProxyUriManager
extends Object
implements ProxyUriManager

Generates URIs for use by the Shindig proxy service. URIs are generated on the host specified in ContainerConfig at key "gadgets.uri.proxy.host". The remainder of the URL may reference either chained or query-style proxy syntax. The former is used when "gadgets.uri.proxy.path" has token "%chained_params%" in it. Chained: Returned URI contains query params in its path, with the proxied resource's URI appended verbatim to the end. This enables proxied SWFs to perform proxied, relative-URI resource loads. Example: http://www.example.com/gadgets/proxy/refresh=1&.../http://www.foo.com/img.gif Query param: All params are provided on the query string. Example: http://www.example.com/gadgets/proxy?refresh=1&url=http://www.foo.com/img.gif&... This implementation supports batched versioning as well. The old-style "fp" (fingerprint) parameter is not supported any longer; its functionality is assumed to be subsumed into the version param.

Since:
2.0.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.shindig.gadgets.uri.ProxyUriManager
ProxyUriManager.ProxyUri, ProxyUriManager.Versioner
 
Field Summary
static String PROXY_HOST_PARAM
           
static String PROXY_PATH_PARAM
           
 
Constructor Summary
DefaultProxyUriManager(ContainerConfig config, ProxyUriManager.Versioner versioner)
           
 
Method Summary
 List<Uri> make(List<ProxyUriManager.ProxyUri> resources, Integer forcedRefresh)
          Generate a Uri that proxies the given resource Uri.
 ProxyUriManager.ProxyUri process(Uri uriIn)
          Parse and validate the proxied Uri.
 void setUseStrictParsing(boolean useStrict)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROXY_HOST_PARAM

public static final String PROXY_HOST_PARAM
See Also:
Constant Field Values

PROXY_PATH_PARAM

public static final String PROXY_PATH_PARAM
See Also:
Constant Field Values
Constructor Detail

DefaultProxyUriManager

@Inject
public DefaultProxyUriManager(ContainerConfig config,
                                     @Nullable
                                     ProxyUriManager.Versioner versioner)
Method Detail

setUseStrictParsing

@Inject(optional=true)
public void setUseStrictParsing(boolean useStrict)

make

public List<Uri> make(List<ProxyUriManager.ProxyUri> resources,
                      Integer forcedRefresh)
Description copied from interface: ProxyUriManager
Generate a Uri that proxies the given resource Uri.

Specified by:
make in interface ProxyUriManager
Parameters:
resources - Resource Uri to proxy
forcedRefresh - Forced expires value to use for resource
Returns:
Uri of proxied resource

process

public ProxyUriManager.ProxyUri process(Uri uriIn)
                                 throws GadgetException
Description copied from interface: ProxyUriManager
Parse and validate the proxied Uri.

Specified by:
process in interface ProxyUriManager
Parameters:
uriIn - A Uri presumed to be a proxied Uri generated by this class or in a compatible way
Returns:
Status of the Uri passed in
Throws:
GadgetException


Copyright © 2007-2012. All Rights Reserved.