org.xlightweb
Class GetRequest

Package class diagram package GetRequest
java.lang.Object
  extended by org.xlightweb.Part
      extended by org.xlightweb.HttpRequest
          extended by org.xlightweb.GetRequest
All Implemented Interfaces:
IHeader, IHttpMessage, IHttpRequest, IPart

public class GetRequest
extends HttpRequest

a GET request


Field Summary
 
Fields inherited from interface org.xlightweb.IHttpMessage
CONNECT_METHOD, DEFAULT_ENCODING, DEFAULT_ENCODING_KEY, DELETE_METHOD, GET_METHOD, HEAD_METHOD, OPTIONS_METHOD, POST_METHOD, PUT_METHOD, TRACE_METHOD
 
Constructor Summary
GetRequest(String url)
          constrcutor
GetRequest(String url, NameValuePair... queryParameters)
          constrcutor
 
Method Summary
 Object getAttribute(String name)
          Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.
 Enumeration getAttributeNames()
          Returns an Enumeration containing the names of the attributes available to this message.
 Set<String> getAttributeNameSet()
          Returns an Set containing the names of the attributes available to this messaget.
 int getContentLength()
          Returns the length, in bytes, of the message body and made available by the input stream, or -1 if the length is not known.
 IHttpMessageHeader getMessageHeader()
          returns the message header
 void removeHopByHopHeaders()
          removes all hop-by-hop headers without Transfer-Encoding if set to chunked
 void setAttribute(String name, Object o)
          Stores an attribute in this header.
 void setContentLength(int length)
          sets the content length in bytes
 
Methods inherited from class org.xlightweb.HttpRequest
addMatrixParameter, addParameter, getAccept, getBooleanParameter, getBooleanParameter, getContextPath, getDoubleParameter, getDoubleParameter, getFloatParameter, getFloatParameter, getHost, getIntParameter, getIntParameter, getLongParameter, getLongParameter, getMatrixParameter, getMatrixParameterNameSet, getMatrixParameterValues, getMethod, getParameter, getParameter, getParameterNames, getParameterNameSet, getParameterValues, getPathInfo, getPathInfo, getProtocol, getProtocolVersion, getQueryString, getRemoteAddr, getRemoteHost, getRemotePort, getRequestHandlerPath, getRequestHeader, getRequestURI, getRequestUrl, getRequiredBooleanParameter, getRequiredDoubleParameter, getRequiredFloatParameter, getRequiredIntParameter, getRequiredLongParameter, getRequiredStringParameter, getScheme, getServerName, getServerPort, getUserAgent, isSecure, removeMatrixParameter, removeParameter, setContextPath, setHost, setMatrixParameter, setMethod, setParameter, setRequestHandlerPath, setRequestURI, setRequestUrl, setUserAgent
 
Methods inherited from class org.xlightweb.Part
addHeader, addHeaderLine, addHeaderlines, containsHeader, getBlockingBody, getBody, getCharacterEncoding, getContentType, getDisposition, getDispositionParam, getDispositionType, getHeader, getHeaderList, getHeaderNames, getHeaderNameSet, getHeaders, getNonBlockingBody, getPartHeader, getTransferEncoding, hasBody, removeHeader, setContentType, setHeader, setTransferEncoding, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xlightweb.IHttpMessage
getAttribute, getAttributeNames, getAttributeNameSet, getCharacterEncoding, getContentLength, getContentType, getMessageHeader, getTransferEncoding, removeHopByHopHeaders, setAttribute, setContentLength, setContentType, setTransferEncoding
 
Methods inherited from interface org.xlightweb.IPart
getBlockingBody, getBody, getNonBlockingBody, getPartHeader, hasBody
 
Methods inherited from interface org.xlightweb.IHeader
addHeader, addHeaderLine, addHeaderlines, containsHeader, getDisposition, getDispositionParam, getDispositionType, getHeader, getHeaderList, getHeaderNames, getHeaderNameSet, getHeaders, removeHeader, setHeader
 

Constructor Detail

GetRequest

public GetRequest(String url)
           throws MalformedURLException
constrcutor

Parameters:
url - the url string
Throws:
MalformedURLException

GetRequest

public GetRequest(String url,
                  NameValuePair... queryParameters)
           throws MalformedURLException
constrcutor

Parameters:
url - the url string
queryParameters - the query parameters
Throws:
MalformedURLException
Method Detail

getMessageHeader

public final IHttpMessageHeader getMessageHeader()
returns the message header

Specified by:
getMessageHeader in interface IHttpMessage
Returns:
the message header

setAttribute

public final void setAttribute(String name,
                               Object o)
Stores an attribute in this header. Attributes are reset between messages.

Attribute names should follow the same conventions as package names.

Specified by:
setAttribute in interface IHttpMessage
Parameters:
name - a String specifying the name of the attribute
o - the Object to be stored

getAttribute

public final Object getAttribute(String name)
Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.

Attribute names should follow the same conventions as package names.

Specified by:
getAttribute in interface IHttpMessage
Parameters:
name - a String specifying the name of the attribute
Returns:
an Object containing the value of the attribute, or null if the attribute does not exist

getAttributeNames

public final Enumeration getAttributeNames()
Returns an Enumeration containing the names of the attributes available to this message. This method returns an empty Enumeration if the message has no attributes available to it.

Specified by:
getAttributeNames in interface IHttpMessage
Returns:
an Enumeration of strings containing the names of the message's attributes

getAttributeNameSet

public final Set<String> getAttributeNameSet()
Returns an Set containing the names of the attributes available to this messaget. This method returns an empty Set if the request has no attributes available to it.

Specified by:
getAttributeNameSet in interface IHttpMessage
Returns:
an Set of strings containing the names of the message's attributes

getContentLength

public final int getContentLength()
Returns the length, in bytes, of the message body and made available by the input stream, or -1 if the length is not known.

Specified by:
getContentLength in interface IHttpMessage
Returns:
an integer containing the length of the message body or -1 if the length is not known

setContentLength

public final void setContentLength(int length)
sets the content length in bytes

Specified by:
setContentLength in interface IHttpMessage
Parameters:
length - the content length in bytes

removeHopByHopHeaders

public final void removeHopByHopHeaders()
removes all hop-by-hop headers without Transfer-Encoding if set to chunked

Specified by:
removeHopByHopHeaders in interface IHttpMessage