class SecurityContextInjectee
extends java.lang.Object
implements javax.ws.rs.core.SecurityContext
SecurityContext instance.
This wrapper must be used and cannot be replaced by ReferencingFactory.
The reason is that security context can be set
many times during the request processing. However, the HK2 proxy caches
the first value that is injected. So, if for example any filter injects
security context, then this security context will be cached and it will
never be replaced for the same request. On the other hand, HK2 should
probably cache the first value returned in the request scope to prevent
that two subsequent calls done on the proxy will be forwarded to different
object if the the object changes in the meantime.
| Modifier and Type | Field and Description |
|---|---|
private javax.ws.rs.container.ContainerRequestContext |
requestContext |
| Constructor and Description |
|---|
SecurityContextInjectee(javax.ws.rs.container.ContainerRequestContext requestContext)
Injection constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
checkState() |
boolean |
equals(java.lang.Object that) |
java.lang.String |
getAuthenticationScheme() |
java.security.Principal |
getUserPrincipal() |
int |
hashCode() |
boolean |
isSecure() |
boolean |
isUserInRole(java.lang.String role) |
private final javax.ws.rs.container.ContainerRequestContext requestContext
@Inject public SecurityContextInjectee(javax.ws.rs.container.ContainerRequestContext requestContext)
requestContext - SecurityContext source.public java.security.Principal getUserPrincipal()
getUserPrincipal in interface javax.ws.rs.core.SecurityContextpublic boolean isUserInRole(java.lang.String role)
isUserInRole in interface javax.ws.rs.core.SecurityContextpublic boolean isSecure()
isSecure in interface javax.ws.rs.core.SecurityContextpublic java.lang.String getAuthenticationScheme()
getAuthenticationScheme in interface javax.ws.rs.core.SecurityContextpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object that)
equals in class java.lang.Objectprivate void checkState()