Package org.refcodes.net
Class HttpServerRequestImpl
- java.lang.Object
-
- org.refcodes.net.HttpRequestImpl
-
- org.refcodes.net.HttpServerRequestImpl
-
- All Implemented Interfaces:
HeaderFieldsAccessor<RequestHeaderFields>,HttpBodyAccessor,HttpInputStreamAccessor,HttpMethodAccessor,HttpRequest,HttpServerRequest,UrlAccessor
public class HttpServerRequestImpl extends HttpRequestImpl implements HttpServerRequest
The Class HttpServerRequestImpl.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.net.HeaderFieldsAccessor
HeaderFieldsAccessor.HeaderFieldsBuilder<T extends HeaderFields<?,?>,B extends HeaderFieldsAccessor.HeaderFieldsBuilder<T,B>>, HeaderFieldsAccessor.HeaderFieldsMutator<T extends HeaderFields<?,?>>, HeaderFieldsAccessor.HeaderFieldsProperty<T extends HeaderFields<?,?>>
-
Nested classes/interfaces inherited from interface org.refcodes.net.HttpBodyAccessor
HttpBodyAccessor.HttpBodyBuilder<B extends HttpBodyAccessor.HttpBodyBuilder<B>>, HttpBodyAccessor.HttpBodyMutator, HttpBodyAccessor.HttpBodyProperty, HttpBodyAccessor.HttpBodyProvider<EXC extends java.lang.Exception>
-
Nested classes/interfaces inherited from interface org.refcodes.net.HttpInputStreamAccessor
HttpInputStreamAccessor.HttpInputStreamBuilder<B extends HttpInputStreamAccessor.HttpInputStreamBuilder<B>>, HttpInputStreamAccessor.HttpInputStreamMutator, HttpInputStreamAccessor.HttpInputStreamProperty, HttpInputStreamAccessor.HttpInputStreamProvider<EXC extends java.lang.Exception>
-
Nested classes/interfaces inherited from interface org.refcodes.net.HttpMethodAccessor
HttpMethodAccessor.HttpMethodBuilder<B extends HttpMethodAccessor.HttpMethodBuilder<B>>, HttpMethodAccessor.HttpMethodMutator, HttpMethodAccessor.HttpMethodProperty
-
Nested classes/interfaces inherited from interface org.refcodes.net.UrlAccessor
UrlAccessor.UrlBuilder, UrlAccessor.UrlMutator, UrlAccessor.UrlProperty
-
-
Field Summary
Fields Modifier and Type Field Description protected MediaTypeFactoryLookup_mediaTypeFactoryLookup-
Fields inherited from class org.refcodes.net.HttpRequestImpl
_headerFields, _httpMethod, _url
-
-
Constructor Summary
Constructors Constructor Description HttpServerRequestImpl(HttpMethod aHttpMethod, Url aUrl, RequestHeaderFields aHeaderFields, java.io.InputStream aHttpInputStream, MediaTypeFactoryLookup aMediaTypeFactoryLookup)Constructs aHttpServerRequestwith all required attributes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetHttpBody()Retrieves the HTTP body from the HTTP body property.java.io.InputStreamgetHttpInputStream()Retrieves theInputStreamfrom the HTTPInputStreamproperty.<REQ> REQgetRequest(java.lang.Class<REQ> aRequestType)This method's implementation supports theHttpBodyMapto unmarshal an HTTP Request-Body into anHttpBodyMapwhen providing theHttpBodyMapas request type.java.lang.StringtoString()-
Methods inherited from interface org.refcodes.net.HeaderFieldsAccessor
getHeaderFields
-
Methods inherited from interface org.refcodes.net.HttpMethodAccessor
getHttpMethod
-
Methods inherited from class org.refcodes.net.HttpRequestImpl
getHeaderFields, getHttpMethod, getUrl
-
Methods inherited from interface org.refcodes.net.HttpServerRequest
getRequest
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.refcodes.net.UrlAccessor
getUrl
-
-
-
-
Field Detail
-
_mediaTypeFactoryLookup
protected MediaTypeFactoryLookup _mediaTypeFactoryLookup
-
-
Constructor Detail
-
HttpServerRequestImpl
public HttpServerRequestImpl(HttpMethod aHttpMethod, Url aUrl, RequestHeaderFields aHeaderFields, java.io.InputStream aHttpInputStream, MediaTypeFactoryLookup aMediaTypeFactoryLookup)
Constructs aHttpServerRequestwith all required attributes.- Parameters:
aHttpMethod- TheHttpMethodwith which the request has been sent.aUrl- TheUrlfrom which to take the URL specific data.aHeaderFields- TheRequestHeaderFieldssent by the request.aHttpInputStream- TheInputStreamrepresenting the request's HTTP body.aMediaTypeFactoryLookup- The lookup factory for retrieving the requiredMediaTypefactories.
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getRequest
public <REQ> REQ getRequest(java.lang.Class<REQ> aRequestType) throws BadRequestExceptionThis method's implementation supports theHttpBodyMapto unmarshal an HTTP Request-Body into anHttpBodyMapwhen providing theHttpBodyMapas request type.- Specified by:
getRequestin interfaceHttpServerRequest- Type Parameters:
REQ- the generic type- Parameters:
aRequestType- the request type- Returns:
- the request
- Throws:
BadRequestException- the bad request exception
-
getHttpInputStream
public java.io.InputStream getHttpInputStream()
Retrieves theInputStreamfrom the HTTPInputStreamproperty.- Specified by:
getHttpInputStreamin interfaceHttpInputStreamAccessor- Returns:
- The
InputStreamstored by theInputStreamproperty.
-
getHttpBody
public java.lang.String getHttpBody()
Retrieves the HTTP body from the HTTP body property.- Specified by:
getHttpBodyin interfaceHttpBodyAccessor- Returns:
- The HTTP body stored by the HTTP body property.
-
-