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


Java OneTimeUse类代码示例

本文整理汇总了Java中org.opensaml.saml2.core.OneTimeUse的典型用法代码示例。如果您正苦于以下问题:Java OneTimeUse类的具体用法?Java OneTimeUse怎么用?Java OneTimeUse使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OneTimeUse类属于org.opensaml.saml2.core包,在下文中一共展示了OneTimeUse类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testChildElementsMarshall

import org.opensaml.saml2.core.OneTimeUse; //导入依赖的package包/类
/** {@inheritDoc} */
public void testChildElementsMarshall() {
    QName qname = new QName(SAMLConstants.SAML20_NS, Conditions.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20_PREFIX);
    Conditions conditions = (Conditions) buildXMLObject(qname);

    QName oneTimeUserQName = new QName(SAMLConstants.SAML20_NS, OneTimeUse.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20_PREFIX);
    conditions.getConditions().add((Condition) buildXMLObject(oneTimeUserQName));
    
    QName audienceRestrictionQName = new QName(SAMLConstants.SAML20_NS, AudienceRestriction.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20_PREFIX);
    for (int i = 0; i < audienceRestrictionCount; i++) {
        conditions.getAudienceRestrictions().add((AudienceRestriction) buildXMLObject(audienceRestrictionQName));
    }
    
    conditions.getConditions().add((Condition) buildXMLObject(oneTimeUserQName));
    
    QName proxyRestrictionQName = new QName(SAMLConstants.SAML20_NS, ProxyRestriction.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20_PREFIX);
    conditions.getConditions().add((Condition) buildXMLObject(proxyRestrictionQName));
    
    assertEquals(expectedChildElementsDOM, conditions);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:21,代码来源:ConditionsTest.java

示例2: validateOneTimeUseCondition

import org.opensaml.saml2.core.OneTimeUse; //导入依赖的package包/类
/**
 * Checks that there is at most one OneTimeUse condition.
 * 
 * @param conditions
 * @throws ValidationException
 */
protected void validateOneTimeUseCondition(Conditions conditions) throws ValidationException {
    int oneTimeUseCount = 0;
    for (int i = 0; i < conditions.getConditions().size(); i++) {
        if (conditions.getConditions().get(i) instanceof OneTimeUse) {
            oneTimeUseCount++;
        }
    }
    
    if (oneTimeUseCount > 1) {
        throw new ValidationException("At most one instance of OneTimeUse allowed");
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:ConditionsSpecValidator.java

示例3: getOneTimeUse

import org.opensaml.saml2.core.OneTimeUse; //导入依赖的package包/类
/** {@inheritDoc} */
public OneTimeUse getOneTimeUse() {
    QName conditionQName = new QName(SAMLConstants.SAML20_NS, OneTimeUse.DEFAULT_ELEMENT_LOCAL_NAME,
            SAMLConstants.SAML20_PREFIX);
    List<OneTimeUse> list = (List<OneTimeUse>) conditions.subList(conditionQName);
    if (list == null || list.size() == 0) {
        return null;
    } else {
        return list.get(0);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:ConditionsImpl.java

示例4: testOneTimeUseFailure

import org.opensaml.saml2.core.OneTimeUse; //导入依赖的package包/类
/**
 * Tests OneTimeUse failure.
 * 
 * @throws ValidationException
 */
public void testOneTimeUseFailure() throws ValidationException {
    Conditions conditions = (Conditions) target;

    OneTimeUse oneTimeUse1 = (OneTimeUse) buildXMLObject(new QName(SAMLConstants.SAML20_NS, OneTimeUse.DEFAULT_ELEMENT_LOCAL_NAME,
            SAMLConstants.SAML20_PREFIX));

    OneTimeUse oneTimeUse2 = (OneTimeUse) buildXMLObject(new QName(SAMLConstants.SAML20_NS, OneTimeUse.DEFAULT_ELEMENT_LOCAL_NAME,
            SAMLConstants.SAML20_PREFIX));
    
    conditions.getConditions().add(oneTimeUse1);
    conditions.getConditions().add(oneTimeUse2);
    assertValidationFail("Multiple OneTimeUse conditions present, should raise a Validation Exception");
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:19,代码来源:ConditionsSpecTest.java

示例5: testSingleElementMarshall

import org.opensaml.saml2.core.OneTimeUse; //导入依赖的package包/类
/** {@inheritDoc} */
public void testSingleElementMarshall() {
    QName qname = new QName(SAMLConstants.SAML20_NS, OneTimeUse.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20_PREFIX);
    OneTimeUse oneTimeUse = (OneTimeUse) buildXMLObject(qname);

    assertEquals(expectedDOM, oneTimeUse);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:8,代码来源:OneTimeUseTest.java

示例6: buildObject

import org.opensaml.saml2.core.OneTimeUse; //导入依赖的package包/类
/** {@inheritDoc} */
public OneTimeUse buildObject() {
    return buildObject(SAMLConstants.SAML20_NS, OneTimeUse.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20_PREFIX);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:OneTimeUseBuilder.java

示例7: OneTimeUseUnmarshaller

import org.opensaml.saml2.core.OneTimeUse; //导入依赖的package包/类
/** Constructor. */
public OneTimeUseUnmarshaller() {
    super(SAMLConstants.SAML20_NS, OneTimeUse.DEFAULT_ELEMENT_LOCAL_NAME);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:5,代码来源:OneTimeUseUnmarshaller.java

示例8: OneTimeUseMarshaller

import org.opensaml.saml2.core.OneTimeUse; //导入依赖的package包/类
/** Constructor. */
public OneTimeUseMarshaller() {
    super(SAMLConstants.SAML20_NS, OneTimeUse.DEFAULT_ELEMENT_LOCAL_NAME);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:5,代码来源:OneTimeUseMarshaller.java

示例9: testSingleElementUnmarshall

import org.opensaml.saml2.core.OneTimeUse; //导入依赖的package包/类
/** {@inheritDoc} */
public void testSingleElementUnmarshall() {
    OneTimeUse oneTimeUse = (OneTimeUse) unmarshallElement(singleElementFile);

    assertNotNull(oneTimeUse);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:7,代码来源:OneTimeUseTest.java

示例10: getOneTimeUse

import org.opensaml.saml2.core.OneTimeUse; //导入依赖的package包/类
public OneTimeUse getOneTimeUse() {

		return null;
	}
 
开发者ID:amagdenko,项目名称:oiosaml.java,代码行数:5,代码来源:ConditionsStubImpl.java


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