public class CacheEntry extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
NO_TIMEOUT |
| Constructor and Description |
|---|
CacheEntry(String response,
int timeout)
Constructs a CacheEntry using the response string to be
cached and the timeout after which the entry will expire
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
clear the contents
|
void |
computeExpireTime(int timeout)
compute when this entry to be expired based on timeout relative to
current time.
|
String |
getContent()
Gets the cached content.
|
boolean |
isValid()
is this response still valid?
|
void |
setExpireTime(long expireTime)
set the real expire time
|
public static final int NO_TIMEOUT
public CacheEntry(String response, int timeout)
public void setExpireTime(long expireTime)
expireTime - in milli secondspublic String getContent()
public void computeExpireTime(int timeout)
timeout - in secondspublic boolean isValid()
public void clear()
Copyright © 2019. All rights reserved.