public abstract class LogoutEndpoint extends RestEndpoint
LoginEndpoint
,
AuthenticatedRequestHandler
uri
Constructor and Description |
---|
LogoutEndpoint(java.lang.String uri,
SessionAuthenticator sessionAuthenticator)
Constructs the endpoint at given URI.
|
Modifier and Type | Method and Description |
---|---|
protected abstract HTTPResponse |
failedLogoutResponse(HTTPRequest request,
java.util.Map<java.lang.String,java.lang.String> attributes)
Constructs the response upon failed logout.
|
HTTPResponse |
get(HTTPRequest request,
java.util.Map<java.lang.String,java.lang.String> attributes)
Handles
GET request on this endpoint. |
protected java.lang.String |
getSessionID(HTTPRequest request,
java.util.Map<java.lang.String,java.lang.String> attributes)
Retrieves the session ID from the cookies of the request.
|
protected HTTPResponse |
setLoggedOut(HTTPResponse response)
Updates the
response to delete the session ID cookie. |
protected abstract HTTPResponse |
successfulLogoutResponse(HTTPRequest request,
java.util.Map<java.lang.String,java.lang.String> attributes)
Constructs the response upon successful logout.
|
public LogoutEndpoint(java.lang.String uri, SessionAuthenticator sessionAuthenticator)
uri
- the URI of the RestEndpoint
.sessionAuthenticator
- the SessionAuthenticator
used to logout users.public HTTPResponse get(HTTPRequest request, java.util.Map<java.lang.String,java.lang.String> attributes)
RestEndpoint
GET
request on this endpoint.
Default implementation return a status code 501
get
in class RestEndpoint
request
- the request to handle.attributes
- the attributes populated by the request processing.protected java.lang.String getSessionID(HTTPRequest request, java.util.Map<java.lang.String,java.lang.String> attributes)
request
- the HTTPRequest
.attributes
- the attributes populated by the request processing.protected abstract HTTPResponse successfulLogoutResponse(HTTPRequest request, java.util.Map<java.lang.String,java.lang.String> attributes)
request
- the HTTPRequest
.attributes
- the attributes populated by the request processing.protected abstract HTTPResponse failedLogoutResponse(HTTPRequest request, java.util.Map<java.lang.String,java.lang.String> attributes)
request
- the HTTPRequest
.attributes
- the attributes populated by the request processing.protected HTTPResponse setLoggedOut(HTTPResponse response)
response
to delete the session ID cookie.response
- the response to send.