@Override public SupportLevel getCredentialAcquireSupport(Class<? extends Credential> credentialType, String algorithmName, final AlgorithmParameterSpec parameterSpec) throws RealmUnavailableException { return getCacheableRealm().getCredentialAcquireSupport(credentialType, algorithmName, parameterSpec); }
@Override public SupportLevel getEvidenceVerifySupport(Class<? extends Evidence> evidenceType, String algorithmName) throws RealmUnavailableException { return getCacheableRealm().getEvidenceVerifySupport(evidenceType, algorithmName); }
@Override public void handleRealmEvent(RealmEvent event) { getCacheableRealm().handleRealmEvent(event); }
/** * Builds the {@link LegacyPropertiesSecurityRealm}. * @return built {@link LegacyPropertiesSecurityRealm} * @throws IOException when loading of property files fails * @throws java.io.FileNotFoundException when property file does not exist * @throws RealmUnavailableException when property file of users does not contain realm name specification */ public LegacyPropertiesSecurityRealm build() throws IOException { LegacyPropertiesSecurityRealm realm = new LegacyPropertiesSecurityRealm(this); realm.load(usersStream, groupsStream); return realm; }
private List<Credential> loadCredentials() throws RealmUnavailableException { final LoadedIdentity loadedIdentity = loadIdentity(false, true); return loadedIdentity == null ? Collections.emptyList() : loadedIdentity.getCredentials(); }
public AuthorizationIdentity getAuthorizationIdentity() throws RealmUnavailableException { final LoadedIdentity loadedIdentity = loadIdentity(true, false); return loadedIdentity == null ? AuthorizationIdentity.EMPTY : AuthorizationIdentity.basicIdentity(loadedIdentity.getAttributes()); }
/** * Release this lock. Invoking this method has no effect if this lock is invalid. */ public synchronized void release() { if (valid) { IdentitySharedExclusiveLock.this.release(this); valid = false; } }
@Override public SupportLevel getEvidenceVerifySupport(final Class<? extends Evidence> evidenceType, final String algorithmName) throws RealmUnavailableException { return LegacyPropertiesSecurityRealm.this.getEvidenceVerifySupport(evidenceType, algorithmName); }
@Override public <C extends Credential> C getCredential(final Class<C> credentialType, final String algorithmName) throws RealmUnavailableException { return getCredential(credentialType, algorithmName, null); }
private AccountEntry(String name, String passwordRepresentation, String groups) { this.name = name; this.passwordRepresentation = passwordRepresentation; this.groups = convertGroups(groups); }
/** * Obtain a new {@link Builder} capable of building a {@link LegacyPropertiesSecurityRealm}. * * @return a new {@link Builder} capable of building a {@link LegacyPropertiesSecurityRealm}. */ public static Builder builder() { return new Builder(); }
@Override public AuthorizationIdentity getAuthorizationIdentity() throws RealmUnavailableException { return new JaasAuthorizationIdentity(this.principal, this.subject); } }
private JaasAuthorizationIdentity(final Principal principal, final Subject subject) { this.principal = principal; this.subject = subject; // check if the subject has a caller principal group - if it has then we should use that principal. this.callerPrincipal = getCallerPrincipal(subject); }
@Override public <C extends Credential> C getCredential(final Class<C> credentialType, final String algorithmName) throws RealmUnavailableException { return getCredential(credentialType, algorithmName, null); }
@Override public RealmIdentity getRealmIdentity(final Principal principal) { return principal instanceof NamePrincipal ? new JaasRealmIdentity(principal) : RealmIdentity.NON_EXISTENT; }
@Override public SupportLevel getCredentialAcquireSupport(final Class<? extends Credential> credentialType, final String algorithmName, final AlgorithmParameterSpec parameterSpec) throws RealmUnavailableException { return JaasSecurityRealm.this.getCredentialAcquireSupport(credentialType, algorithmName, parameterSpec); }
public void dispose() { // Release the lock for this realm identity IdentityLock identityLock = lock; lock = null; if (identityLock != null) { identityLock.release(); } }
@Override public <C extends Credential> C getCredential(final Class<C> credentialType) throws RealmUnavailableException { return getCredential(credentialType, null); }
@Override public void dispose() { // Release the lock for this realm identity IdentityLock identityLock = lock; lock = null; if (identityLock != null) { identityLock.release(); } }
@Override public void close() { release(); }