-
public interface HandshakeRequest
The handshake request represents the web socket defined Http GET request for the opening handshake of a web socket session.- Author:
- dannycoward
-
-
Field Summary
Fields Modifier and Type Field and Description static String
SEC_WEBSOCKET_EXTENSIONS
The Sec-WebSocket-Extensions header namestatic String
SEC_WEBSOCKET_KEY
The Sec-WebSocket-Key header namestatic String
SEC_WEBSOCKET_PROTOCOL
The Sec-WebSocket-Protocol header namestatic String
SEC_WEBSOCKET_VERSION
The Sec-WebSocket-Version header name
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description Map<String,List<String>>
getHeaders()
Return the read only Map of Http Headers that came with the handshake request.Object
getHttpSession()
Return a reference to the HttpSession that the web socket handshake that started this conversation was part of, if the implementation is part of a Java EE web container.Map<String,List<String>>
getParameterMap()
Return the request parameters associated with the request.String
getQueryString()
Return the query string associated with the request.URI
getRequestURI()
Return the request URI of the handshake request.Principal
getUserPrincipal()
Return the authenticated user ornull
if no user is authenticated for this handshake.boolean
isUserInRole(String role)
Checks whether the current user is in the given role.
-
-
-
Field Detail
-
SEC_WEBSOCKET_KEY
static final String SEC_WEBSOCKET_KEY
The Sec-WebSocket-Key header name- See Also:
- Constant Field Values
-
SEC_WEBSOCKET_PROTOCOL
static final String SEC_WEBSOCKET_PROTOCOL
The Sec-WebSocket-Protocol header name- See Also:
- Constant Field Values
-
SEC_WEBSOCKET_VERSION
static final String SEC_WEBSOCKET_VERSION
The Sec-WebSocket-Version header name- See Also:
- Constant Field Values
-
SEC_WEBSOCKET_EXTENSIONS
static final String SEC_WEBSOCKET_EXTENSIONS
The Sec-WebSocket-Extensions header name- See Also:
- Constant Field Values
-
-
Method Detail
-
getHeaders
Map<String,List<String>> getHeaders()
Return the read only Map of Http Headers that came with the handshake request. The header names are case insensitive.- Returns:
- the list of headers.
-
getUserPrincipal
Principal getUserPrincipal()
Return the authenticated user ornull
if no user is authenticated for this handshake.- Returns:
- the user principal.
-
getRequestURI
URI getRequestURI()
Return the request URI of the handshake request.- Returns:
- the request uri of the handshake request.
-
isUserInRole
boolean isUserInRole(String role)
Checks whether the current user is in the given role. Roles and role membership can be defined using deployment descriptors of the containing WAR file, if running in a Java EE web container. If the user has not been authenticated, the method returnsfalse
.- Parameters:
role
- the role being checked.- Returns:
- whether the authenticated user is in the role, or false if the user has not been authenticated.
-
getHttpSession
Object getHttpSession()
Return a reference to the HttpSession that the web socket handshake that started this conversation was part of, if the implementation is part of a Java EE web container.- Returns:
- the http session or
null
if either the websocket implementation is not part of a Java EE web container, or there is no HttpSession associated with the opening handshake request.
-
getParameterMap
Map<String,List<String>> getParameterMap()
Return the request parameters associated with the request.- Returns:
- the unmodifiable map of the request parameters.
-
getQueryString
String getQueryString()
Return the query string associated with the request.- Returns:
- the query string.
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/websocket/server/handshakerequest.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.