Class HttpRequestParser
- java.lang.Object
-
- net.officefloor.server.buffer.StreamBufferScanner
-
- net.officefloor.server.http.parse.HttpRequestParser
-
public class HttpRequestParser extends StreamBufferScanner
HttpRequest
parser.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HttpRequestParser.HttpRequestParserMetaData
Meta-data for theHttpRequestParser
.-
Nested classes/interfaces inherited from class net.officefloor.server.buffer.StreamBufferScanner
StreamBufferScanner.ScanTarget
-
-
Constructor Summary
Constructors Constructor Description HttpRequestParser(HttpRequestParser.HttpRequestParserMetaData metaData)
Initiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteSequence
getEntity()
Obtains the entityByteSequence
.NonMaterialisedHttpHeaders
getHeaders()
Obtains theNonMaterialisedHttpHeaders
.java.util.function.Supplier<HttpMethod>
getMethod()
Obtains theSupplier
of theHttpMethod
.java.util.function.Supplier<java.lang.String>
getRequestURI()
Obtains theSupplier
of the request URI.HttpVersion
getVersion()
Obtains theHttpVersion
.boolean
parse()
Parses theHttpRequest
.-
Methods inherited from class net.officefloor.server.buffer.StreamBufferScanner
appendStreamBuffer, buildByte, buildLong, buildShort, indexOf, peekToTarget, scanBytes, scanToTarget, skipBytes
-
-
-
-
Constructor Detail
-
HttpRequestParser
public HttpRequestParser(HttpRequestParser.HttpRequestParserMetaData metaData)
Initiate.- Parameters:
metaData
-HttpRequestParser.HttpRequestParserMetaData
.
-
-
Method Detail
-
parse
public boolean parse() throws HttpException
Parses theHttpRequest
.- Returns:
true
should theHttpRequest
be parsed. Otherwise,false
if further data is required.- Throws:
HttpException
- If invalidHttpRequest
.
-
getMethod
public java.util.function.Supplier<HttpMethod> getMethod()
Obtains theSupplier
of theHttpMethod
.- Returns:
Supplier
of theHttpMethod
.
-
getRequestURI
public java.util.function.Supplier<java.lang.String> getRequestURI()
Obtains theSupplier
of the request URI.- Returns:
Supplier
of the request URI.
-
getVersion
public HttpVersion getVersion()
Obtains theHttpVersion
.- Returns:
HttpVersion
.
-
getHeaders
public NonMaterialisedHttpHeaders getHeaders()
Obtains theNonMaterialisedHttpHeaders
.- Returns:
NonMaterialisedHttpHeaders
.
-
getEntity
public ByteSequence getEntity()
Obtains the entityByteSequence
.- Returns:
ByteSequence
for the entity.
-
-