Package com.luciad.ogc.common
Interface ILcdRequest
- All Known Implementing Classes:
TLcdHttpServletRequestKVPRequestWrapper
public interface ILcdRequest
An interface for web server requests.
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
.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the part of this request's URL that calls the servlet.getAttribute
(String aAttributeName) Returns the attribute value.Returns anEnumeration
containing the names of the attributes available to this request.Returns the MIME type of the body of the request, ornull
if the type is not known.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.Returns the value of the specified request header as a String.Returns the body of the request as an input stream.getParameter
(String aParameterName) Returns the value of the parameter with the given name.getParameterIgnoreCase
(String aParameterName) A case-insensitive version ofgetParameter()
.Returns an unmodifiable list containing the names of all the parameters that are specified in this request.Returns the name and version of the protocol the request uses.Returns the name of the scheme used to make this request, for example, http, https, or ftp.Returns the host name of the server that received the request.int
Returns the port number on which this request was received.Returns ajava.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.
-
Method Details
-
getProtocol
String getProtocol()Returns the name and version of the protocol the request uses. -
getScheme
String getScheme()Returns the name of the scheme used to make this request, for example, http, https, or ftp. -
getServerName
String getServerName()Returns the host name of the server that received the request. -
getServerPort
int getServerPort()Returns the port number on which this request was received. -
getContextPath
String getContextPath()Returns the portion of the request URI that indicates the context of the request. -
getApplicationPath
String getApplicationPath()Returns the part of this request's URL that calls the servlet. -
getAttribute
Returns the attribute value.- Parameters:
aAttributeName
- the name of the attribute.- Returns:
- the attribute value.
- Since:
- 2017.0
-
getAttributeNames
Enumeration<String> getAttributeNames()Returns anEnumeration
containing the names of the attributes available to this request. This method returns an emptyEnumeration
if the request has no attributes available to it.- Returns:
- an
Enumeration
of strings containing the names of the request's attributes - Since:
- 2017.0
-
removeAttribute
Removes an attribute from this request.- Parameters:
aAttributeName
- the name of the attribute.
-
setAttribute
Stores an attribute in this request.- Parameters:
aAttributeName
- the name of the attribute.aAttributeObject
- the value of the attribute.
-
getUserPrincipal
Principal getUserPrincipal()Returns ajava.security.Principal
object containing the name of the current authenticated user. If the user has not been authenticated, the method returnsnull
.- Returns:
- a
java.security.Principal
containing the name of the user making this request;null
if the user has not been authenticated - Since:
- 2017.0
- See Also:
-
isUserInRole
Returns a boolean indicating whether the authenticated user is included in the specified logical "role". Roles and role membership can be defined using deployment descriptors. If the user has not been authenticated, the method returnsfalse
.- Parameters:
aRole
- aString
specifying the name of the role- Returns:
- a
boolean
indicating whether the user making this request belongs to a given role;false
if the user has not been authenticated - Since:
- 2017.0
- See Also:
-
getParameterNames
Returns an unmodifiable list containing the names of all the parameters that are specified in this request.- Returns:
- a list of parameter names.
- Since:
- 2017.0
-
getParameter
Returns the value of the parameter with the given name.- Parameters:
aParameterName
- the parameter name- Returns:
- the value of the specified parameter or null if the parameter was not specified
- Since:
- 2017.0
-
getParameterIgnoreCase
A case-insensitive version ofgetParameter()
.- Parameters:
aParameterName
- the parameter name- Returns:
- the value of the specified parameter or null if the parameter was not specified
- Since:
- 2017.0
-
getContentType
String getContentType()Returns the MIME type of the body of the request, ornull
if the type is not known.- Returns:
- the
String
with the MIME type of the request, or null if the type is not known. - Since:
- 2017.0
- See Also:
-
getInputStream
Returns the body of the request as an input stream. The returned input stream must support the methodInputStream.mark(int)
and thus returntrue
forInputStream.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.
- Returns:
- the body of the request as an input stream.
- Throws:
IOException
- if an input exception occurs.- Since:
- 2017.0
-
getDateHeader
Returns the value of the specified request header as a long value that represents a Date object. Use this method with headers that contain dates, such asIf-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.
- Parameters:
aName
- a String specifying the name of the header- Returns:
- a long value representing the date specified in the header expressed as the number of milliseconds since January 1, 1970 GMT, or -1 if the named header was not included with the reqest
- Throws:
IllegalArgumentException
- If the header value can't be converted to a date- Since:
- 2017.0
-
getHeader
Returns the value of the specified request header as a String. If the request did not include a header of the specified name, this method returns null. The header name is case insensitive. You can use this method with any request header.- Parameters:
aName
- a String specifying the header name- Returns:
- a String containing the value of the requested header, or null if the request does not have a header of that name
- Since:
- 2017.0
-