public final class ApiConfigDatastoreReader extends java.lang.Object implements ApiConfigSource
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ENDPOINT_CONFIGURATION_KIND |
static java.lang.String |
METHOD_CONFIGURATION_KIND |
| Constructor and Description |
|---|
ApiConfigDatastoreReader() |
ApiConfigDatastoreReader(com.google.appengine.api.datastore.DatastoreService datastoreService,
com.google.appengine.api.memcache.AsyncMemcacheService memcacheService) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isStaticConfig(ApiConfig config)
Returns
true iff configuration from this source is static and cannot change between
calls to this source. |
void |
loadEndpointClass(ServiceContext serviceContext,
java.lang.Class<?> endpointClass,
ApiConfig config)
Loads all configuration data for the endpoint class from the configuration source into
config. |
void |
loadEndpointMethods(ServiceContext serviceContext,
java.lang.Class<?> endpointClass,
ApiClassConfig.MethodConfigMap methodConfigMap)
Loads all configuration data for the methods of the endpoint class from the configuration
source into
methodConfigMap. |
public static final java.lang.String ENDPOINT_CONFIGURATION_KIND
public static final java.lang.String METHOD_CONFIGURATION_KIND
public ApiConfigDatastoreReader(com.google.appengine.api.datastore.DatastoreService datastoreService,
com.google.appengine.api.memcache.AsyncMemcacheService memcacheService)
public ApiConfigDatastoreReader()
public void loadEndpointClass(ServiceContext serviceContext, java.lang.Class<?> endpointClass, ApiConfig config) throws ApiConfigException
ApiConfigSourceconfig. Does not include configuration data for the endpoint methods.loadEndpointClass in interface ApiConfigSourceserviceContext - Provides context regarding GAE application settings.endpointClass - Class object whose configuration data is being loaded.config - Configuration as loaded so far with defaults and any already-read configurations.
The ApiConfigSource will overwrite any values with those set by its config source.ApiConfigExceptionpublic void loadEndpointMethods(ServiceContext serviceContext, java.lang.Class<?> endpointClass, ApiClassConfig.MethodConfigMap methodConfigMap)
ApiConfigSourcemethodConfigMap.loadEndpointMethods in interface ApiConfigSourceserviceContext - Provides context regarding GAE application settings.endpointClass - Class object whose configuration data is being loaded.methodConfigMap - A map of endpoint method to its configuration data. This data will
can be read and/or overwritten by this method.public boolean isStaticConfig(ApiConfig config)
ApiConfigSourcetrue iff configuration from this source is static and cannot change between
calls to this source. This would be true, for example, when the config is loaded from
annotations on the java classes.isStaticConfig in interface ApiConfigSourceconfig - Configuration as loaded so far with defaults and any already-read configurations.