Java Code Examples for org.opensaml.saml2.core.StatusCode#setStatusCode()

The following examples show how to use org.opensaml.saml2.core.StatusCode#setStatusCode() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ErrorResponseBuilder.java    From carbon-identity with Apache License 2.0 6 votes vote down vote up
/**
 * Build the StatusCode for Status of Response
 *
 * @param parentStatusCode
 * @param childStatusCode
 * @return
 */
private StatusCode buildStatusCode(String parentStatusCode, StatusCode childStatusCode) throws IdentityException {

    if (parentStatusCode == null) {
        throw IdentityException.error("Invalid SAML Response Status Code");
    }

    StatusCode statusCode = new StatusCodeBuilder().buildObject();
    statusCode.setValue(parentStatusCode);

    //Set the status Message
    if (childStatusCode != null) {
        statusCode.setStatusCode(childStatusCode);
        return statusCode;
    } else {
        return statusCode;
    }
}
 
Example 2
Source File: StatusCodeUnmarshaller.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {
    StatusCode statusCode = (StatusCode) parentSAMLObject;

    if (childSAMLObject instanceof StatusCode) {
        statusCode.setStatusCode((StatusCode) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
Example 3
Source File: StatusGenerator.java    From MaxKey with Apache License 2.0 4 votes vote down vote up
public Status generateStatus( String value, String subStatus, String message ) {
	Status status =  builderStatus();
	
	StatusCode statusCode =  builderStatusCode(value);
	
	StatusCode subStatusCode =builderStatusCode(value);
	
	statusCode.setStatusCode(subStatusCode);
	
	status.setStatusCode(statusCode);
	
	StatusMessage statusMessage = builderStatusMessage(message);
	
	status.setStatusMessage(statusMessage);
	
	return status;
}