com.notuvy.net.webcache
Class CacheQuery

java.lang.Object
  extended by com.notuvy.net.webcache.CacheQuery

public class CacheQuery
extends Object

User: Murali Date: 6/29/12 Time: 6:19 AM To change this template use File | Settings | File Templates.


Field Summary
protected static org.apache.log4j.Logger LOG
           
 
Constructor Summary
protected CacheQuery(CachedWebProxy pCachedWebProxy, String pUrl, long pExpiration)
           
 
Method Summary
protected  long computeExpirationTime(long pCreationTime)
           
 long getExpiration()
           
 String getUrl()
           
protected  boolean hasExpired(long pCreationTime)
           
 CacheResult lookup()
          Perform the full lookup (which may come from the cache).
 CacheQuery setExpiration(long pExpiration, TimeUnit pTimeUnit)
          Change the expiration of this particular query.
 CacheQuery setNoCache()
          Define the query to not be cached.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.log4j.Logger LOG
Constructor Detail

CacheQuery

protected CacheQuery(CachedWebProxy pCachedWebProxy,
                     String pUrl,
                     long pExpiration)
Method Detail

getUrl

public String getUrl()

getExpiration

public long getExpiration()

setExpiration

public CacheQuery setExpiration(long pExpiration,
                                TimeUnit pTimeUnit)
Change the expiration of this particular query.

Parameters:
pExpiration - The amount of time after which a download must be done.
pTimeUnit - The unit of time defining the expiration time amount.
Returns:
self for cascaded calls.

hasExpired

protected boolean hasExpired(long pCreationTime)

computeExpirationTime

protected long computeExpirationTime(long pCreationTime)

lookup

public CacheResult lookup()
Perform the full lookup (which may come from the cache).

Returns:
The result served from a local file.

setNoCache

public CacheQuery setNoCache()
Define the query to not be cached. If re-queried, a download will always be done.

Returns:
self for cascaded calls.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.