public class NetworkEvent extends EventObject
NetworkEvent
will be invoked if:
To reduce the cost of multiple method invocations, the event object will record the new data pertaining to the event. The object will only contain the data required for the given event. This implies that if the event was generated due to a progress change, then the other information will be invalid.
Modifier and Type | Field and Description |
---|---|
static int |
FAILED_CONNECT
Flag indicating that connection has failed.
|
static int |
FAILED_DNS
Flag indicating that DNS resolution has failed.
|
static int |
FAILED_TIMEOUT
Flag indicating that the connection timed out.
|
static int |
FAILED_USER_CANCEL
Flag indicating that the user canceled the connection.
|
static int |
STATUS_LOAD_ERROR
Flag indicating an error has occurred when loading the page.
|
static int |
STATUS_NEGOTIATING
Flag indicating the browser is awaiting authorization.
|
static int |
STATUS_REDIRECTING
Flag indicating the browser is being redirected.
|
static int |
STATUS_TRANSFERRING
Flag indicating that browser is transferring data from server.
|
source
Constructor and Description |
---|
NetworkEvent(Object source)
Constructor for NetworkEvent with a source.
|
NetworkEvent(Object source,
MutableRequestHeaders mrh) |
Modifier and Type | Method and Description |
---|---|
X509Certificate |
getCertificate()
Gets the X.509 Certificate.
|
int |
getCurrentProgress()
Returns the number of bytes currently downloaded.
|
String |
getExpectedFaviconURL()
Returns a favicon URL for this HTTP/HTTPS page load.
|
int |
getFailure()
Gets the failure status of the network error.
|
String |
getFrame()
Returns the strFrame.
|
int |
getMaximumProgress()
Returns the maximum number of bytes to download.
|
MutableRequestHeaders |
getMutableRequestHeaders()
Returns a MutableRequestHeaders object that allows
modification of the request headers for the current transaction.
|
String |
getRequestHeaders()
Returns the requestHeaders.
|
String |
getResponseHeaders()
Returns the responseHeaders.
|
int |
getStatus()
This will return a different status code based on which method
of the
NetworkEvent it is called from. |
String |
getStatusText()
Gets the status text
|
String |
getURL()
Returns the strURL.
|
void |
setCertificate(X509Certificate cert)
Sets the X.509 Certificate.
|
void |
setFailure(int flags)
Sets the failure status of the network error.
|
void |
setFaviconURL(String faviconUrl)
Set the URL.
|
void |
setFrame(String strFrame)
Sets the strFrame.
|
void |
setProgress(int current,
int maximum)
Sets the current and maximum number of bytes that will be downloaded for
the resource.
|
void |
setRequestHeaders(String requestHeaders)
Sets the requestHeaders.
|
void |
setResponseHeaders(String responseHeaders)
Sets the responseHeaders.
|
void |
setStatus(int flags)
Sets the network status.
|
void |
setStatusText(String string) |
void |
setURL(String strURL)
Sets the strURL.
|
getSource, toString
public static final int FAILED_DNS
public static final int FAILED_CONNECT
public static final int FAILED_TIMEOUT
public static final int FAILED_USER_CANCEL
public static final int STATUS_LOAD_ERROR
public static final int STATUS_REDIRECTING
public static final int STATUS_TRANSFERRING
public static final int STATUS_NEGOTIATING
public NetworkEvent(Object source)
EventObject.EventObject(Object)
public NetworkEvent(Object source, MutableRequestHeaders mrh)
public MutableRequestHeaders getMutableRequestHeaders()
public int getCurrentProgress()
public int getMaximumProgress()
public void setProgress(int current, int maximum)
current
- The current number of bytes downloaded.maximum
- The maximum number of bytes to download.public void setFailure(int flags)
flags
- Failure status defined using FAILED_
*public int getFailure()
FAILED_
*public void setStatus(int flags)
flags
- Network status defined using STATUS_
*public int getStatus()
NetworkEvent
it is called from.
From onHTTPResponse
: The HTTP status code will be
returned. E.g. 404
From onNetworkStatus
: The network status defined using
STATUS_
* will be returned.
public String getStatusText()
public void setStatusText(String string)
string
- public String getFrame()
public String getURL()
public void setFrame(String strFrame)
strFrame
- The strFrame to setpublic void setURL(String strURL)
strURL
- The strURL to setpublic String getRequestHeaders()
public String getResponseHeaders()
public void setRequestHeaders(String requestHeaders)
requestHeaders
- The requestHeaders to setpublic void setResponseHeaders(String responseHeaders)
responseHeaders
- The responseHeaders to setpublic X509Certificate getCertificate()
public void setCertificate(X509Certificate cert)
cert
- the X509Certificate to setpublic String getExpectedFaviconURL()
public void setFaviconURL(String faviconUrl)
url
- The URL.