    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class org.w3c.www.http.HttpCacheControl

    java.lang.Object
       |
       +----org.w3c.www.http.BasicValue
               |
               +----org.w3c.www.http.HttpCacheControl

public class HttpCacheControl
extends BasicValue

The parsed cache-control directive of HTTP/1.1 This object gives access to the parsed value of the cache-control directive of HTTP/1.1, as defined in section 14.9 of the specification.

##

HttpCacheControl()
  Create a new empty cache control object descriptor.

##

addNoCache(String)
  Add the given header name to the `no-cache` directive.
checkMustRevalidate()
  Is the must-revalidate flag set ?
checkNoStore()
  Is the no-store flag set ?
checkNoTransform()
  Is the no-transform flag set ?
checkOnlyIfCached()
  Is the on-if-cached flag value set ?
checkProxyRevalidate()
  Is the proxy-revalidate flag set ?
checkPublic()
  Is the public flag set ?
getMaxAge()
  Get the max-age value defined by this cache control policy.
getMaxStale()
  Get the max-stale value defined by this control object.
getMinFresh()
  Get the min-fresh directive value.
getNoCache()
  Get and test the no-cache directive setting.
getPrivate()
  Check and get the private value.
getValue()
  HeaderValue implementation - Get this header value.
parse()
  parse.
setMaxAge(int)
  Set the max-age directive for this cache control.
setMaxStale(int)
  Set the max-stale directive value.
setMinFresh(int)
  Set the minfresh directive value.
setMustRevalidate(boolean)
  Set the must-revalidate directive.
setNoCache()
  Set the `no-cache` directive globally.
setNoCache(String[])
  Set the no cache directive to the given list of fields.
setNoStore(boolean)
  Set the `no-store` flag.
setNoTransform(boolean)
  Set the no-transform directive.
setOnlyIfCached(boolean)
  Set the only-if-cached directive.
setPrivate(String[])
  Set the private directive value.
setProxyRevalidate(boolean)
  Set the proxy-revalidate directive.
setPublic(boolean)
  Set the public directive.
unsetNoCache()
  Unset the `no-cache` directive.
unsetPrivate()
  Unset the `private` directive.
updateByteValue()
  Recompute the byte value for this header.

##

HttpCacheControl

     public HttpCacheControl()

  Create a new empty cache control object descriptor. The value will be provided through parsing.

##

updateByteValue

     protected void updateByteValue()

  Recompute the byte value for this header.

  Overrides:
    updateByteValue in class BasicValue

parse

     protected void parse() throws HttpParserException

  parse.

  Throws: HttpParserException
    if parsing failed.
  Overrides:
    parse in class BasicValue

getValue

     public Object getValue()

  HeaderValue implementation - Get this header value.

  Returns:
    Itself !
  Overrides:
    getValue in class BasicValue

getNoCache

     public String[] getNoCache()

  Get and test the no-cache directive setting.

  Returns:
    A field-list as an array of String, or null if the directive is undefined.

setNoCache

     public void setNoCache(String fields[])

  Set the no cache directive to the given list of fields.

  Parameters:
    fields - The fields to set in the no-cache directive, encoded as a String array (whose length can be 0), or null to reset the value.

setNoCache

     public void setNoCache()

  Set the `no-cache` directive globally.

addNoCache

     public void addNoCache(String name)

  Add the given header name to the `no-cache` directive.

  Parameters:
    name - The header name to add.

unsetNoCache

     public void unsetNoCache()

  Unset the `no-cache` directive.

checkNoStore

     public boolean checkNoStore()

  Is the no-store flag set ?

  Returns:
    A boolean.

setNoStore

     public void setNoStore(boolean onoff)

  Set the `no-store` flag.

  Parameters:
    onoff - The value for the no-store directive.

getMaxAge

     public final int getMaxAge()

  Get the max-age value defined by this cache control policy.

  Returns:
    The max-age value, or -1 if undefined.

setMaxAge

     public void setMaxAge(int age)

  Set the max-age directive for this cache control.

  Parameters:
    age - The max allowed age for the cache control policy, or -1 to reset value.

getMaxStale

     public int getMaxStale()

  Get the max-stale value defined by this control object.

  Returns:
    The max-stale value, or -1 if undefined.

setMaxStale

     public void setMaxStale(int stale)

  Set the max-stale directive value.

  Parameters:
    stale - The max-stale value, or -1 to reset value.

getMinFresh

     public int getMinFresh()

  Get the min-fresh directive value.

  Parameters:
    def - The default value to reurn if undefined.

setMinFresh

     public void setMinFresh(int fresh)

  Set the minfresh directive value.

  Parameters:
    fresh - The new minfresh value, or -1 to reset value.

checkOnlyIfCached

     public boolean checkOnlyIfCached()

  Is the on-if-cached flag value set ?

  Returns:
    A boolean.

setOnlyIfCached

     public void setOnlyIfCached(boolean onoff)

  Set the only-if-cached directive.

  Parameters:
    onoff - The boolean value for the directive.

checkPublic

     public boolean checkPublic()

  Is the public flag set ?

  Returns:
    A boolean.

setPublic

     public void setPublic(boolean onoff)

  Set the public directive.

  Parameters:
    onoff - The public directive value.

getPrivate

     public String[] getPrivate()

  Check and get the private value.

  Parameters:
    def - The default value if undefined.
  Returns:
    A list of field-names, as a String array, or the provided default value otherwise.

setPrivate

     public void setPrivate(String priv[])

  Set the private directive value.

  Parameters:
    priv - The list of field-names as a String array.

unsetPrivate

     public void unsetPrivate()

  Unset the `private` directive.

checkNoTransform

     public boolean checkNoTransform()

  Is the no-transform flag set ?

  Returns:
    A boolean.

setNoTransform

     public void setNoTransform(boolean onoff)

  Set the no-transform directive.

  Parameters:
    onoff - The new boolean value for the no-transform directive.

checkMustRevalidate

     public boolean checkMustRevalidate()

  Is the must-revalidate flag set ?

  Returns:
    A boolean.

setMustRevalidate

     public void setMustRevalidate(boolean onoff)

  Set the must-revalidate directive.

  Parameters:
    onoff - The new value for the must-revalidate directive.

checkProxyRevalidate

     public boolean checkProxyRevalidate()

  Is the proxy-revalidate flag set ?

  Returns:
    A boolean.

setProxyRevalidate

     public void setProxyRevalidate(boolean onoff)

  Set the proxy-revalidate directive.

  Parameters:
    onoff - The new proxy-revalidate value.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index