/** * Removes a validation pattern * * @param key pattern key */ public static void removePattern(String key) { validatorConfig.removePattern(key); }
/** * Checks if a pattern exists for the provided key * * @param key pattern key * @return true if pattern exists or false if pattern does not exist */ public static boolean patternExists(String key) { return validatorConfig.patternExists(key); }
@Override public void init(InitConfig configuration) throws IdentityRuntimeException { if (configuration instanceof ModuleConfiguration) { this.configs = (ModuleConfiguration) configuration; } else { throw new IdentityRuntimeException("Initial configuration error"); } }
/** * @param request An instance of OpenIDAuthenticationRequest */ public OpenIDAttributeExchange(OpenIDAuthenticationRequest request) throws IdentityException { if (request == null) { log.debug("Request cannot be null while initializing OpenIDAttributeExchange"); throw IdentityException.error("Request cannot be null while initializing OpenIDAttributeExchange"); } this.openidAuthnRequest = request; }
public void addParameter(T1 key, T2 value){ if(this.parameters.containsKey(key)) { throw IdentityRuntimeException.error("Parameters map trying to override existing key " + key); } parameters.put(key, value); }
@Deprecated public static IdentityException error(String errorDescription, Throwable cause) { IdentityException identityException = new IdentityException(errorDescription, cause); // ErrorInfo.ErrorInfoBuilder errorInfoBuilder = new ErrorInfo.ErrorInfoBuilder(errorDescription); // errorInfoBuilder.cause(cause); // identityException.addErrorInfo(errorInfoBuilder.build()); return identityException; }
@Deprecated public static IdentityRuntimeException error(String errorDescription, Throwable cause) { IdentityRuntimeException identityRuntimeException = new IdentityRuntimeException(errorDescription, cause); ErrorInfo.ErrorInfoBuilder errorInfoBuilder = new ErrorInfo.ErrorInfoBuilder(errorDescription); errorInfoBuilder.cause(cause); identityRuntimeException.addErrorInfo(errorInfoBuilder.build()); return identityRuntimeException; }
public static IdentityRuntimeException error(ErrorInfo errorInfo) { if(errorInfo == null || StringUtils.isBlank(errorInfo.errorDescription)){ throw new IllegalArgumentException("ErrorInfo object is null or Error Description is blank"); } IdentityRuntimeException identityRuntimeException = null; if(errorInfo.getCause() != null) { identityRuntimeException = new IdentityRuntimeException(errorInfo.getErrorDescription(), errorInfo.getCause()); } else { identityRuntimeException = new IdentityRuntimeException(errorInfo.getErrorDescription()); } identityRuntimeException.addErrorInfo(errorInfo); return identityRuntimeException; }
/** * Adds a validation pattern and stores it against the provided key. * Throws an IllegalArgumentException if pattern key or pattern is empty, or if a pattern exists for the given key * * @param key pattern key * @param regex pattern regex */ public static void addPattern(String key, String regex) { validatorConfig.addPattern(key, regex); }
public ErrorInfo build(){ return new ErrorInfo(this); } }
/** * @param request An instance of OpenIDAuthenticationRequest */ public OpenIDPape(OpenIDAuthenticationRequest request) throws IdentityException { if (request == null) { log.debug("Request cannot be null while initializing OpenIDPape"); throw IdentityException.error("Request cannot be null while initializing OpenIDPape"); } this.request = request; }
@Deprecated public static IdentityRuntimeException error(String errorDescription) { IdentityRuntimeException identityRuntimeException = new IdentityRuntimeException(errorDescription); ErrorInfo.ErrorInfoBuilder errorInfoBuilder = new ErrorInfo.ErrorInfoBuilder(errorDescription); identityRuntimeException.addErrorInfo(errorInfoBuilder.build()); return identityRuntimeException; }
@Override public void init(InitConfig configuration) throws IdentityRuntimeException { if (configuration instanceof ModuleConfiguration) { this.configs = (ModuleConfiguration) configuration; } else { throw new IdentityRuntimeException("Initial configuration error"); } }
/** * Removes a validation pattern * * @param key pattern key */ public static void removePattern(String key) { validatorConfig.removePattern(key); }
/** * Checks if a pattern exists for the provided key * * @param key pattern key * @return true if pattern exists or false if pattern does not exist */ public static boolean patternExists(String key) { return validatorConfig.patternExists(key); }
/** * Adds a validation pattern and stores it against the provided key. * Throws an IllegalArgumentException if pattern key or pattern is empty, or if a pattern exists for the given key * * @param key pattern key * @param regex pattern regex */ public static void addPattern(String key, String regex) { validatorConfig.addPattern(key, regex); }
public static IdentityRuntimeException error(String errorCode, String message, Throwable cause) { return new IdentityRuntimeException(errorCode, message, cause); }
public static IdentityRuntimeException error(String message) { return new IdentityRuntimeException(message); }
public static IdentityRuntimeException error(String errorCode, String message) { return new IdentityRuntimeException(errorCode, message); }
public static IdentityRuntimeException error(String message, Throwable cause) { return new IdentityRuntimeException(message, cause); }