|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.ajaxloader.client.AjaxKeyRepository
public class AjaxKeyRepository
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 |
---|
public static java.lang.String getKey()
public static java.lang.String getKey(java.lang.String location)
location
- hostname:port stringpublic static void putKey(java.lang.String location, java.lang.String ajaxApiKey)
location
- hostname:port valueajaxApiKey
- the key registered for the above hostname:port combopublic static void setKeys(AjaxKeyConstants keys)
keys
- an extension of the AjaxKeyConstants interface to override the
defaults.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |