Class ApiProxyDelegate (2.0.0)

public class ApiProxyDelegate implements ApiProxy.Delegate<LazyApiProxyEnvironment>

Delegates AppEngine API calls to a local http API proxy.

Instances should be registered using ApiProxy.setDelegate(ApiProxy.Delegate).

Inheritance

java.lang.Object > ApiProxyDelegate

Implements

com.google.apphosting.api.ApiProxy.Delegate<com.google.appengine.setup.LazyApiProxyEnvironment>

Static Fields

API_DEADLINE_KEY

protected static final String API_DEADLINE_KEY
Field Value
Type Description
String

REQUEST_ENDPOINT

public static final String REQUEST_ENDPOINT
Field Value
Type Description
String

REQUEST_STUB_ID

public static final String REQUEST_STUB_ID
Field Value
Type Description
String

REQUEST_STUB_METHOD

public static final String REQUEST_STUB_METHOD
Field Value
Type Description
String

RPC_DEADLINE_HEADER

public static final String RPC_DEADLINE_HEADER
Field Value
Type Description
String

RPC_METHOD_HEADER

public static final String RPC_METHOD_HEADER
Field Value
Type Description
String

RPC_STUB_ID_HEADER

public static final String RPC_STUB_ID_HEADER
Field Value
Type Description
String

Constructors

ApiProxyDelegate()

public ApiProxyDelegate()

Fields

defaultTimeoutMs

protected int defaultTimeoutMs
Field Value
Type Description
int

executor

protected final ExecutorService executor
Field Value
Type Description
ExecutorService

httpclient

protected final HttpClient httpclient
Field Value
Type Description
org.apache.http.client.HttpClient

Methods

flushLogs(LazyApiProxyEnvironment environment)

public void flushLogs(LazyApiProxyEnvironment environment)
Parameter
Name Description
environment LazyApiProxyEnvironment

getRequestThreads(LazyApiProxyEnvironment environment)

public List<Thread> getRequestThreads(LazyApiProxyEnvironment environment)
Parameter
Name Description
environment LazyApiProxyEnvironment
Returns
Type Description
List<Thread>

log(LazyApiProxyEnvironment environment, ApiProxy.LogRecord record)

public void log(LazyApiProxyEnvironment environment, ApiProxy.LogRecord record)
Parameters
Name Description
environment LazyApiProxyEnvironment
record LogRecord

makeAsyncCall(LazyApiProxyEnvironment environment, String packageName, String methodName, byte[] request, ApiProxy.ApiConfig apiConfig)

public Future<byte[]> makeAsyncCall(LazyApiProxyEnvironment environment, String packageName, String methodName, byte[] request, ApiProxy.ApiConfig apiConfig)
Parameters
Name Description
environment LazyApiProxyEnvironment
packageName String
methodName String
request byte[]
apiConfig ApiConfig
Returns
Type Description
Future<byte[]>

makeSyncCall(LazyApiProxyEnvironment environment, String packageName, String methodName, byte[] requestData)

public byte[] makeSyncCall(LazyApiProxyEnvironment environment, String packageName, String methodName, byte[] requestData)
Parameters
Name Description
environment LazyApiProxyEnvironment
packageName String
methodName String
requestData byte[]
Returns
Type Description
byte[]
Exceptions
Type Description
ApiProxyException

runSyncCall(LazyApiProxyEnvironment environment, String packageName, String methodName, byte[] requestData, int timeoutMs)

protected byte[] runSyncCall(LazyApiProxyEnvironment environment, String packageName, String methodName, byte[] requestData, int timeoutMs)
Parameters
Name Description
environment LazyApiProxyEnvironment
packageName String
methodName String
requestData byte[]
timeoutMs int
Returns
Type Description
byte[]