当前位置: 首页>>代码示例>>Java>>正文


Java Assertion.getMinorVersion方法代码示例

本文整理汇总了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");
                }
            }
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:AssertionSpecValidator.java

示例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");
     }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:AssertionSchemaValidator.java

示例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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:AssertionUnmarshaller.java

示例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");
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:29,代码来源:AssertionMarshaller.java

示例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");
    }
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:29,代码来源:AssertionMarshaller.java


注:本文中的org.opensaml.saml1.core.Assertion.getMinorVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。