本文整理汇总了Java中org.opensaml.saml1.core.StatusCode.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java StatusCode.getValue方法的具体用法?Java StatusCode.getValue怎么用?Java StatusCode.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opensaml.saml1.core.StatusCode
的用法示例。
在下文中一共展示了StatusCode.getValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateValueContent
import org.opensaml.saml1.core.StatusCode; //导入方法依赖的package包/类
/**
* Validates that the status code local name is one of the allowabled values.
*
* @param statusCode the status code to validate
*
* @throws ValidationException thrown if the status code local name is not an allowed value
*/
protected void validateValueContent(StatusCode statusCode) throws ValidationException {
QName statusValue = statusCode.getValue();
if (SAMLConstants.SAML10P_NS.equals(statusValue.getNamespaceURI())) {
if (!(statusValue.equals(StatusCode.SUCCESS)
|| statusValue.equals(StatusCode.VERSION_MISMATCH)
|| statusValue.equals(StatusCode.REQUESTER)
|| statusValue.equals(StatusCode.RESPONDER)
|| statusValue.equals(StatusCode.REQUEST_VERSION_TOO_HIGH)
|| 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");
}
}
示例2: marshallAttributes
import org.opensaml.saml1.core.StatusCode; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException {
StatusCode statusCode = (StatusCode) samlElement;
QName statusValue = statusCode.getValue();
if (statusValue != null) {
domElement.setAttributeNS(null, StatusCode.VALUE_ATTRIB_NAME, XMLHelper.qnameToContentString(statusValue));
}
}
示例3: validateValue
import org.opensaml.saml1.core.StatusCode; //导入方法依赖的package包/类
/**
* Validates that the status code has a value.
*
* @param statusCode status code to validate
*
* @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");
}
}