|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface AuthenticationContext
The AuthenticationContext class contains information
about the client and the network connection used by a client that
needs to be authenticated. This information can be used by an
Authenticator implementation to perform extra checks
when authenticating the user, such as validating the client's IP
number against a list of allowed hosts.
| Method Summary | |
|---|---|
Cookie[] |
getCookies()
Returns an array containing all of the Cookie
objects the client sent with this request. |
long |
getDateHeader(String name)
Returns the value of the specified request header as a long value that represents a Date
object. |
String |
getHeader(String name)
Returns the value of the specified request header as a String. |
Enumeration |
getHeaderNames()
Returns an Enumeration of all the header names this
request contains. |
Enumeration |
getHeaders(String name)
Returns all the values of the specified request header as an Enumeration of String objects. |
int |
getIntHeader(String name)
Returns the value of the specified request header as an int. |
String |
getRemoteAddr()
Returns the Internet Protocol (IP) address of the client that sent the request. |
String |
getRemoteHost()
Returns the fully qualified name of the client that sent the request. |
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. |
boolean |
isSecure()
Returns a boolean indicating whether this request
was made using a secure channel, such as HTTPS. |
| Method Detail |
|---|
String getRemoteAddr()
String containing the IP address of the
client that sent the requestString getRemoteHost()
String containing the fully qualified name
of the clientString getServerName()
String containing the name of the server
to which the request was sentint getServerPort()
boolean isSecure()
boolean indicating whether this request
was made using a secure channel, such as HTTPS.
boolean indicating if the request was made
using a secure channelCookie[] getCookies()
Cookie
objects the client sent with this request. This method returns
null if no cookies were sent.
null if the request has no cookieslong getDateHeader(String name)
long value that represents a Date
object. Use this method with headers that contain dates, such as
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.
name - a String specifying the name of the
header
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
IllegalArgumentException - If the header value can't be
converted to a dateString getHeader(String name)
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.
name - a String specifying the header name
String containing the value of the
requested header, or null if the request does not
have a header of that nameEnumeration getHeaderNames()
Enumeration of all the header names this
request contains. If the request has no headers, this method
returns an empty Enumeration.
Some servlet containers do not allow do not allow servlets to
access headers using this method, in which case this method
returns null.
nullEnumeration getHeaders(String name)
Enumeration of String objects.
Some headers, such as Accept-Language can be sent
by clients as several headers each with a different value rather
than sending the header as a comma separated list.
If the request did not include any headers of the specified
name, this method returns an empty Enumeration. The
header name is case insensitive. You can use this method with any
request header.
name - a String specifying the header name
Enumeration containing the values of the
requested header. If the request does not have any headers of
that name return an empty enumeration. If the container does not
allow access to header information, return nullint getIntHeader(String name)
int. If the request does not have a header of the
specified name, this method returns -1. If the header cannot be
converted to an integer, this method throws a
NumberFormatException.
The header name is case insensitive.
name - a String specifying the name of a
request header
NumberFormatException - If the header value can't
be converted to an int
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||