public void setSecretQuestion(String secretQuestion) { if(secretQuestion != null && secretQuestion.trim().length()>0) { this.updateAttribute(new IdentityAttribute("secretQuestion", secretQuestion)); } }
public void activate() { IdentityAttribute active = this.readAttribute("active"); if(active == null) { active = new IdentityAttribute("active", Boolean.TRUE.toString()); this.addAttribute(active); } else { active.setValue(Boolean.TRUE.toString()); this.updateAttribute(active); } }
public boolean isActive() { boolean isActive = false; IdentityAttribute active = this.readAttribute("active"); if(active != null && active.getValue().equals(Boolean.TRUE.toString())) { isActive = true; } return isActive; }
private IdentityAttribute find(IdentityAttribute attribute) { IdentityAttribute cour = null; Set<IdentityAttribute> attributes = this.getAttributes(); for(IdentityAttribute loop: attributes) { if(loop.getName().equals(attribute.getName())) { return loop; } } return cour; } //-------------------------------------------------------------------------------------------------
public void deactivate() { IdentityAttribute active = this.readAttribute("active"); if(active == null) { active = new IdentityAttribute("active", Boolean.FALSE.toString()); this.addAttribute(active); } else { active.setValue(Boolean.FALSE.toString()); this.updateAttribute(active); } }
public String getAnswer() { String answer = null; if(this.readAttribute("answer") != null) { answer = this.readAttribute("answer").getValue(); } return answer; }
public void setInactiveCredential(String inactiveCredential) { if(inactiveCredential != null && inactiveCredential.trim().length()>0) { this.updateAttribute(new IdentityAttribute("inactive_credential", inactiveCredential)); } else { this.removeAttribute(new IdentityAttribute("inactive_credential", "")); } } //-------------------------------------------------------------------------------------------------------
public String getSecretQuestion() { String secretQuestion = null; if(this.readAttribute("secretQuestion") != null) { secretQuestion = this.readAttribute("secretQuestion").getValue(); } return secretQuestion; }
public void setAnswer(String answer) { if(answer != null && answer.trim().length()>0) { this.updateAttribute(new IdentityAttribute("answer", answer)); } }
public String getInactiveCredential() { String inactiveCredential = null; if(this.readAttribute("inactive_credential") != null) { inactiveCredential = this.readAttribute("inactive_credential").getValue(); } return inactiveCredential; }
public IdentityAttribute readAttribute(String name) { return this.find(new IdentityAttribute(name, null)); }
identity.setPrincipal(email); identity.setCredential(authenticationHash); identity.addAttribute(new IdentityAttribute("email", email)); identity.setInactiveCredential(credential); identity.activate();