public class RestDispatchAsyncModuleBuilder extends AbstractDispatchAsyncModule.Builder
RestDispatchAsyncModule
builder.
The possible configurations are:
AbstractDispatchAsyncModule.Builder
XSRF Token Header Name
:
A XsrfHeaderName
.
The default value is RestDispatchAsyncModule.DEFAULT_XSRF_NAME
.Serialization Implementation
: A Serialization
implementation.
The default is JsonSerialization
.Request timeout
: The number of milliseconds to wait for a request to complete.
The default value is 0 (no timeout).Constructor and Description |
---|
RestDispatchAsyncModuleBuilder() |
Modifier and Type | Method and Description |
---|---|
RestParameterBuilder |
addGlobalHeaderParam(String key)
Initiate the creation of a global header parameter that will be attached to all requests.
|
RestParameterBuilder |
addGlobalQueryParam(String key)
Initiate the creation of a global query parameter that will be attached to all requests.
|
RestDispatchAsyncModule |
build()
Build the
AbstractDispatchAsyncModule . |
RestDispatchAsyncModuleBuilder |
defaultDateFormat(String defaultDateFormat)
Specify the pattern to use to format dates before they are sent to the end-point.
|
String |
getDefaultDateFormat() |
Multimap<HttpMethod,RestParameter> |
getGlobalHeaderParams() |
Multimap<HttpMethod,RestParameter> |
getGlobalQueryParams() |
int |
getRequestTimeoutMs() |
Class<? extends Serialization> |
getSerializationClass() |
String |
getXsrfTokenHeaderName() |
RestDispatchAsyncModuleBuilder |
requestTimeout(int timeoutMs)
Specify the number of milliseconds to wait for a request to complete.
|
RestDispatchAsyncModuleBuilder |
serialization(Class<? extends Serialization> serializationClass)
Specify the serialization implementation to use.
|
RestDispatchAsyncModuleBuilder |
xcsrfTokenHeaderName(String xsrfTokenHeaderName)
Deprecated.
|
RestDispatchAsyncModuleBuilder |
xsrfTokenHeaderName(String xsrfTokenHeaderName)
Specify the XSRF token header name.
|
clientActionHandlerRegistry, dispatchHooks, exceptionHandler, sessionAccessor
public RestParameterBuilder addGlobalHeaderParam(String key)
key
- The key used for this parameterpublic RestParameterBuilder addGlobalQueryParam(String key)
key
- The key used for this parameterpublic RestDispatchAsyncModule build()
AbstractDispatchAsyncModule.Builder
AbstractDispatchAsyncModule
.build
in class AbstractDispatchAsyncModule.Builder
AbstractDispatchAsyncModule
.public RestDispatchAsyncModuleBuilder defaultDateFormat(String defaultDateFormat)
DateTimeFormat
.
Default is DateFormat.DEFAULT
.defaultDateFormat
- The pattern used to format dates.builder
object.public String getDefaultDateFormat()
public Multimap<HttpMethod,RestParameter> getGlobalHeaderParams()
public Multimap<HttpMethod,RestParameter> getGlobalQueryParams()
public int getRequestTimeoutMs()
public Class<? extends Serialization> getSerializationClass()
public String getXsrfTokenHeaderName()
public RestDispatchAsyncModuleBuilder requestTimeout(int timeoutMs)
AsyncCallback#onFailure(Throwable)
will be called.
Default is 0
: no timeout.timeoutMs
- The maximum time to wait, in milliseconds, or 0
for no timeout.builder
object.public RestDispatchAsyncModuleBuilder serialization(Class<? extends Serialization> serializationClass)
JsonSerialization
.serializationClass
- The Serialization
implementation to use.builder
object.@Deprecated public RestDispatchAsyncModuleBuilder xcsrfTokenHeaderName(String xsrfTokenHeaderName)
xsrfTokenHeaderName(String)
public RestDispatchAsyncModuleBuilder xsrfTokenHeaderName(String xsrfTokenHeaderName)
xsrfTokenHeaderName
- The XSRF token header name.builder
object.Copyright © 2010–2014 Arcbees. All rights reserved.