public interface ServerHttpConnection
OfficeFloor
.Modifier and Type | Method and Description |
---|---|
Serializable |
exportState()
Exports the state of the current
HttpRequest and
HttpResponse . |
String |
getHttpMethod()
Obtains the client sent HTTP method of the
ServerHttpConnection . |
HttpRequest |
getHttpRequest()
Obtains the
HttpRequest for this ServerHttpConnection . |
HttpResponse |
getHttpResponse()
Obtains the
HttpResponse for this ServerHttpConnection . |
InetSocketAddress |
getLocalAddress()
Obtains the local address for this
ServerHttpConnection . |
InetSocketAddress |
getRemoteAddress()
Obtains the remote address for this
ServerHttpConnection . |
void |
importState(Serializable momento)
Imports and overrides the current
HttpRequest and
HttpResponse with the input momento. |
boolean |
isSecure()
Indicates if the connection is over a secure channel (e.g.
|
HttpRequest getHttpRequest()
HttpRequest
for this ServerHttpConnection
.HttpRequest
for this ServerHttpConnection
.HttpResponse getHttpResponse()
HttpResponse
for this ServerHttpConnection
.HttpResponse
for this ServerHttpConnection
.boolean isSecure()
true
if connection is over a secure channel.InetSocketAddress getLocalAddress()
ServerHttpConnection
.InetSocketAddress
describing the local Socket
for
this ServerHttpConnection
.InetSocketAddress getRemoteAddress()
ServerHttpConnection
.InetSocketAddress
describing the remote Socket
for this ServerHttpConnection
.Serializable exportState() throws IOException
Exports the state of the current HttpRequest
and
HttpResponse
.
This enables maintaining the state of the HttpRequest
/
HttpResponse
and later reinstating them (typically after a
redirect).
HttpRequest
and
HttpResponse
state.IOException
- Should the state not be able to be exported.importState(Serializable)
void importState(Serializable momento) throws IllegalArgumentException, IOException
HttpRequest
and
HttpResponse
with the input momento.momento
- Momento exported from a ServerHttpConnection
.IllegalArgumentException
- Should the momento be invalid.IOException
- Should the state not be able to be imported.exportState()
String getHttpMethod()
Obtains the client sent HTTP method of the ServerHttpConnection
.
As the HttpRequest
method is overridden, this method may be used
by logic requiring to know the actual client HTTP method. An example of
this logic is the POST/redirect/GET pattern that needs to know whether
the client sent HttpRequest
method is a POST
or
GET
(regardless of imported state).
exportState()
,
importState(Serializable)
Copyright © 2005–2016. All rights reserved.