|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.ibm.wbi.protocol.http.HttpHeader
HttpHeader is an object that aides in the creation of a response header. Generators are responsible for the creation of a response header during the act of satisfying a request. Normally this header is returned from a web server (if the default generator is used). Generators that satisify a request without going to a server can use this object to create a properly formatted response header.
HttpHeader does support creating headers with multiple keys of the same name.
| Field Summary | |
static java.lang.String |
ACCEPT
|
static java.lang.String |
CONTENT_ENCODING
|
static java.lang.String |
CONTENT_LANGUAGE
|
static java.lang.String |
CONTENT_LENGTH
|
static java.lang.String |
CONTENT_TYPE
|
static java.lang.String |
COPYRIGHT
|
static java.lang.String |
PVC_DEVICE_TYPE
|
static java.lang.String |
PVC_NETWORK_TYPE
|
static java.lang.String |
PVC_SESSION
|
static java.lang.String |
PVC_USER
|
static java.lang.String |
USER_AGENT
|
static java.lang.String |
USER_AGENT_COLOR
|
static java.lang.String |
USER_AGENT_PIXELS
|
static java.lang.String |
WTP
|
| Constructor Summary | |
HttpHeader()
A constructor that creates an empty HttpHeader object. |
|
HttpHeader(int contentLength,
java.lang.String server,
java.lang.String contentType,
boolean nocache)
A constructor that creates a new HttpHeader object with the passed values used as initial settings. |
|
HttpHeader(java.lang.String server)
A constructor that creates a new HttpHeader object with the passed server as its initial value. |
|
HttpHeader(SystemContext sct)
A constructor that creates an empty HttpHeader object. |
|
| Method Summary | |
void |
add(java.lang.String name,
java.lang.String value)
Adds a name/value pair to the MIME data when the header is generated. |
java.lang.String |
getHeader()
Causes a correctly formatted header to be generated. |
int |
length()
Returns the length, in characters, of the current header. |
static void |
main(java.lang.String[] args)
Test driver. |
void |
remove(java.lang.String name)
Removes a name(s) (or keyword) from the current set of MIME keywords. |
void |
setContentLanguage(java.lang.String language)
Sets the content language (MIME Content-Language:) value in the current HttpHeader object. |
void |
setContentLength(int length)
Sets the content length (MIME Content-Length:) value in the current HttpHeader object. |
void |
setContentType(java.lang.String type)
Sets the content type (MIME Content-Type:) value in the current HttpHeader object. |
void |
setNoCache()
Requests that the object remove the appropriate MIME data with regard to cache requests. |
void |
setNoCache(boolean noCache)
Requests that the object insert or remove the appropriate MIME data with regard to cache requests. |
void |
setResponseCode(int code)
Sets the response code in the current HttpHeader object. |
void |
setResponseCode(int code,
java.lang.String msg)
Sets the response code and response message in the current HttpHeader object. |
void |
setResponseMessage(java.lang.String msg)
Sets the response message in the current HttpHeader object. |
void |
setServer(java.lang.String server)
Sets the server value in the current HttpHeader object. |
java.lang.String |
toString()
Causes a correctly formatted header to be generated. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String COPYRIGHT
public static final java.lang.String ACCEPT
public static final java.lang.String CONTENT_ENCODING
public static final java.lang.String CONTENT_LANGUAGE
public static final java.lang.String CONTENT_LENGTH
public static final java.lang.String CONTENT_TYPE
public static final java.lang.String USER_AGENT
public static final java.lang.String USER_AGENT_COLOR
public static final java.lang.String USER_AGENT_PIXELS
public static final java.lang.String PVC_SESSION
public static final java.lang.String PVC_DEVICE_TYPE
public static final java.lang.String PVC_NETWORK_TYPE
public static final java.lang.String PVC_USER
public static final java.lang.String WTP
| Constructor Detail |
public HttpHeader(int contentLength,
java.lang.String server,
java.lang.String contentType,
boolean nocache)
contentLength - The MIME content-length: setting.server - The server to associate with the response.contentType - The MIME content-type: setting.nocache - The MIME data should include the appropriate
request to not cache this response if
true.public HttpHeader(java.lang.String server)
server - The server to associate with the response.public HttpHeader(SystemContext sct)
sct - The SystemContext to retrieve the server from.public HttpHeader()
| Method Detail |
public void setContentLength(int length)
length - The inbound content length.public void setContentLanguage(java.lang.String language)
language - The inbound content language.public void setContentType(java.lang.String type)
type - The inbound content type.public void setNoCache(boolean noCache)
noCache - Sets the current object's no-cache state.public void setNoCache()
public void setServer(java.lang.String server)
server - The inbound server to be used.public void setResponseMessage(java.lang.String msg)
msg - The inbound message to be used.
public void setResponseCode(int code,
java.lang.String msg)
code - The response code to be used.msg - The message to be used.public void setResponseCode(int code)
code - The response code to be used.
public void add(java.lang.String name,
java.lang.String value)
name - The new name (or keyword) to be added.value - The value to be associated with the name.public void remove(java.lang.String name)
name - The new name (or keyword) to be removed.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getHeader()
public int length()
public static void main(java.lang.String[] args)
args - The arguments.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||