org.glassfish.jersey.internal.inject
Class SecurityContextInjectee
java.lang.Object
org.glassfish.jersey.internal.inject.SecurityContextInjectee
- All Implemented Interfaces:
- javax.ws.rs.core.SecurityContext
public class SecurityContextInjectee
- extends Object
- implements javax.ws.rs.core.SecurityContext
Proxiable wrapper for request scoped 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.
- Author:
- Jakub Podlesak (jakub.podlesak at oracle.com)
| Fields inherited from interface javax.ws.rs.core.SecurityContext |
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
SecurityContextInjectee
@Inject
public SecurityContextInjectee(javax.ws.rs.container.ContainerRequestContext requestContext)
getUserPrincipal
public Principal getUserPrincipal()
- Specified by:
getUserPrincipal in interface javax.ws.rs.core.SecurityContext
isUserInRole
public boolean isUserInRole(String role)
- Specified by:
isUserInRole in interface javax.ws.rs.core.SecurityContext
isSecure
public boolean isSecure()
- Specified by:
isSecure in interface javax.ws.rs.core.SecurityContext
getAuthenticationScheme
public String getAuthenticationScheme()
- Specified by:
getAuthenticationScheme in interface javax.ws.rs.core.SecurityContext
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
equals
public boolean equals(Object that)
- Overrides:
equals in class Object
Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.