|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.EventObject com.webrenderer.se.event.NetworkEvent
public class NetworkEvent
An event which indicates that there has been network activity. Currently, a
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.
Field Summary | |
---|---|
protected int |
current
The current number of bytes downloaded for a resource. |
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 cancelled the connection. |
protected int |
failure
Failure status. |
protected int |
maximum
The maximum number of bytes that will be downloaded for a resource. |
protected MutableRequestHeaders |
mutableHeaders
|
protected boolean |
pendingLoads
|
protected int |
status
Request status. |
static int |
STATUS_NEGOTIATING
Flag indicating the browser is awaiting authorisation. |
static int |
STATUS_REDIRECTING
Flag indicating the browser is being redirected. |
static int |
STATUS_TRANSFERRING
Flag indicating that browser is transferring data from server. |
protected java.lang.String |
strFrame
|
protected java.lang.String |
strURL
|
protected int |
transactionId
|
Fields inherited from class java.util.EventObject |
---|
source |
Constructor Summary | |
---|---|
NetworkEvent(java.lang.Object source)
Constructor for NetworkEvent with a source. |
|
NetworkEvent(java.lang.Object source,
MutableRequestHeaders mrh)
|
Method Summary | |
---|---|
int |
getCurrentProgress()
Returns the number of bytes currently downloaded. |
int |
getFailure()
Gets the failure status of the network error. |
java.lang.String |
getFrame()
Returns the strFrame. |
java.lang.String |
getHeaders()
Deprecated. instead use getRequestHeaders() or getResponseHeaders() |
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. |
java.lang.String |
getRequestHeaders()
Returns the requestHeaders. |
java.lang.String |
getResponseHeaders()
Returns the responseHeaders. |
int |
getStatus()
Gets the network status. |
java.lang.String |
getStatusText()
Gets the status text |
int |
getTransactionId()
Used to link a BrowserEvent.onBeforeNavigate to a NetowrkEvent.onHTTPResponse |
java.lang.String |
getURL()
Returns the strURL. |
boolean |
hasPendingRequests()
Returns true if the page has pending network requests (such as Ajax) that have yet to complete. |
void |
setFailure(int flags)
Sets the failure status of the network error. |
void |
setFrame(java.lang.String strFrame)
Sets the strFrame. |
void |
setHeaders(java.lang.String string)
|
void |
setPendingLoads(boolean isPending)
|
void |
setProgress(int current,
int maximum)
Sets the current and maximum number of bytes that will be downloaded for the resource. |
void |
setRequestHeaders(java.lang.String requestHeaders)
Sets the requestHeaders. |
void |
setResponseHeaders(java.lang.String responseHeaders)
Sets the responseHeaders. |
void |
setStatus(int flags)
Sets the network status. |
void |
setStatusText(java.lang.String string)
|
void |
setTransactionId(int i)
|
void |
setURL(java.lang.String strURL)
Sets the strURL. |
Methods inherited from class java.util.EventObject |
---|
getSource, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String strURL
protected java.lang.String strFrame
protected int transactionId
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_REDIRECTING
public static final int STATUS_TRANSFERRING
public static final int STATUS_NEGOTIATING
protected int failure
protected int status
protected int current
protected int maximum
protected boolean pendingLoads
protected MutableRequestHeaders mutableHeaders
Constructor Detail |
---|
public NetworkEvent(java.lang.Object source)
EventObject.EventObject(Object)
public NetworkEvent(java.lang.Object source, MutableRequestHeaders mrh)
Method Detail |
---|
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()
STATUS_
*public java.lang.String getHeaders()
public java.lang.String getStatusText()
public void setHeaders(java.lang.String string)
string
- public void setStatusText(java.lang.String string)
string
- public java.lang.String getFrame()
public java.lang.String getURL()
public void setFrame(java.lang.String strFrame)
strFrame
- The strFrame to setpublic void setURL(java.lang.String strURL)
strURL
- The strURL to setpublic int getTransactionId()
public void setTransactionId(int i)
i
- public java.lang.String getRequestHeaders()
public java.lang.String getResponseHeaders()
public void setRequestHeaders(java.lang.String requestHeaders)
requestHeaders
- The requestHeaders to setpublic void setResponseHeaders(java.lang.String responseHeaders)
responseHeaders
- The responseHeaders to setpublic boolean hasPendingRequests()
public void setPendingLoads(boolean isPending)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |