Package org.opensaml.xml.validation

Examples of org.opensaml.xml.validation.ValidationException


     * @param request
     * @throws ValidationException
     */
    protected void validateID(RequestAbstractType request) throws ValidationException {
        if (DatatypeHelper.isEmpty(request.getID())) {
            throw new ValidationException("RequestID is null, empty or whitespace");
        }
    }
View Full Code Here


     * @param request
     * @throws ValidationException
     */
    protected void validateIssueInstant(RequestAbstractType request) throws ValidationException {
        if (request.getIssueInstant() == null) {
            throw new ValidationException("No IssueInstant attribute present");
        }
    }
View Full Code Here

     * @throws ValidationException thrown if the statement does not have an authentication method
     */
    protected void validateAuthenticationMethod(AuthenticationStatement authenticationStatement)
            throws ValidationException {
        if (DatatypeHelper.isEmpty(authenticationStatement.getAuthenticationMethod())) {
            throw new ValidationException("No authenticationStatement URI is null");
        }
    }
View Full Code Here

     * @throws ValidationException thrown if the statement does not have an authentication instant
     */
    protected void validateAuthenticationInstant(AuthenticationStatement authenticationStatement)
            throws ValidationException {
        if (authenticationStatement.getAuthenticationInstant() == null) {
            throw new ValidationException("No authenticationInstant present");
        }
    }
View Full Code Here

     * @throws ValidationException thrown if the request has more than one assertion or both an assertion and a query
     */
    protected void validateAssertion(Request request) throws ValidationException {
        if (request.getQuery() != null) {
            if (request.getAssertionArtifacts().size() != 0) {
                throw new ValidationException("Both Query and one or more AssertionAtrifacts present");
            }
            if (request.getAssertionIDReferences().size() != 0) {
                throw new ValidationException("Both  Query and one ore more AsertionIDReferences present");
            }
        } else if (request.getAssertionArtifacts().size() != 0) {
            if (request.getAssertionIDReferences().size() != 0) {
                throw new ValidationException(
                        "Both one or more AssertionAtrifacts and one ore more AsertionIDReferences present");
            }
        } else if (request.getAssertionIDReferences().size() == 0) {
            throw new ValidationException("No AssertionAtrifacts, No Query, and No AsertionIDReferences present");
        }
    }
View Full Code Here

public class SubjectQuerySchemaValidator<QueryType extends SubjectQuery> implements Validator<QueryType> {

    /** {@inheritDoc} */
    public void validate(QueryType subjectQuery) throws ValidationException {
        if (subjectQuery.getSubject() == null) {
            throw new ValidationException("Subject element is missing");
        }
    }
View Full Code Here

     *
     * @throws ValidationException thrown if the attribute does not have any values
     */
    protected void validateAttributeValue(Attribute attribute) throws ValidationException {
        if (attribute.getAttributeValues().size() == 0) {
            throw new ValidationException("No AttributeValue elements present");
        }
    }
View Full Code Here

public class ActionSpecValidator implements Validator<Action> {

    /** {@inheritDoc} */
    public void validate(Action action) throws ValidationException {
         if (DatatypeHelper.isEmpty(action.getContents())) {
             throw new ValidationException("Action label must be specified");
         }

    }
View Full Code Here

     * @throws ValidationException thrown if the status code does not have a value
     */
    protected void validateValue(StatusCode statusCode) throws ValidationException {
        QName value = statusCode.getValue();
        if (value == null) {
            throw new ValidationException("No Value attribute present");
        }
    }
View Full Code Here

                    || statusValue.equals(StatusCode.REQUEST_VERSION_TOO_LOW)
                    || statusValue.equals(StatusCode.REQUEST_VERSION_DEPRICATED)
                    || statusValue.equals(StatusCode.TOO_MANY_RESPONSES)
                    || statusValue.equals(StatusCode.REQUEST_DENIED)
                    || statusValue.equals(StatusCode.RESOURCE_NOT_RECOGNIZED))) {
                throw new ValidationException(
                        "Status code value was in the SAML 1 protocol namespace but was not of an allowed value: "
                                + statusValue);
            }
        } else if (SAMLConstants.SAML1_NS.equals(statusValue.getNamespaceURI())) {
            throw new ValidationException(
                    "Status code value was in the SAML 1 assertion namespace, no values are allowed in that namespace");
        }
    }
View Full Code Here

TOP

Related Classes of org.opensaml.xml.validation.ValidationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.