Class RequestProxy
- java.lang.Object
-
- com.levigo.jadice.server.html.worker.request.RequestProxy
-
- All Implemented Interfaces:
org.lobobrowser.html.HttpRequest
public class RequestProxy extends Object implements org.lobobrowser.html.HttpRequest
Proxy that decides which realHttpRequest
implementation will be triggered due to the given URL and the flag if external http resources are allowed.
-
-
Constructor Summary
Constructors Constructor Description RequestProxy(org.lobobrowser.html.UserAgentContext context, Proxy proxy, StreamResolver resolver, boolean isAllowHTTPResources, QualifiedLogEventReceiver logEventReceiver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abort()
void
addReadyStateChangeListener(org.lobobrowser.html.ReadyStateChangeListener listener)
String
getAllResponseHeaders()
int
getReadyState()
URL
getRequestURL()
byte[]
getResponseBytes()
String
getResponseHeader(String headerName)
BufferedImage
getResponseImage()
String
getResponseText()
Document
getResponseXML()
int
getStatus()
String
getStatusText()
protected BufferedImage
imageInputStreamToBufferedImageViaJadice(com.levigo.jadice.document.io.SeekableInputStream seekableInputStream)
void
open(String method, String url)
void
open(String method, String url, boolean asyncFlag)
void
open(String method, URL url)
void
open(String method, URL url, boolean asyncFlag)
void
open(String method, URL url, boolean asyncFlag, String userName)
void
open(String method, URL url, boolean asyncFlag, String userName, String password)
void
send(String content)
-
-
-
Constructor Detail
-
RequestProxy
public RequestProxy(org.lobobrowser.html.UserAgentContext context, Proxy proxy, StreamResolver resolver, boolean isAllowHTTPResources, QualifiedLogEventReceiver logEventReceiver)
-
-
Method Detail
-
open
public void open(String method, URL url, boolean asyncFlag, String userName, String password) throws IOException
- Specified by:
open
in interfaceorg.lobobrowser.html.HttpRequest
- Throws:
IOException
-
abort
public void abort()
- Specified by:
abort
in interfaceorg.lobobrowser.html.HttpRequest
-
addReadyStateChangeListener
public void addReadyStateChangeListener(org.lobobrowser.html.ReadyStateChangeListener listener)
- Specified by:
addReadyStateChangeListener
in interfaceorg.lobobrowser.html.HttpRequest
-
getAllResponseHeaders
public String getAllResponseHeaders()
- Specified by:
getAllResponseHeaders
in interfaceorg.lobobrowser.html.HttpRequest
-
getReadyState
public int getReadyState()
- Specified by:
getReadyState
in interfaceorg.lobobrowser.html.HttpRequest
-
getResponseBytes
public byte[] getResponseBytes()
- Specified by:
getResponseBytes
in interfaceorg.lobobrowser.html.HttpRequest
-
getResponseHeader
public String getResponseHeader(String headerName)
- Specified by:
getResponseHeader
in interfaceorg.lobobrowser.html.HttpRequest
-
getResponseImage
public BufferedImage getResponseImage()
- Specified by:
getResponseImage
in interfaceorg.lobobrowser.html.HttpRequest
-
imageInputStreamToBufferedImageViaJadice
protected BufferedImage imageInputStreamToBufferedImageViaJadice(com.levigo.jadice.document.io.SeekableInputStream seekableInputStream)
-
getResponseText
public String getResponseText()
- Specified by:
getResponseText
in interfaceorg.lobobrowser.html.HttpRequest
-
getResponseXML
public Document getResponseXML()
- Specified by:
getResponseXML
in interfaceorg.lobobrowser.html.HttpRequest
-
getStatus
public int getStatus()
- Specified by:
getStatus
in interfaceorg.lobobrowser.html.HttpRequest
-
getStatusText
public String getStatusText()
- Specified by:
getStatusText
in interfaceorg.lobobrowser.html.HttpRequest
-
open
public void open(String method, String url) throws IOException
- Specified by:
open
in interfaceorg.lobobrowser.html.HttpRequest
- Throws:
IOException
-
open
public void open(String method, URL url) throws IOException
- Specified by:
open
in interfaceorg.lobobrowser.html.HttpRequest
- Throws:
IOException
-
open
public void open(String method, URL url, boolean asyncFlag) throws IOException
- Specified by:
open
in interfaceorg.lobobrowser.html.HttpRequest
- Throws:
IOException
-
open
public void open(String method, String url, boolean asyncFlag) throws IOException
- Specified by:
open
in interfaceorg.lobobrowser.html.HttpRequest
- Throws:
IOException
-
open
public void open(String method, URL url, boolean asyncFlag, String userName) throws IOException
- Specified by:
open
in interfaceorg.lobobrowser.html.HttpRequest
- Throws:
IOException
-
send
public void send(String content) throws IOException
- Specified by:
send
in interfaceorg.lobobrowser.html.HttpRequest
- Throws:
IOException
-
getRequestURL
public URL getRequestURL()
- Specified by:
getRequestURL
in interfaceorg.lobobrowser.html.HttpRequest
-
-