/** * Authorizes and caches the given <code>securityIdentity</code>. * * @param securityIdentity the identity to authorize and cache. If null, the corresponding identity will be removed from the cache */ public void setAuthorized(SecurityIdentity securityIdentity) { if (authorized = securityIdentity != null) { createDomainCache().put(securityIdentity); } else { createDomainCache().remove(); } }
/** * Returns a cached {@link SecurityIdentity}, if present in the cache. * * @return the cached identity or null if there is no entry in the cache */ public SecurityIdentity getIdentity() { CachedIdentity cachedIdentity = createDomainCache().get(); if (cachedIdentity != null) { return cachedIdentity.getSecurityIdentity(); } return null; }
/** * Returns the {@link Principal} representing the cached identity. * * @return the principal (not {@code null}) */ public Principal getPrincipal() { CachedIdentity cachedIdentity = createDomainCache().get(); if (cachedIdentity != null) { return new NamePrincipal(cachedIdentity.getName()); } return null; }
/** * Authorizes and caches the given <code>securityIdentity</code>. * * @param securityIdentity the identity to authorize and cache. If null, the corresponding identity will be removed from the cache */ public void setAuthorized(SecurityIdentity securityIdentity) { if (authorized = securityIdentity != null) { createDomainCache().put(securityIdentity); } else { createDomainCache().remove(); } }
/** * Authorizes and caches the given <code>securityIdentity</code>. * * @param securityIdentity the identity to authorize and cache. If null, the corresponding identity will be removed from the cache */ public void setAuthorized(SecurityIdentity securityIdentity) { if (authorized = securityIdentity != null) { createDomainCache().put(securityIdentity); } else { createDomainCache().remove(); } }
/** * Authorizes and caches the given <code>securityIdentity</code>. * * @param securityIdentity the identity to authorize and cache. If null, the corresponding identity will be removed from the cache */ public void setAuthorized(SecurityIdentity securityIdentity) { if (authorized = securityIdentity != null) { createDomainCache().put(securityIdentity); } else { createDomainCache().remove(); } }
/** * Returns a cached {@link SecurityIdentity}, if present in the cache. * * @return the cached identity or null if there is no entry in the cache */ public SecurityIdentity getIdentity() { CachedIdentity cachedIdentity = createDomainCache().get(); if (cachedIdentity != null) { return cachedIdentity.getSecurityIdentity(); } return null; }
/** * Returns a cached {@link SecurityIdentity}, if present in the cache. * * @return the cached identity or null if there is no entry in the cache */ public SecurityIdentity getIdentity() { CachedIdentity cachedIdentity = createDomainCache().get(); if (cachedIdentity != null) { return cachedIdentity.getSecurityIdentity(); } return null; }
/** * Returns a cached {@link SecurityIdentity}, if present in the cache. * * @return the cached identity or null if there is no entry in the cache */ public SecurityIdentity getIdentity() { CachedIdentity cachedIdentity = createDomainCache().get(); if (cachedIdentity != null) { return cachedIdentity.getSecurityIdentity(); } return null; }
/** * Returns the {@link Principal} representing the cached identity. * * @return the principal (not {@code null}) */ public Principal getPrincipal() { CachedIdentity cachedIdentity = createDomainCache().get(); if (cachedIdentity != null) { return new NamePrincipal(cachedIdentity.getName()); } return null; }
/** * Returns the {@link Principal} representing the cached identity. * * @return the principal (not {@code null}) */ public Principal getPrincipal() { CachedIdentity cachedIdentity = createDomainCache().get(); if (cachedIdentity != null) { return new NamePrincipal(cachedIdentity.getName()); } return null; }
/** * Returns the {@link Principal} representing the cached identity. * * @return the principal (not {@code null}) */ public Principal getPrincipal() { CachedIdentity cachedIdentity = createDomainCache().get(); if (cachedIdentity != null) { return new NamePrincipal(cachedIdentity.getName()); } return null; }