Search in sources :

Example 1 with StatusMessageBuilder

use of org.opensaml.saml.saml2.core.impl.StatusMessageBuilder in project ddf by codice.

the class LoginFilter method createStatus.

/**
     * Creates the status object for the response.
     *
     * @param statusCodeValue
     * @param statusMessage
     * @return Status
     */
private static Status createStatus(String statusCodeValue, String statusMessage) {
    if (statusBuilder == null) {
        statusBuilder = (SAMLObjectBuilder<Status>) builderFactory.getBuilder(Status.DEFAULT_ELEMENT_NAME);
    }
    if (statusCodeBuilder == null) {
        statusCodeBuilder = (SAMLObjectBuilder<StatusCode>) builderFactory.getBuilder(StatusCode.DEFAULT_ELEMENT_NAME);
    }
    if (statusMessageBuilder == null) {
        statusMessageBuilder = (SAMLObjectBuilder<StatusMessage>) builderFactory.getBuilder(StatusMessage.DEFAULT_ELEMENT_NAME);
    }
    Status status = statusBuilder.buildObject();
    StatusCode statusCode = statusCodeBuilder.buildObject();
    statusCode.setValue(statusCodeValue);
    status.setStatusCode(statusCode);
    if (statusMessage != null) {
        StatusMessage statusMessageObject = statusMessageBuilder.buildObject();
        statusMessageObject.setMessage(statusMessage);
        status.setStatusMessage(statusMessageObject);
    }
    return status;
}
Also used : Status(org.opensaml.saml.saml2.core.Status) StatusCode(org.opensaml.saml.saml2.core.StatusCode) StatusMessage(org.opensaml.saml.saml2.core.StatusMessage)

Example 2 with StatusMessageBuilder

use of org.opensaml.saml.saml2.core.impl.StatusMessageBuilder in project syncope by apache.

the class SAML2PResponseComponentBuilder method createStatus.

public static Status createStatus(final String statusCodeValue, final String statusMessage) {
    if (statusBuilder == null) {
        statusBuilder = new StatusBuilder();
    }
    if (statusCodeBuilder == null) {
        statusCodeBuilder = new StatusCodeBuilder();
    }
    if (statusMessageBuilder == null) {
        statusMessageBuilder = new StatusMessageBuilder();
    }
    Status status = statusBuilder.buildObject();
    StatusCode statusCode = statusCodeBuilder.buildObject();
    statusCode.setValue(statusCodeValue);
    status.setStatusCode(statusCode);
    if (statusMessage != null) {
        StatusMessage statusMessageObject = statusMessageBuilder.buildObject();
        statusMessageObject.setMessage(statusMessage);
        status.setStatusMessage(statusMessageObject);
    }
    return status;
}
Also used : Status(org.opensaml.saml.saml2.core.Status) StatusMessageBuilder(org.opensaml.saml.saml2.core.impl.StatusMessageBuilder) StatusCodeBuilder(org.opensaml.saml.saml2.core.impl.StatusCodeBuilder) StatusBuilder(org.opensaml.saml.saml2.core.impl.StatusBuilder) StatusCode(org.opensaml.saml.saml2.core.StatusCode) StatusMessage(org.opensaml.saml.saml2.core.StatusMessage)

Example 3 with StatusMessageBuilder

use of org.opensaml.saml.saml2.core.impl.StatusMessageBuilder in project testcases by coheigea.

the class SAML2PResponseComponentBuilder method createStatus.

@SuppressWarnings("unchecked")
public static Status createStatus(String statusCodeValue, String statusMessage) {
    if (statusBuilder == null) {
        statusBuilder = (SAMLObjectBuilder<Status>) builderFactory.getBuilder(Status.DEFAULT_ELEMENT_NAME);
    }
    if (statusCodeBuilder == null) {
        statusCodeBuilder = (SAMLObjectBuilder<StatusCode>) builderFactory.getBuilder(StatusCode.DEFAULT_ELEMENT_NAME);
    }
    if (statusMessageBuilder == null) {
        statusMessageBuilder = (SAMLObjectBuilder<StatusMessage>) builderFactory.getBuilder(StatusMessage.DEFAULT_ELEMENT_NAME);
    }
    Status status = statusBuilder.buildObject();
    StatusCode statusCode = statusCodeBuilder.buildObject();
    statusCode.setValue(statusCodeValue);
    status.setStatusCode(statusCode);
    if (statusMessage != null) {
        StatusMessage statusMessageObject = statusMessageBuilder.buildObject();
        statusMessageObject.setMessage(statusMessage);
        status.setStatusMessage(statusMessageObject);
    }
    return status;
}
Also used : Status(org.opensaml.saml.saml2.core.Status) StatusCode(org.opensaml.saml.saml2.core.StatusCode) StatusMessage(org.opensaml.saml.saml2.core.StatusMessage)

Example 4 with StatusMessageBuilder

use of org.opensaml.saml.saml2.core.impl.StatusMessageBuilder in project cxf by apache.

the class SAML2PResponseComponentBuilder method createStatus.

@SuppressWarnings("unchecked")
public static Status createStatus(String statusCodeValue, String statusMessage) {
    if (statusBuilder == null) {
        statusBuilder = (SAMLObjectBuilder<Status>) builderFactory.getBuilder(Status.DEFAULT_ELEMENT_NAME);
    }
    if (statusCodeBuilder == null) {
        statusCodeBuilder = (SAMLObjectBuilder<StatusCode>) builderFactory.getBuilder(StatusCode.DEFAULT_ELEMENT_NAME);
    }
    if (statusMessageBuilder == null) {
        statusMessageBuilder = (SAMLObjectBuilder<StatusMessage>) builderFactory.getBuilder(StatusMessage.DEFAULT_ELEMENT_NAME);
    }
    Status status = statusBuilder.buildObject();
    StatusCode statusCode = statusCodeBuilder.buildObject();
    statusCode.setValue(statusCodeValue);
    status.setStatusCode(statusCode);
    if (statusMessage != null) {
        StatusMessage statusMessageObject = statusMessageBuilder.buildObject();
        statusMessageObject.setMessage(statusMessage);
        status.setStatusMessage(statusMessageObject);
    }
    return status;
}
Also used : Status(org.opensaml.saml.saml2.core.Status) StatusCode(org.opensaml.saml.saml2.core.StatusCode) StatusMessage(org.opensaml.saml.saml2.core.StatusMessage)

Example 5 with StatusMessageBuilder

use of org.opensaml.saml.saml2.core.impl.StatusMessageBuilder in project ddf by codice.

the class SamlAssertionValidatorImpl method createStatus.

/**
 * Creates the status object for the response.
 *
 * @param statusCodeValue
 * @param statusMessage
 * @return Status
 */
private static Status createStatus(String statusCodeValue, String statusMessage) {
    if (statusBuilder == null) {
        statusBuilder = (SAMLObjectBuilder<Status>) builderFactory.getBuilder(Status.DEFAULT_ELEMENT_NAME);
    }
    if (statusCodeBuilder == null) {
        statusCodeBuilder = (SAMLObjectBuilder<StatusCode>) builderFactory.getBuilder(StatusCode.DEFAULT_ELEMENT_NAME);
    }
    if (statusMessageBuilder == null) {
        statusMessageBuilder = (SAMLObjectBuilder<StatusMessage>) builderFactory.getBuilder(StatusMessage.DEFAULT_ELEMENT_NAME);
    }
    Status status = statusBuilder.buildObject();
    StatusCode statusCode = statusCodeBuilder.buildObject();
    statusCode.setValue(statusCodeValue);
    status.setStatusCode(statusCode);
    if (statusMessage != null) {
        StatusMessage statusMessageObject = statusMessageBuilder.buildObject();
        statusMessageObject.setMessage(statusMessage);
        status.setStatusMessage(statusMessageObject);
    }
    return status;
}
Also used : Status(org.opensaml.saml.saml2.core.Status) StatusCode(org.opensaml.saml.saml2.core.StatusCode) StatusMessage(org.opensaml.saml.saml2.core.StatusMessage)

Aggregations

Status (org.opensaml.saml.saml2.core.Status)5 StatusCode (org.opensaml.saml.saml2.core.StatusCode)5 StatusMessage (org.opensaml.saml.saml2.core.StatusMessage)5 StatusBuilder (org.opensaml.saml.saml2.core.impl.StatusBuilder)1 StatusCodeBuilder (org.opensaml.saml.saml2.core.impl.StatusCodeBuilder)1 StatusMessageBuilder (org.opensaml.saml.saml2.core.impl.StatusMessageBuilder)1