|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.atmosphere.wasync.RequestBuilder<T>
public abstract class RequestBuilder<T extends RequestBuilder<T>>
Base class for building Request
| Field Summary | |
|---|---|
protected List<Decoder<?,?>> |
decoders
|
protected Class<T> |
derived
|
protected List<Encoder<?,?>> |
encoders
|
protected Map<String,Collection<String>> |
headers
|
protected Request.METHOD |
method
|
protected Map<String,List<String>> |
queryString
|
protected FunctionResolver |
resolver
|
protected List<Request.TRANSPORT> |
transports
|
protected String |
uri
|
| Constructor Summary | |
|---|---|
protected |
RequestBuilder(Class<T> derived)
|
| Method Summary | |
|---|---|
abstract Request |
build()
Build a Request. |
T |
decoder(Decoder d)
Add a Decoder. |
List<Decoder<?,?>> |
decoders()
Return the current list of Decoder |
T |
encoder(Encoder e)
Add an Encoder. |
List<Encoder<?,?>> |
encoders()
Return the current list of Encoder |
T |
header(String name,
String value)
Add a header. |
Map<String,Collection<String>> |
headers()
Return the current tMap of headers |
Request.METHOD |
method()
Return the HTTP method |
T |
method(Request.METHOD method)
The method to use for connecting tho the remote server. |
Map<String,List<String>> |
queryString()
Return the current query string/form param |
T |
queryString(String name,
String value)
Add a query param. |
FunctionResolver |
resolver()
Return the current FunctionResolver |
T |
resolver(FunctionResolver resolver)
Add a FunctionResolver |
T |
transport(Request.TRANSPORT t)
The Request.TRANSPORT to use. |
List<Request.TRANSPORT> |
transports()
Return the current list of Request.TRANSPORT |
String |
uri()
Return the uri |
T |
uri(String uri)
The URI to connect to. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final List<Request.TRANSPORT> transports
protected Request.METHOD method
protected String uri
protected final List<Encoder<?,?>> encoders
protected final List<Decoder<?,?>> decoders
protected final Map<String,Collection<String>> headers
protected final Map<String,List<String>> queryString
protected FunctionResolver resolver
protected final Class<T extends RequestBuilder<T>> derived
| Constructor Detail |
|---|
protected RequestBuilder(Class<T> derived)
| Method Detail |
|---|
public T transport(Request.TRANSPORT t)
Request.TRANSPORT to use. This method can be invoked several time and the library will loop over the list
until one Request.TRANSPORT succeed. The first added is always the first used.
t -
public T method(Request.METHOD method)
Request.METHOD.GET
method -
public T uri(String uri)
uri - a uri to connect to
public T encoder(Encoder e)
Encoder. Several Encoder can be added and will be invoked the order they were added. This method
doesn't allow duplicate.
e - an Encoder
public T decoder(Decoder d)
Decoder. Several Decoder can be added and will be invoked the order they were added. This method doesn't allow
duplicate.
d - a Decoder
public T header(String name,
String value)
name - header namevalue - header value
public T queryString(String name,
String value)
name - header namevalue - header value
public T resolver(FunctionResolver resolver)
FunctionResolver
resolver - a FunctionResolver
public abstract Request build()
Request. IMPORTANT: if you are using stateful Decoder, you must NOT call this method
more than once to prevent response corruption.
Requestpublic List<Request.TRANSPORT> transports()
Request.TRANSPORT
Request.TRANSPORTpublic Request.METHOD method()
public Map<String,Collection<String>> headers()
public Map<String,List<String>> queryString()
public List<Encoder<?,?>> encoders()
Encoder
Encoderpublic List<Decoder<?,?>> decoders()
Decoder
Decoderpublic String uri()
public FunctionResolver resolver()
FunctionResolver
FunctionResolver
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||