com.google.gwt.ajaxloader.client
Class AjaxKeyRepository

java.lang.Object
  extended by com.google.gwt.ajaxloader.client.AjaxKeyRepository

public class AjaxKeyRepository
extends java.lang.Object

Stores keys for different locations (hostname:port). The AjaxLoader class can lookup a key from this repository if not otherwise specified. This repository can be helpful for web sites that respond to requests for multiple domains (or by name and IP address), or to run your application on multiple servers (say development, test, and production) and store the set of valid keys compiled into the application. You can specify these keys in multiple ways: - You can create a com/google/gwt/ajaxloader/client/AjaxKeyConstants.properties file with the following format: localhost\:8080 = ABQIAAAAG8LzhtshQCjpSshU_uJjm\ xTwM0brOpm-All5BF6PoaKBxRWWERTZER2lJ4GnsG8nvhKLOQ20degaEQ 127.0.0.1\:8080 = ABQIAAAAG8LzhtshQCjpSshU_uJjm\ xTBfUk9TZrBRaIteybtnU2KziHEpRQvhPNTjo7DMczjrRD3yBPRJ_BSQQ example.com\:8080 = ABQIAAAAG8LzhU_uJjmhtshQCjpSs\ 3yBPRJ_BSQQxTBfUk9TZrBRaIteybtnU2KziHEpRQvhPNTjo7DMczjrRD ajaxKeys = localhost\:8080, 127.0.0.1\:8080 example.com\:8080 - You can specify an instance of AjaxKeyConstants to the setKeys(AjaxKeyConstants) method. - You can load keys at runtime with the putKey(String, String) method.


Method Summary
static java.lang.String getKey()
          Retrieve an Ajax API key given the current location.
static java.lang.String getKey(java.lang.String location)
          Retrieve an Ajax API Key given the hostname:port value.
static void putKey(java.lang.String location, java.lang.String ajaxApiKey)
          Associates a a hostname:port with an Ajax API key.
static void setKeys(AjaxKeyConstants keys)
          Override the default key properties with your own custom subclass.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getKey

public static java.lang.String getKey()
Retrieve an Ajax API key given the current location.


getKey

public static java.lang.String getKey(java.lang.String location)
Retrieve an Ajax API Key given the hostname:port value.

Parameters:
location - hostname:port string

putKey

public static void putKey(java.lang.String location,
                          java.lang.String ajaxApiKey)
Associates a a hostname:port with an Ajax API key.

Parameters:
location - hostname:port value
ajaxApiKey - the key registered for the above hostname:port combo

setKeys

public static void setKeys(AjaxKeyConstants keys)
Override the default key properties with your own custom subclass. Note that calling this method will invalidate any keys set with putKey or any defaults compiled into the library.

Parameters:
keys - an extension of the AjaxKeyConstants interface to override the defaults.