Class HttpRequestParser
- java.lang.Object
-
- net.officefloor.server.buffer.StreamBufferScanner
-
- net.officefloor.server.http.parse.HttpRequestParser
-
public class HttpRequestParser extends StreamBufferScanner
HttpRequestparser.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHttpRequestParser.HttpRequestParserMetaDataMeta-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 ByteSequencegetEntity()Obtains the entityByteSequence.NonMaterialisedHttpHeadersgetHeaders()Obtains theNonMaterialisedHttpHeaders.java.util.function.Supplier<HttpMethod>getMethod()Obtains theSupplierof theHttpMethod.java.util.function.Supplier<java.lang.String>getRequestURI()Obtains theSupplierof the request URI.HttpVersiongetVersion()Obtains theHttpVersion.booleanparse()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 HttpExceptionParses theHttpRequest.- Returns:
trueshould theHttpRequestbe parsed. Otherwise,falseif further data is required.- Throws:
HttpException- If invalidHttpRequest.
-
getMethod
public java.util.function.Supplier<HttpMethod> getMethod()
Obtains theSupplierof theHttpMethod.- Returns:
Supplierof theHttpMethod.
-
getRequestURI
public java.util.function.Supplier<java.lang.String> getRequestURI()
Obtains theSupplierof the request URI.- Returns:
Supplierof 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:
ByteSequencefor the entity.
-
-