本文整理汇总了Java中org.opensaml.saml1.core.Assertion.getMinorVersion方法的典型用法代码示例。如果您正苦于以下问题:Java Assertion.getMinorVersion方法的具体用法?Java Assertion.getMinorVersion怎么用?Java Assertion.getMinorVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opensaml.saml1.core.Assertion
的用法示例。
在下文中一共展示了Assertion.getMinorVersion方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateDoNotCache
import org.opensaml.saml1.core.Assertion; //导入方法依赖的package包/类
protected void validateDoNotCache(Assertion assertion) throws ValidationException {
if (assertion.getMinorVersion() == 0) {
Conditions conditions = assertion.getConditions();
if (conditions != null) {
for (Condition condition : conditions.getConditions()) {
if (condition instanceof DoNotCacheCondition) {
throw new ValidationException("DoNotCacheCondition not valid in SAML1.0");
}
}
}
}
}
示例2: validateVersion
import org.opensaml.saml1.core.Assertion; //导入方法依赖的package包/类
/**
* Test that the version is SAML1.1 or 1.0
* @param assertion what to test
* @throws ValidationException
*/
protected void validateVersion(Assertion assertion) throws ValidationException {
if ((assertion.getMajorVersion() != 1) &&
(assertion.getMinorVersion() != 0 || assertion.getMinorVersion() != 1)) {
throw new ValidationException("Invalid Version");
}
}
示例3: unmarshall
import org.opensaml.saml1.core.Assertion; //导入方法依赖的package包/类
/** {@inheritDoc} */
public XMLObject unmarshall(Element domElement) throws UnmarshallingException {
// After regular unmarshalling, check the minor version and set ID-ness if not SAML 1.0
Assertion assertion = (Assertion) super.unmarshall(domElement);
if (assertion.getMinorVersion() != 0 && !DatatypeHelper.isEmpty(assertion.getID())) {
domElement.setIdAttributeNS(null, Assertion.ID_ATTRIB_NAME, true);
}
return assertion;
}
示例4: marshallAttributes
import org.opensaml.saml1.core.Assertion; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException {
Assertion assertion = (Assertion) samlElement;
if (assertion.getID() != null) {
domElement.setAttributeNS(null, Assertion.ID_ATTRIB_NAME, assertion.getID());
if (assertion.getMinorVersion() != 0) {
domElement.setIdAttributeNS(null, Assertion.ID_ATTRIB_NAME, true);
}
}
if (assertion.getIssuer() != null) {
domElement.setAttributeNS(null, Assertion.ISSUER_ATTRIB_NAME, assertion.getIssuer());
}
if (assertion.getIssueInstant() != null) {
String date = ISODateTimeFormat.dateTime().print(assertion.getIssueInstant());
domElement.setAttributeNS(null, Assertion.ISSUEINSTANT_ATTRIB_NAME, date);
}
domElement.setAttributeNS(null, Assertion.MAJORVERSION_ATTRIB_NAME, "1");
if (assertion.getMinorVersion() == 0) {
domElement.setAttributeNS(null, Assertion.MINORVERSION_ATTRIB_NAME, "0");
} else {
domElement.setAttributeNS(null, Assertion.MINORVERSION_ATTRIB_NAME, "1");
}
}
示例5: marshallAttributes
import org.opensaml.saml1.core.Assertion; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException {
Assertion assertion = (Assertion) samlElement;
if (assertion.getID() != null) {
domElement.setAttributeNS(null, Assertion.ID_ATTRIB_NAME, assertion.getID());
if (assertion.getMinorVersion() != 0){
domElement.setIdAttributeNS(null, Assertion.ID_ATTRIB_NAME, true);
}
}
if (assertion.getIssuer() != null) {
domElement.setAttributeNS(null, Assertion.ISSUER_ATTRIB_NAME, assertion.getIssuer());
}
if (assertion.getIssueInstant() != null) {
String date = ISODateTimeFormat.dateTime().print(assertion.getIssueInstant());
domElement.setAttributeNS(null, Assertion.ISSUEINSTANT_ATTRIB_NAME, date);
}
domElement.setAttributeNS(null, Assertion.MAJORVERSION_ATTRIB_NAME, "1");
if(assertion.getMinorVersion() == 0){
domElement.setAttributeNS(null, Assertion.MINORVERSION_ATTRIB_NAME, "0");
}else{
domElement.setAttributeNS(null, Assertion.MINORVERSION_ATTRIB_NAME, "1");
}
}