Class UrlRequestTransport
- java.lang.Object
-
- com.google.web.bindery.requestfactory.vm.testing.UrlRequestTransport
-
- All Implemented Interfaces:
RequestTransport
public class UrlRequestTransport extends java.lang.Object implements RequestTransport
A trivial implementation of RequestTransport that uses aHttpURLConnection
. Details of the connection can be amended by overridingconfigureConnection(HttpURLConnection)
.This implementation only supports
http
andhttps
URLs. It has primitive support for recording and playing back cookies, but does not implement expiration processing.Developers who wish to build a more production-ready client should consider using a RequestTRansport based around Apache HttpClient instead.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.web.bindery.requestfactory.shared.RequestTransport
RequestTransport.TransportReceiver
-
-
Constructor Summary
Constructors Constructor Description UrlRequestTransport(java.net.URL url)
Construct a new UrlRequestTransport.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configureConnection(java.net.HttpURLConnection connection)
java.util.Map<java.lang.String,java.lang.String>
getCookies()
Provides access to the cookies that will be sent for subsequent requests.void
send(java.lang.String payload, RequestTransport.TransportReceiver receiver)
Called by the RequestFactory implementation.
-
-
-
Method Detail
-
getCookies
public java.util.Map<java.lang.String,java.lang.String> getCookies()
Provides access to the cookies that will be sent for subsequent requests.
-
send
public void send(java.lang.String payload, RequestTransport.TransportReceiver receiver)
Description copied from interface:RequestTransport
Called by the RequestFactory implementation.- Specified by:
send
in interfaceRequestTransport
- Parameters:
payload
- the String payloadreceiver
- theRequestTransport.TransportReceiver
instance that will receive the payload
-
configureConnection
protected void configureConnection(java.net.HttpURLConnection connection) throws java.io.IOException
- Throws:
java.io.IOException
-
-