Package dev.relism.flash.models
Class RequestLine
java.lang.Object
dev.relism.flash.models.RequestLine
The parsed request line plus headers: method, path, optional query, optional protocol token,
and the header container. Internal — reached via
HTTP/1.1 always has a protocol token on the wire (
Request.getRequestLine(), not
user-facing API.
One instance per connection, repositioned via reset(dev.relism.flash.http.HttpMethod, dev.relism.fpr.core.ByteView, dev.relism.fpr.core.ByteView, dev.relism.fpr.core.ByteView, dev.relism.flash.models.HeaderView) for every request rather than
reallocated — RequestParser owns it exactly the way it owns Http1HeaderMap.
reset(dev.relism.flash.http.HttpMethod, dev.relism.fpr.core.ByteView, dev.relism.fpr.core.ByteView, dev.relism.fpr.core.ByteView, dev.relism.flash.models.HeaderView) is public rather than package-private — matching
Http1HeaderMap.reset(byte[], int, int)'s and PathParams.reset(dev.relism.fpr.core.ByteView, int)'s own precedent — because
RequestParser (the owner and sole caller) lives in a different package
(dev.relism.flash, not dev.relism.flash.models). The public constructor below
remains for test/manual construction and simply delegates to reset(dev.relism.flash.http.HttpMethod, dev.relism.fpr.core.ByteView, dev.relism.fpr.core.ByteView, dev.relism.fpr.core.ByteView, dev.relism.flash.models.HeaderView).
protocol is optional
HTTP/1.1 always has a protocol token on the wire ("HTTP/1.1"); HTTP/2 has no equivalent
— a stream's version is implicit in which connection it belongs to. getProtocol() may
be null for a header container built by a future non-h1 implementation; h1 always
supplies a non-null value today.-
Constructor Summary
ConstructorsConstructorDescriptionRequestLine(HttpMethod method, dev.relism.fpr.core.ByteView path, dev.relism.fpr.core.ByteView query, dev.relism.fpr.core.ByteView protocol, HeaderView headers) Test / manual construction — delegates toreset(dev.relism.flash.http.HttpMethod, dev.relism.fpr.core.ByteView, dev.relism.fpr.core.ByteView, dev.relism.fpr.core.ByteView, dev.relism.flash.models.HeaderView). -
Method Summary
Modifier and TypeMethodDescriptiondev.relism.fpr.core.ByteViewgetPath()dev.relism.fpr.core.ByteViewThe wire protocol token (e.g.dev.relism.fpr.core.ByteViewgetQuery()Raw query string bytes (after?), ornullif the URI has no query string.voidreset(HttpMethod method, dev.relism.fpr.core.ByteView path, dev.relism.fpr.core.ByteView query, dev.relism.fpr.core.ByteView protocol, HeaderView headers) Repositions this instance over a new request.toString()
-
Constructor Details
-
RequestLine
public RequestLine() -
RequestLine
public RequestLine(HttpMethod method, dev.relism.fpr.core.ByteView path, dev.relism.fpr.core.ByteView query, dev.relism.fpr.core.ByteView protocol, HeaderView headers) Test / manual construction — delegates toreset(dev.relism.flash.http.HttpMethod, dev.relism.fpr.core.ByteView, dev.relism.fpr.core.ByteView, dev.relism.fpr.core.ByteView, dev.relism.flash.models.HeaderView).
-
-
Method Details
-
reset
public void reset(HttpMethod method, dev.relism.fpr.core.ByteView path, dev.relism.fpr.core.ByteView query, dev.relism.fpr.core.ByteView protocol, HeaderView headers) Repositions this instance over a new request. See the class Javadoc for why this ispublic. -
getMethod
-
getPath
public dev.relism.fpr.core.ByteView getPath() -
getQuery
public dev.relism.fpr.core.ByteView getQuery()Raw query string bytes (after?), ornullif the URI has no query string. -
getProtocol
public dev.relism.fpr.core.ByteView getProtocol()The wire protocol token (e.g."HTTP/1.1"), ornull— see the class Javadoc. -
getHeaders
-
toString
-