org.apache.shindig.gadgets.uri
Class DefaultJsUriManager

java.lang.Object
  extended by org.apache.shindig.gadgets.uri.DefaultJsUriManager
All Implemented Interfaces:
JsUriManager

public class DefaultJsUriManager
extends Object
implements JsUriManager

Generates and validates URLs serviced by a gadget JavaScript service (JsServlet).


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.shindig.gadgets.uri.JsUriManager
JsUriManager.JsUri, JsUriManager.Versioner
 
Field Summary
protected static String JS_DELIMITER
           
protected static String JS_SUFFIX
           
 
Constructor Summary
DefaultJsUriManager(ContainerConfig config, JsUriManager.Versioner versioner)
           
 
Method Summary
protected  boolean addGadgetUri()
           
protected  void issueUriFormatError(String err)
           
 Uri makeExternJsUri(Gadget gadget, Collection<String> extern)
           
 JsUriManager.JsUri processExternJsUri(Uri uri)
          Essentially pulls apart a Uri created by makeExternJsUri, validating its contents, especially the version key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JS_SUFFIX

protected static final String JS_SUFFIX
See Also:
Constant Field Values

JS_DELIMITER

protected static final String JS_DELIMITER
See Also:
Constant Field Values
Constructor Detail

DefaultJsUriManager

@Inject
public DefaultJsUriManager(ContainerConfig config,
                                  JsUriManager.Versioner versioner)
Method Detail

makeExternJsUri

public Uri makeExternJsUri(Gadget gadget,
                           Collection<String> extern)
Specified by:
makeExternJsUri in interface JsUriManager
Parameters:
gadget - The gadget in which the requested JS will be externed.
extern - The list of features that js is needed for.
Returns:
The uri for the externed javascript that includes all listed extern libraries.

processExternJsUri

public JsUriManager.JsUri processExternJsUri(Uri uri)
                                      throws GadgetException
Essentially pulls apart a Uri created by makeExternJsUri, validating its contents, especially the version key.

Specified by:
processExternJsUri in interface JsUriManager
Parameters:
uri - Generated extern JS Uri
Returns:
Processed status of the provided Uri.
Throws:
GadgetException

issueUriFormatError

protected void issueUriFormatError(String err)
                            throws GadgetException
Throws:
GadgetException

addGadgetUri

protected boolean addGadgetUri()


Copyright © 2007-2012. All Rights Reserved.