public String getSecretQuestion() { String secretQuestion = null; if(this.readAttribute("secretQuestion") != null) { secretQuestion = this.readAttribute("secretQuestion").getValue(); } return 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 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 void setSecretQuestion(String secretQuestion) { if(secretQuestion != null && secretQuestion.trim().length()>0) { this.updateAttribute(new IdentityAttribute("secretQuestion", secretQuestion)); } }
public IdentityAttribute readAttribute(String name) { return this.find(new IdentityAttribute(name, null)); }
public GroupAttribute readAttribute(String name) { return this.find(new GroupAttribute(name, null)); }
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; } //-------------------------------------------------------------------------------------------------
private GroupAttribute find(GroupAttribute attribute) { GroupAttribute cour = null; Set<GroupAttribute> attributes = this.getAttributes(); for(GroupAttribute loop: attributes) { if(loop.getName().equals(attribute.getName())) { return loop; } } return cour; } }
public void removeAttribute(GroupAttribute attribute) { GroupAttribute cour = this.find(attribute); if(cour != null) { this.getAttributes().remove(cour); } }
public void removeAttribute(IdentityAttribute attribute) { IdentityAttribute cour = this.find(attribute); if(cour != null) { this.getAttributes().remove(cour); } }
public boolean exists(String email) { return this.identityController.exists(email); }
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 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 boolean isActive() { boolean isActive = false; IdentityAttribute active = this.readAttribute("active"); if(active != null && active.getValue().equals(Boolean.TRUE.toString())) { isActive = true; } return isActive; }