public interface ILcdRequest
This interface must not be implemented by users. It may be subject to change.
The class TLcdServletUtil
contains some utility methods related to this ILcdRequest
interface.
It has convenience methods to see if a request is a request using XML or KVP based on
the content type
.
Modifier and Type | Method and Description |
---|---|
String |
getApplicationPath()
Returns the part of this request's URL that calls the servlet.
|
Object |
getAttribute(String aAttributeName)
Returns the attribute value.
|
Enumeration<String> |
getAttributeNames()
Returns an
Enumeration containing the names of the attributes available to this request. |
String |
getContentType()
Returns the MIME type of the body of the request, or
null if the type is not known. |
String |
getContextPath()
Returns the portion of the request URI that indicates the context of the
request.
|
long |
getDateHeader(String aName)
Returns the value of the specified request header as a long value that
represents a Date object.
|
String |
getHeader(String aName)
Returns the value of the specified request header as a String.
|
InputStream |
getInputStream()
Returns the body of the request as an input stream.
|
String |
getParameter(String aParameterName)
Returns the value of the parameter with the given name.
|
String |
getParameterIgnoreCase(String aParameterName)
A case-insensitive version of
getParameter() . |
List<String> |
getParameterNames()
Returns an unmodifiable list containing the names of all the parameters that
are specified in this request.
|
String |
getProtocol()
Returns the name and version of the protocol the request uses.
|
String |
getScheme()
Returns the name of the scheme used to make this request, for example,
http, https, or ftp.
|
String |
getServerName()
Returns the host name of the server that received the request.
|
int |
getServerPort()
Returns the port number on which this request was received.
|
Principal |
getUserPrincipal()
Returns a
java.security.Principal object containing the name
of the current authenticated user. |
boolean |
isUserInRole(String aRole)
Returns a boolean indicating whether the authenticated user is included
in the specified logical "role".
|
void |
removeAttribute(String aAttributeName)
Removes an attribute from this request.
|
void |
setAttribute(String aAttributeName,
Object aAttributeObject)
Stores an attribute in this request.
|
String getProtocol()
String getScheme()
String getServerName()
int getServerPort()
String getContextPath()
String getApplicationPath()
Object getAttribute(String aAttributeName)
aAttributeName
- the name of the attribute.Enumeration<String> getAttributeNames()
Enumeration
containing the names of the attributes available to this request.
This method returns an empty Enumeration
if the request has no attributes available to it.Enumeration
of strings containing the names of the request's attributesvoid removeAttribute(String aAttributeName)
aAttributeName
- the name of the attribute.void setAttribute(String aAttributeName, Object aAttributeObject)
aAttributeName
- the name of the attribute.aAttributeObject
- the value of the attribute.Principal getUserPrincipal()
java.security.Principal
object containing the name
of the current authenticated user. If the user has not been
authenticated, the method returns null
.java.security.Principal
containing the name of the
user making this request; null
if the user has not
been authenticatedHttpServletRequest.getUserPrincipal()
boolean isUserInRole(String aRole)
false
.aRole
- a String
specifying the name of the roleboolean
indicating whether the user making this
request belongs to a given role; false
if the user
has not been authenticatedHttpServletRequest.isUserInRole(String)
List<String> getParameterNames()
String getParameter(String aParameterName)
aParameterName
- the parameter nameString getParameterIgnoreCase(String aParameterName)
getParameter()
.aParameterName
- the parameter nameString getContentType()
null
if the type is not known.String
with the MIME type of the request, or null if the type is not known.TLcdServletUtil.isXMLRequest(ILcdRequest)
,
TLcdServletUtil.isKVPRequest(ILcdRequest)
InputStream getInputStream() throws IOException
InputStream.mark(int)
and thus return true
for InputStream.markSupported()
.
This is important as the command dispatcher needs to take a peek into the request to determine which request handler knows to deal with the client request.
IOException
- if an input exception occurs.long getDateHeader(String aName)
If-Modified-Since
.
The date is returned as the number of milliseconds since January 1, 1970 GMT. The header name is case insensitive.
If the request did not have a header of the specified name, this method returns -1. If the header can't be converted to a date, the method throws an IllegalArgumentException.
aName
- a String specifying the name of the headerIllegalArgumentException
- If the header value can't be converted to a dateString getHeader(String aName)
aName
- a String specifying the header name