Search in sources :

Example 1 with PositiveIntegerValidator

use of com.sun.identity.shared.validation.PositiveIntegerValidator in project OpenAM by OpenRock.

the class FSSPAuthenticationContextInfo method setAuthenticationLevel.

/**
     * Sets authentication level.
     *
     * @param authenticationLevel Authentication Level.
     * @throws FSException if <code>authenticationLevel</code>
     *         is negative.
     */
public void setAuthenticationLevel(String authenticationLevel) throws FSException {
    PositiveIntegerValidator validator = PositiveIntegerValidator.getInstance();
    try {
        validator.validate(authenticationLevel);
        this.authenticationLevel = Integer.parseInt(authenticationLevel);
    } catch (ValidationException e) {
        throw new FSException(IFSConstants.META_INVALID_LEVEL, null);
    }
}
Also used : PositiveIntegerValidator(com.sun.identity.shared.validation.PositiveIntegerValidator) ValidationException(com.sun.identity.shared.validation.ValidationException) FSException(com.sun.identity.federation.common.FSException)

Aggregations

FSException (com.sun.identity.federation.common.FSException)1 PositiveIntegerValidator (com.sun.identity.shared.validation.PositiveIntegerValidator)1 ValidationException (com.sun.identity.shared.validation.ValidationException)1