Class SecurityContextInjectee
- java.lang.Object
-
- org.glassfish.jersey.server.internal.process.SecurityContextInjectee
-
- All Implemented Interfaces:
javax.ws.rs.core.SecurityContext
class SecurityContextInjectee extends java.lang.Object implements javax.ws.rs.core.SecurityContextProxiable wrapper for request scopedSecurityContextinstance.This wrapper must be used and cannot be replaced by
ReferencingFactory. The reason is thatsecurity contextcan 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.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.ws.rs.container.ContainerRequestContextrequestContext
-
Constructor Summary
Constructors Constructor Description SecurityContextInjectee(javax.ws.rs.container.ContainerRequestContext requestContext)Injection constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcheckState()booleanequals(java.lang.Object that)java.lang.StringgetAuthenticationScheme()java.security.PrincipalgetUserPrincipal()inthashCode()booleanisSecure()booleanisUserInRole(java.lang.String role)
-
-
-
Method Detail
-
getUserPrincipal
public java.security.Principal getUserPrincipal()
- Specified by:
getUserPrincipalin interfacejavax.ws.rs.core.SecurityContext
-
isUserInRole
public boolean isUserInRole(java.lang.String role)
- Specified by:
isUserInRolein interfacejavax.ws.rs.core.SecurityContext
-
isSecure
public boolean isSecure()
- Specified by:
isSecurein interfacejavax.ws.rs.core.SecurityContext
-
getAuthenticationScheme
public java.lang.String getAuthenticationScheme()
- Specified by:
getAuthenticationSchemein interfacejavax.ws.rs.core.SecurityContext
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object that)
- Overrides:
equalsin classjava.lang.Object
-
checkState
private void checkState()
-
-