Methods Summary |
---|
public void | clear()clear the contents
bytes = null;
responseHeaders = null;
cookies = null;
|
public void | computeExpireTime(int timeout)compute when this entry to be expired based on timeout relative to
current time.
this.timeout = timeout;
// timeout is relative to current time
this.expireTime = (timeout == -1) ? timeout :
System.currentTimeMillis() + (timeout * 1000);
|
public int | getSize()get the size
int size = 0;
if (bytes != null) {
size = bytes.length;
}
// size of response bytes plus headers (each approx 20 chars or 40 bytes)
return (size + (40 * responseHeaders.size()) );
|
public boolean | isValid()is this response still valid?
return (expireTime > System.currentTimeMillis() || expireTime == -1);
|
public void | setExpireTime(long expireTime)set the real expire time
this.expireTime = expireTime;
|