Class LocalURLFetchService
java.lang.Object
com.google.appengine.tools.development.AbstractLocalRpcService
com.google.appengine.api.urlfetch.dev.LocalURLFetchService
- All Implemented Interfaces:
LocalRpcService
@AutoService(LocalRpcService.class)
public class LocalURLFetchService
extends AbstractLocalRpcService
LocalURLFetchService fetches URLs using Apache HttpClient. This implementation should
only be used within the dev appserver environment.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.google.appengine.tools.development.LocalRpcService
LocalRpcService.Status -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.http.client.HttpClientcreateHttpClient(boolean validateHttps) fetch(LocalRpcService.Status status, URLFetchServicePb.URLFetchRequest request) Returns the maximum size of an encoded API request in bytes, ornullfor the default size.getMaximumDeadline(boolean isOfflineRequest) Return the maximum number of seconds that is allowed as a deadline for each API call.Returns the package for the service, for example, "datastore_v3".voidinit(LocalServiceContext context, Map<String, String> properties) Initializes the service with a set of configuration properties.voidsetTimeoutInMs(int timeoutInMs) voidstart()Puts a new service into "serving" mode.voidstop()Stops the service, releasing all of its resources.Methods inherited from class com.google.appengine.tools.development.AbstractLocalRpcService
getDefaultDeadline
-
Field Details
-
PACKAGE
The package name for this service.- See Also:
-
-
Constructor Details
-
LocalURLFetchService
public LocalURLFetchService()
-
-
Method Details
-
getPackage
Description copied from interface:LocalRpcServiceReturns the package for the service, for example, "datastore_v3".- Returns:
- a not
nullpackage name.
-
setTimeoutInMs
public void setTimeoutInMs(int timeoutInMs) -
createHttpClient
public org.apache.http.client.HttpClient createHttpClient(boolean validateHttps) -
init
Description copied from interface:LocalRpcServiceInitializes the service with a set of configuration properties. Must be called before a service isstarted.- Specified by:
initin interfaceLocalRpcService- Overrides:
initin classAbstractLocalRpcService- Parameters:
context- A context object for the applicationproperties- A read-onlyMapof properties.
-
start
public void start()Description copied from interface:LocalRpcServicePuts a new service into "serving" mode. Aside from setting properties, the service is not functional until after having been started.- Specified by:
startin interfaceLocalRpcService- Overrides:
startin classAbstractLocalRpcService
-
stop
public void stop()Description copied from interface:LocalRpcServiceStops the service, releasing all of its resources.- Specified by:
stopin interfaceLocalRpcService- Overrides:
stopin classAbstractLocalRpcService
-
fetch
public URLFetchServicePb.URLFetchResponse fetch(LocalRpcService.Status status, URLFetchServicePb.URLFetchRequest request) -
getMaximumDeadline
Description copied from interface:LocalRpcServiceReturn the maximum number of seconds that is allowed as a deadline for each API call. The user cannot request a deadline higher than this value. This method may returnnullif the service has no opinion about the maximum deadline, in which case a global maximum deadline will be used instead.- Specified by:
getMaximumDeadlinein interfaceLocalRpcService- Overrides:
getMaximumDeadlinein classAbstractLocalRpcService
-
getMaxApiRequestSize
Description copied from interface:LocalRpcServiceReturns the maximum size of an encoded API request in bytes, ornullfor the default size.- Specified by:
getMaxApiRequestSizein interfaceLocalRpcService- Overrides:
getMaxApiRequestSizein classAbstractLocalRpcService
-