@Override public String toString() { StringBuilder builder = new StringBuilder(super.toString()); builder.append("[type='").append(getType()); builder.append("', expire='").append(getExpire() == null ? "" : getExpire().toString()); builder.append("', lastChange='").append(getLastChange() == null ? "" : getLastChange().toString()); builder.append("', unlocked='").append(getUnlocked() == null ? "" : getUnlocked().toString()); builder.append("', disable='").append(getDisable() == null ? "" : getDisable().toString()); builder.append("']"); return builder.toString(); } }
/** * Checks that the supplied credentials are valid for authentication * * @param identity * @param password * @return <tt>true</tt> if the credentials are valid * @throws ConnectorException */ protected boolean areCredentialsValid(Identity identity, char[] password) throws ConnectorException { try { final Object obj = ((Invocable) engine).invokeFunction("areCredentialsValid", identity, new String(password)); if(obj instanceof PasswordChangeRequiredException) { throw (PasswordChangeRequiredException)obj; } Boolean ok = (Boolean) obj; if (ok && identity.getPasswordStatus().getType().equals(PasswordStatusType.changeRequired)) { throw new PasswordChangeRequiredException(); } return ok; } catch (ScriptException e) { processScriptExecption(e); throw new ConnectorException("Failed script execution.", e); } catch (NoSuchMethodException e) { return super.areCredentialsValid(identity, password); } }