com.google.gwt.user.client.rpc
Class RpcRequestBuilder

java.lang.Object
  extended by com.google.gwt.user.client.rpc.RpcRequestBuilder

public class RpcRequestBuilder
extends java.lang.Object

This class encapsulates the logic necessary to configure a RequestBuilder for use with an RPC proxy object. Users who wish to alter the specifics of the HTTP requests issued by RPC proxy objects may override the protected doXyz methods and pass an instance of the subclass to ServiceDefTarget.setRpcRequestBuilder(com.google.gwt.user.client.rpc.RpcRequestBuilder).


Field Summary
static java.lang.String CONTENT_TYPE_HEADER
          Used by doSetContentType(com.google.gwt.http.client.RequestBuilder, java.lang.String).
static java.lang.String MODULE_BASE_HEADER
          Used by doFinish(com.google.gwt.http.client.RequestBuilder).
static java.lang.String STRONG_NAME_HEADER
          Used by doFinish(com.google.gwt.http.client.RequestBuilder).
 
Constructor Summary
RpcRequestBuilder()
           
 
Method Summary
 RpcRequestBuilder create(java.lang.String serviceEntryPoint)
          Initialize the RpcRequestBuilder.
 RequestBuilder finish()
          This method must be called to return the RequestBuilder that the RPC request will be made with.
 RpcRequestBuilder setCallback(RequestCallback callback)
          Sets the RequestCallback to be used by the RequestBuilder.
 RpcRequestBuilder setContentType(java.lang.String contentType)
          Sets the MIME content type to be used by the RequestBuilder.
 RpcRequestBuilder setRequestData(java.lang.String data)
          Sets the request data to be sent in the request.
 RpcRequestBuilder setRequestId(int id)
          Sets the request id of the request.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_TYPE_HEADER

public static final java.lang.String CONTENT_TYPE_HEADER
Used by doSetContentType(com.google.gwt.http.client.RequestBuilder, java.lang.String).

See Also:
Constant Field Values

MODULE_BASE_HEADER

public static final java.lang.String MODULE_BASE_HEADER
Used by doFinish(com.google.gwt.http.client.RequestBuilder).

See Also:
Constant Field Values

STRONG_NAME_HEADER

public static final java.lang.String STRONG_NAME_HEADER
Used by doFinish(com.google.gwt.http.client.RequestBuilder).

See Also:
Constant Field Values
Constructor Detail

RpcRequestBuilder

public RpcRequestBuilder()
Method Detail

create

public final RpcRequestBuilder create(java.lang.String serviceEntryPoint)
Initialize the RpcRequestBuilder. This method must be called before any of the other methods in this class may be called. Calling create before calling finish() will reset the state of the RpcRequestBuilder.

This method delegates to doCreate(java.lang.String) to instantiate the RequestBuilder.

Parameters:
serviceEntryPoint - The URL entry point
Returns:
this
See Also:
ServiceDefTarget.setServiceEntryPoint(String)

finish

public final RequestBuilder finish()
This method must be called to return the RequestBuilder that the RPC request will be made with.

This method will call doFinish(com.google.gwt.http.client.RequestBuilder) before returning the current RequestBuilder.


setCallback

public final RpcRequestBuilder setCallback(RequestCallback callback)
Sets the RequestCallback to be used by the RequestBuilder. Delegates to doSetCallback(com.google.gwt.http.client.RequestBuilder, com.google.gwt.http.client.RequestCallback).

Parameters:
callback - the RequestCallback to be used by the RequestBuilder
Returns:
this

setContentType

public final RpcRequestBuilder setContentType(java.lang.String contentType)
Sets the MIME content type to be used by the RequestBuilder. Delegates to doSetContentType(com.google.gwt.http.client.RequestBuilder, java.lang.String).

Parameters:
contentType - the MIME content type to be used in the request
Returns:
this

setRequestData

public final RpcRequestBuilder setRequestData(java.lang.String data)
Sets the request data to be sent in the request. Delegates to doSetRequestData(com.google.gwt.http.client.RequestBuilder, java.lang.String).

Parameters:
data - the data to send
Returns:
this

setRequestId

public final RpcRequestBuilder setRequestId(int id)
Sets the request id of the request. Delegates to doSetRequestId(com.google.gwt.http.client.RequestBuilder, int).

Parameters:
id - the issue number of the request
Returns:
this