org.codehaus.httpcache4j
Class Conditionals

java.lang.Object
  extended by org.codehaus.httpcache4j.Conditionals

public final class Conditionals
extends java.lang.Object

Author:
Erlend Hamnaberg

Constructor Summary
Conditionals()
           
 
Method Summary
 void addIfMatch(Tag tag)
          Adds tags to the If-Match header.
 void addIfNoneMatch(Tag tag)
          Adds tags to the If-None-Match header.
 java.util.List<Tag> getMatch()
           
 org.joda.time.DateTime getModifiedSince()
           
 java.util.List<Tag> getNonMatch()
           
 org.joda.time.DateTime getUnModifiedSince()
           
 void setIfModifiedSince(org.joda.time.DateTime time)
          You should use the server's time here.
 void setIfUnModifiedSince(org.joda.time.DateTime time)
          You should use the server's time here.
 Headers toHeaders()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Conditionals

public Conditionals()
Method Detail

addIfMatch

public void addIfMatch(Tag tag)
Adds tags to the If-Match header.

Parameters:
tag - the tag to add, may be null. This means the same as adding Tag.ALL
Throws:
java.lang.IllegalArgumentException - if ALL is supplied more than once, or you add a null tag more than once.

addIfNoneMatch

public void addIfNoneMatch(Tag tag)
Adds tags to the If-None-Match header. The meaning of "If-None-Match: *" is that the method MUST NOT be performed if the representation selected by the origin server (or by a cache, possibly using the Vary mechanism, see section 14.44) exists, and SHOULD be performed if the representation does not exist. FThis feature is intended to be useful in preventing races between PUT operations.

Parameters:
tag - the tag to add, may be null. This means the same as adding Tag.ALL
Throws:
java.lang.IllegalArgumentException - if ALL is supplied more than once, or you add a null tag more than once.

setIfModifiedSince

public void setIfModifiedSince(org.joda.time.DateTime time)
You should use the server's time here. Otherwise you might get unexpected results.

Parameters:
time - the time to check.

setIfUnModifiedSince

public void setIfUnModifiedSince(org.joda.time.DateTime time)
You should use the server's time here. Otherwise you might get unexpected results.

Parameters:
time - the time to check.

getMatch

public java.util.List<Tag> getMatch()

getNonMatch

public java.util.List<Tag> getNonMatch()

getModifiedSince

public org.joda.time.DateTime getModifiedSince()

getUnModifiedSince

public org.joda.time.DateTime getUnModifiedSince()

toHeaders

public Headers toHeaders()


Copyright © 2008. All Rights Reserved.