nl.hippo.client.api.caching
Class CachedResponseImpl

java.lang.Object
  extended by nl.hippo.client.api.caching.CachedResponseImpl
All Implemented Interfaces:
Serializable, CachedResponse

public class CachedResponseImpl
extends Object
implements Serializable, CachedResponse

See Also:
Serialized Form

Constructor Summary
CachedResponseImpl(EventValidity[] validityObjects, Object response)
          Create a new entry for the cache.
CachedResponseImpl(EventValidity[] validityObjects, Object response, Long expires)
          Create a new entry for the cache.
CachedResponseImpl(EventValidity validityObject, Object response)
          Create a new entry for the cache.
 
Method Summary
 String getContentType()
           
 Long getExpires()
          Get the configured expires.
 long getLastModified()
           
 Object getResponse()
          Get the cached response.
 SourceValidity[] getValidityObjects()
          Get the validity objects
 void setContentType(String value)
           
 void setExpires(Long newExpires)
          Set the (newly) configured expires.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedResponseImpl

public CachedResponseImpl(EventValidity[] validityObjects,
                          Object response)
Create a new entry for the cache.

Parameters:
validityObjects - The SourceValidity objects in the order they occured in the pipeline
response - The cached sax stream or character stream

CachedResponseImpl

public CachedResponseImpl(EventValidity validityObject,
                          Object response)
Create a new entry for the cache.

Parameters:
validityObject - The SourceValidity object
response - The cached sax stream or character stream

CachedResponseImpl

public CachedResponseImpl(EventValidity[] validityObjects,
                          Object response,
                          Long expires)
Create a new entry for the cache.

Parameters:
validityObjects - The SourceValidity objects in the order they occured in the pipeline
response - The cached sax stream or character stream
expires - The configured expires, or null if no expires was defined.
Method Detail

getValidityObjects

public SourceValidity[] getValidityObjects()
Get the validity objects

Specified by:
getValidityObjects in interface CachedResponse

getResponse

public Object getResponse()
Get the cached response.

Specified by:
getResponse in interface CachedResponse
Returns:
The sax stream or character stream

getExpires

public Long getExpires()
Get the configured expires.

Specified by:
getExpires in interface CachedResponse
Returns:
The configured expires, or null if no expires was defined

setExpires

public void setExpires(Long newExpires)
Set the (newly) configured expires.


getLastModified

public long getLastModified()
Specified by:
getLastModified in interface CachedResponse
Returns:
the last modified time

getContentType

public String getContentType()
Specified by:
getContentType in interface CachedResponse
Returns:
Returns the cached content type (or null).

setContentType

public void setContentType(String value)
Parameters:
value - The content type to cache.


Copyright © 2006-2009 Hippo. All Rights Reserved.