org.openrdf.http.object.cache
Class CachedEntity

java.lang.Object
  extended by org.openrdf.http.object.cache.CachedEntity

public class CachedEntity
extends Object

A cached response HTTP entity.

Author:
James Leigh

Constructor Summary
CachedEntity(File head, File body)
           
CachedEntity(String method, String url, org.apache.http.HttpResponse store, File tmp, File head, File body)
           
 
Method Summary
 void addRequest(Request req)
           
 Long contentLength()
           
 long date()
           
 void delete()
           
 int getAge(long now)
           
 File getBody()
           
 String getContentHeader(String name)
           
 Map<String,String> getContentHeaders()
           
 String getContentLength()
           
 String getContentType()
           
 String getDate()
           
 String getEntityTag()
           
 String getETag()
           
 String getLastModified()
           
 int getLifeTime()
           
 int getLifeTime(long now)
           
 String getMethod()
           
 Integer getStatus()
           
 String getStatusText()
           
 String getURL()
           
static String getURL(File head)
           
 String getWarning()
           
 boolean inUse()
           
 boolean isBodyPresent()
           
 boolean isMissing()
           
 boolean isPublic()
           
 boolean isStale()
           
 boolean isVariation(Request req)
           
 long lastModified()
           
 Lock matching()
           
 boolean mustRevalidate()
           
 Lock open()
           
 void setResponse(org.apache.http.HttpResponse store, File tmp)
           
 void setStale(boolean stale)
           
 String toString()
           
 FileChannel writeBody()
           
 ReadableByteChannel writeBody(long start, long length)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CachedEntity

public CachedEntity(File head,
                    File body)
             throws IOException
Throws:
IOException

CachedEntity

public CachedEntity(String method,
                    String url,
                    org.apache.http.HttpResponse store,
                    File tmp,
                    File head,
                    File body)
             throws IOException
Throws:
IOException
Method Detail

getURL

public static String getURL(File head)
                     throws IOException
Throws:
IOException

isMissing

public boolean isMissing()

matching

public Lock matching()
              throws InterruptedException
Throws:
InterruptedException

inUse

public boolean inUse()

open

public Lock open()
          throws InterruptedException
Throws:
InterruptedException

delete

public void delete()
            throws InterruptedException
Throws:
InterruptedException

addRequest

public void addRequest(Request req)
                throws IOException
Throws:
IOException

setResponse

public void setResponse(org.apache.http.HttpResponse store,
                        File tmp)
                 throws IOException,
                        InterruptedException
Throws:
IOException
InterruptedException

isVariation

public boolean isVariation(Request req)

mustRevalidate

public boolean mustRevalidate()

getAge

public int getAge(long now)

contentLength

public Long contentLength()

getContentLength

public String getContentLength()

getContentHeader

public String getContentHeader(String name)

getContentHeaders

public Map<String,String> getContentHeaders()

date

public long date()

getDate

public String getDate()

getEntityTag

public String getEntityTag()

getETag

public String getETag()

lastModified

public long lastModified()

getLastModified

public String getLastModified()

getLifeTime

public int getLifeTime()
                throws IOException
Throws:
IOException

getLifeTime

public int getLifeTime(long now)
                throws IOException
Throws:
IOException

getMethod

public String getMethod()

getStatus

public Integer getStatus()

getStatusText

public String getStatusText()

getURL

public String getURL()

getWarning

public String getWarning()

getContentType

public String getContentType()

isPublic

public boolean isPublic()

isStale

public boolean isStale()

setStale

public void setStale(boolean stale)
              throws IOException
Throws:
IOException

isBodyPresent

public boolean isBodyPresent()

getBody

public File getBody()

writeBody

public FileChannel writeBody()
                      throws IOException
Throws:
IOException

writeBody

public ReadableByteChannel writeBody(long start,
                                     long length)
                              throws IOException
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2010 James Leigh Services Inc.. All Rights Reserved.