org.w3c.jigsaw.ccpp
Class CCPPRequest

java.lang.Object
  extended by org.w3c.jigsaw.ccpp.CCPPRequest
All Implemented Interfaces:
CCPP

public class CCPPRequest
extends java.lang.Object
implements CCPP


Field Summary
 
Fields inherited from interface org.w3c.jigsaw.ccpp.CCPP
CCPP_REQUEST_STATE, CONTENT_GENERATION_APPLIED, CONTENT_SELECTION_APPLIED, HTTP_EXT_ID, msg_100, msg_200, NOT_APPLIED, NOT_USED_STALE_PROFILE, OK, PROFILE_DIFF_HEADER, PROFILE_HEADER, PROFILE_WARNING_HEADER, TRANSFORMATION_APPLIED, UNKNOWN_WARNING_MESSAGE, USED_STALE_PROFILE
 
Method Summary
protected  Reply acknowledge(Reply reply)
          Set the Acknowledgement Headers if it's appropriate.
 void addWarning(Reply reply, int warning, java.lang.String reference)
          Add a CC/PP Warning to the given reply.
 java.lang.String getCCPPHeaderValue(java.lang.String header)
          Get a header value (relative to the CC/PP Extension protocol)
static CCPPRequest getCCPPRequest(Request request)
          Get the CC/PP Request associated to the given HTTP Request
 Request getHTTPRequest()
          Get the HTTP Request
 java.lang.String getProfileDiff(int diffnumber)
          Get the profile diff header relative to the given profile diff number.
 ProfileRef[] getProfileReferences()
          Get the Profile references (absolute URI or Profile-diff-name) ordered by priority (the last one has the highest priority).
static java.lang.String getStandardWarning(int warning)
          Get the standard CCPP reason phrase for the given warning code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getHTTPRequest

public Request getHTTPRequest()
Get the HTTP Request

Returns:
a Request

getStandardWarning

public static java.lang.String getStandardWarning(int warning)
Get the standard CCPP reason phrase for the given warning code.

Parameters:
warning - The given warning code.
Returns:
A String giving the standard reason phrase, or null if the status doesn't match any knowned error.

getCCPPHeaderValue

public java.lang.String getCCPPHeaderValue(java.lang.String header)
Get a header value (relative to the CC/PP Extension protocol)

Parameters:
request - the HTTP Request
header - the header name (ie "Profile")
Returns:
a String.

getProfileDiff

public java.lang.String getProfileDiff(int diffnumber)
Get the profile diff header relative to the given profile diff number.

Parameters:
request - the HTTP Request
diffnumber - the diff number

getProfileReferences

public ProfileRef[] getProfileReferences()
Get the Profile references (absolute URI or Profile-diff-name) ordered by priority (the last one has the highest priority).

Returns:
a ProfileRef array (or null)
See Also:
ProfileRef

getCCPPRequest

public static CCPPRequest getCCPPRequest(Request request)
Get the CC/PP Request associated to the given HTTP Request

Parameters:
request - the HTTP Request
Returns:
a CCPPRequest instance

acknowledge

protected Reply acknowledge(Reply reply)
Set the Acknowledgement Headers if it's appropriate.

Parameters:
reply - the reply
Returns:
the aknowledged reply

addWarning

public void addWarning(Reply reply,
                       int warning,
                       java.lang.String reference)
Add a CC/PP Warning to the given reply.

Parameters:
reply - the HTTP Reply
warning - the CC/PP Warning code
reference - the Profile reference