public class HttpServerRequestWrapper extends Object implements HttpServerRequest
Determined to be used as base class for HttpServerRequest
without need to implement
methods delegating requests to the delegated implementation.
Constructor and Description |
---|
HttpServerRequestWrapper(HttpServerRequest delegate)
Construct new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
authenticationComplete(HttpServerMechanismsResponder responder)
Notification that authentication is now complete.
|
void |
authenticationComplete(HttpServerMechanismsResponder responder,
Runnable logoutHandler)
Notification that authentication is now complete.
|
void |
authenticationFailed(String message,
HttpServerMechanismsResponder responder)
Notification that authentication failes.
|
void |
authenticationInProgress(HttpServerMechanismsResponder responder)
Notification that this mechanism has commenced but not completed authentication, typically because another challenge /
response round trip is required.
|
void |
badRequest(HttpAuthenticationException failure,
HttpServerMechanismsResponder responder)
Notification to indicate that this was a bad request.
|
List<HttpServerCookie> |
getCookies()
Returns a
List containing all of the HttpServerCookie objects the client sent with this request, or an empty List if no cookies were included in the request. |
String |
getFirstParameterValue(String name)
Get the first value for the parameter specified.
|
String |
getFirstRequestHeaderValue(String headerName)
Get the first value for the header specified in the HTTP request.
|
InputStream |
getInputStream()
Returns the request input stream.
|
Set<String> |
getParameterNames()
Returns the names of all parameters either from the query string or from the form data where available.
|
Map<String,List<String>> |
getParameters()
Returns the parameters received in the current request.
|
List<String> |
getParameterValues(String name)
Return the values for the parameter specified, where a parameter is specified both in the query string and in the form data the query string values will be first in the
List . |
Certificate[] |
getPeerCertificates()
Get the peer certificates established on the connection.
|
List<String> |
getRequestHeaderValues(String headerName)
Get a list of all of the values set for the specified header within the HTTP request.
|
String |
getRequestMethod()
Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT.
|
String |
getRequestPath()
Get the request path.
|
URI |
getRequestURI()
Get the URI representation for the current request.
|
HttpScope |
getScope(Scope scope)
Get the specified
HttpScope if available. |
HttpScope |
getScope(Scope scope,
String id)
Get the specified
HttpScope with the specified ID. |
Collection<String> |
getScopeIds(Scope scope)
Get the IDs available for the scope specified.
|
InetSocketAddress |
getSourceAddress()
Get the source address of the HTTP request.
|
SSLSession |
getSSLSession()
Get the
SSLSession (if any) that has been established for the connection in use. |
void |
noAuthenticationInProgress(HttpServerMechanismsResponder responder)
Notification from the mechanism to state no authentication is in progress whilst evaluating the current request.
|
boolean |
resumeRequest()
Resume any previously suspended request.
|
boolean |
suspendRequest()
Suspend the current request so that it can be subsequently resumed.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
authenticationComplete, authenticationFailed, badRequest, noAuthenticationInProgress
public HttpServerRequestWrapper(HttpServerRequest delegate)
delegate
- a request to which will be delegated any requestspublic HttpScope getScope(Scope scope)
HttpServerScopes
HttpScope
if available.getScope
in interface HttpServerScopes
scope
- the type of the scope required.null
if not supported.public Collection<String> getScopeIds(Scope scope)
HttpServerScopes
getScopeIds
in interface HttpServerScopes
scope
- the scope the IDs are required for.null
if the scope specified does not support obtaining scopes by ID.public HttpScope getScope(Scope scope, String id)
HttpServerScopes
HttpScope
with the specified ID.getScope
in interface HttpServerScopes
scope
- the type of the scope required.id
- the id of the scope instance required.null
if not supported or if the scope with that ID does not exist.public List<String> getRequestHeaderValues(String headerName)
HttpServerRequest
getRequestHeaderValues
in interface HttpServerRequest
headerName
- the not null
name of the header the values are required for.null
should be returned.public String getFirstRequestHeaderValue(String headerName)
HttpServerRequest
getFirstRequestHeaderValue
in interface HttpServerRequest
headerName
- the not null
name of the header the value is required for.null
should
be returned instead.public SSLSession getSSLSession()
HttpServerRequest
SSLSession
(if any) that has been established for the connection in use.
Note that even if this is null HttpServerRequest.getPeerCertificates()
can still return some certificates, as the certificates
may have been provided to the underlying server via some external mechanism (such as headers).getSSLSession
in interface HttpServerRequest
SSLSession
(if any) that has been established for the connection in use, or null
if none
exists.public Certificate[] getPeerCertificates()
HttpServerRequest
getPeerCertificates
in interface HttpServerRequest
null
if none available.public void noAuthenticationInProgress(HttpServerMechanismsResponder responder)
HttpServerRequest
noAuthenticationInProgress
in interface HttpServerRequest
responder
- a HttpServerMechanismsResponder
that can send a challenge should it be required.public void authenticationInProgress(HttpServerMechanismsResponder responder)
HttpServerRequest
authenticationInProgress
in interface HttpServerRequest
responder
- a HttpServerMechanismsResponder
that can send a challenge should it be required.public void authenticationComplete(HttpServerMechanismsResponder responder)
HttpServerRequest
authenticationComplete
in interface HttpServerRequest
responder
- a HttpServerMechanismsResponder
that can send a response.public void authenticationComplete(HttpServerMechanismsResponder responder, Runnable logoutHandler)
HttpServerRequest
Notification that authentication is now complete.
This method behaves exactly like {@link #authenticationComplete(HttpServerMechanismsResponder)}
, allowing
mechanisms to register a logout handler which should be called when a logout request is received by the underlying container.
authenticationComplete
in interface HttpServerRequest
responder
- a HttpServerMechanismsResponder
that can send a response.logoutHandler
- a Runnable
that can handle logoutpublic void authenticationFailed(String message, HttpServerMechanismsResponder responder)
HttpServerRequest
authenticationFailed
in interface HttpServerRequest
message
- an error message describing the failure.responder
- a HttpServerMechanismsResponder
that can send a challenge should it be required.public void badRequest(HttpAuthenticationException failure, HttpServerMechanismsResponder responder)
HttpServerRequest
badRequest
in interface HttpServerRequest
failure
- an HttpAuthenticationException
to describe the error.responder
- a HttpServerMechanismsResponder
that can send a challenge should it be required.public String getRequestMethod()
HttpServerRequest
getRequestMethod
in interface HttpServerRequest
String
specifying the name of the method with which this request was madepublic URI getRequestURI()
HttpServerRequest
getRequestURI
in interface HttpServerRequest
public String getRequestPath()
HttpServerRequest
http://my.appserver.com/my-application/path/sub-path
this method is going to return /path/sub-path
.getRequestPath
in interface HttpServerRequest
public Map<String,List<String>> getParameters()
HttpServerRequest
List
will contain the values from the query
string followed by the values from the form data.getParameters
in interface HttpServerRequest
public Set<String> getParameterNames()
HttpServerRequest
getParameterNames
in interface HttpServerRequest
public List<String> getParameterValues(String name)
HttpServerRequest
List
.getParameterValues
in interface HttpServerRequest
name
- the name of the desires parameter values.null
if the parameter was not in the request.public String getFirstParameterValue(String name)
HttpServerRequest
getFirstParameterValue
in interface HttpServerRequest
name
- the name of the parameter the first value is required for.null
if the parameter is not available.public List<HttpServerCookie> getCookies()
HttpServerRequest
List
containing all of the HttpServerCookie
objects the client sent with this request, or an empty List
if no cookies were included in the request.getCookies
in interface HttpServerRequest
List
containing all of the HttpServerCookie
objects the client sent with this request, or an empty List
if no cookies were included in the request.public InputStream getInputStream()
HttpServerRequest
getInputStream
in interface HttpServerRequest
public InetSocketAddress getSourceAddress()
HttpServerRequest
getSourceAddress
in interface HttpServerRequest
public boolean suspendRequest()
HttpServerRequest
suspendRequest
in interface HttpServerRequest
true
if suspending requests is supported, false
otherwise.public boolean resumeRequest()
HttpServerRequest
resumeRequest
in interface HttpServerRequest
true
if resuming requests is supported, false
otherwise.Copyright © 2020 JBoss by Red Hat. All rights reserved.