public void setEncoded(boolean encoded) { checkUpdatePassword(); this.encoded = encoded; }
public void setEnabled(boolean enabled) { checkUpdateState(); this.enabled = enabled; if (enabled) { setAuthenticationFailures(0); } }
public PasswordCredentialImpl(User user, String password) { setUser(user); this.password = password; }
public PasswordCredential getPasswordCredential(User user) throws SecurityException { if (isPersistCredentials()) { PasswordCredential credential = upcsm.getPasswordCredential(user); if (!credential.isNew() && upcpm != null) { if (upcpm.onLoad(credential, user.getName())) { upcsm.storePasswordCredential(credential); } } return credential; } else { // create new transient credential PasswordCredentialImpl credential = new PasswordCredentialImpl(); credential.setUser(user); return credential; } }
PasswordCredential credential = isPersistCredentials() ? upcam.getPasswordCredential(userName) : new PasswordCredentialImpl(); if (credential == null) credential = new PasswordCredentialImpl(); ((PasswordCredentialImpl)credential).setUser(um.getUser(userName)); ((PasswordCredentialImpl)credential).setUserName(userName);
public void setExpirationDate(Date expirationDate) { checkUpdateState(); this.expirationDate = expirationDate; if (expirationDate != null && new Date(new java.util.Date().getTime()).after(expirationDate)) { setExpired(true); } else { setExpired(false); } }
public void setExpired(boolean expired) { checkUpdateState(); this.expired = expired; }
public void setPassword(SSOUser user, String pwd) throws SSOException { PasswordCredential pwdCred = null; try{ pwdCred=ssoUserManagerSPI.getPasswordCredential(user); } catch (SecurityException secex){ } if (pwdCred != null){ pwdCred.setPassword(pwd, false); } else { pwdCred=new PasswordCredentialImpl(user,pwd); } try{ ssoUserManagerSPI.storePasswordCredential(pwdCred); } catch (SecurityException sx){ throw new SSOException(sx); } }
((PasswordCredentialImpl)passwordCredential).setUserName(userName);
((PasswordCredentialImpl)passwordCredential).setUser(user); passwordCredential = new PasswordCredentialImpl(); ((PasswordCredentialImpl)passwordCredential).setUser(user);
public void setLastAuthenticationDate(Timestamp lastAuthenticationDate) { checkUpdateState(); this.lastAuthenticationDate = lastAuthenticationDate; }
public void setAuthenticationFailures(int authenticationFailures) { checkUpdateState(); this.authenticationFailures = authenticationFailures; }
public void setPassword(String password, boolean encoded) { checkUpdatePassword(); if (password != null && (this.password == null || encoded != this.encoded || !password.equals(this.password))) { if (!newPasswordSet && currentPassword == null) { this.currentPassword = this.password; this.currentEncoded = this.encoded; } this.password = password; this.encoded = encoded; oldPassword = null; newPassword = null; newPasswordSet = true; } }
@SuppressWarnings("unchecked") public List<PasswordCredential> getHistoricPasswordCredentials(User user, Long securityDomain) { Criteria criteria = new Criteria(); criteria.addEqualTo("principalId", user.getId()); criteria.addEqualTo("type", PasswordCredential.TYPE_HISTORICAL); // check cache String cacheKey = "getHistoricPasswordCredentials:"+criteria; List<PasswordCredential> passwordCredentials = (List<PasswordCredential>) jspmCache.getPasswordCredentialQuery(cacheKey); if (passwordCredentials != null) { return new ArrayList<PasswordCredential>(passwordCredentials); } // perform query Query query = QueryFactory.newQuery(PasswordCredentialImpl.class,criteria); passwordCredentials = (List<PasswordCredential>)getPersistenceBrokerTemplate().execute(new ManagedListByQueryCallback(query)); for (PasswordCredential passwordCredential : passwordCredentials) { // store the user by hand as its configured as auto-retrieve="false" ((PasswordCredentialImpl)passwordCredential).setUser(user); } // put result in cache jspmCache.putPasswordCredentialQuery(cacheKey, user.getId(), user.getDomainId(), new ArrayList<PasswordCredential>(passwordCredentials)); // return result return passwordCredentials; }
public void setUpdateRequired(boolean updateRequired) { checkUpdateState(); this.updateRequired = updateRequired; }
public void setPassword(String oldPassword, String newPassword) { checkUpdatePassword(); if (newPassword != null && (oldPassword == null || !newPassword.equals(oldPassword))) { if (!newPasswordSet && currentPassword == null) { currentPassword = this.password; this.currentEncoded = this.encoded; } this.newPassword = newPassword; this.oldPassword = oldPassword; newPasswordSet = true; } }
public void setPreviousAuthenticationDate(Timestamp previousAuthenticationDate) { checkUpdateState(); this.previousAuthenticationDate = previousAuthenticationDate; }