本文整理汇总了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);
}
示例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");
}
}
示例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);
}
}
示例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");
}
示例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);
}
示例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);
}
示例7: OneTimeUseUnmarshaller
import org.opensaml.saml2.core.OneTimeUse; //导入依赖的package包/类
/** Constructor. */
public OneTimeUseUnmarshaller() {
super(SAMLConstants.SAML20_NS, OneTimeUse.DEFAULT_ELEMENT_LOCAL_NAME);
}
示例8: OneTimeUseMarshaller
import org.opensaml.saml2.core.OneTimeUse; //导入依赖的package包/类
/** Constructor. */
public OneTimeUseMarshaller() {
super(SAMLConstants.SAML20_NS, OneTimeUse.DEFAULT_ELEMENT_LOCAL_NAME);
}
示例9: testSingleElementUnmarshall
import org.opensaml.saml2.core.OneTimeUse; //导入依赖的package包/类
/** {@inheritDoc} */
public void testSingleElementUnmarshall() {
OneTimeUse oneTimeUse = (OneTimeUse) unmarshallElement(singleElementFile);
assertNotNull(oneTimeUse);
}
示例10: getOneTimeUse
import org.opensaml.saml2.core.OneTimeUse; //导入依赖的package包/类
public OneTimeUse getOneTimeUse() {
return null;
}