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


Java SubjectConfirmationData.getInResponseTo方法代码示例

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


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

示例1: testSingleElementOptionalAttributesUnmarshall

import org.opensaml.saml2.core.SubjectConfirmationData; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void testSingleElementOptionalAttributesUnmarshall() {
    SubjectConfirmationData subjectCD = (SubjectConfirmationData) unmarshallElement(singleElementOptionalAttributesFile);

    DateTime notBefore = subjectCD.getNotBefore();
    assertEquals("NotBefore was " + notBefore + ", expected " + expectedNotBefore, expectedNotBefore, notBefore);

    DateTime notOnOrAfter = subjectCD.getNotOnOrAfter();
    assertEquals("NotOnOrAfter was " + notOnOrAfter + ", expected " + expectedNotOnOrAfter, expectedNotOnOrAfter,
            notOnOrAfter);

    String recipient = subjectCD.getRecipient();
    assertEquals("Recipient was " + recipient + ", expected " + expectedRecipient, expectedRecipient, recipient);

    String inResponseTo = subjectCD.getInResponseTo();
    assertEquals("InResponseTo was " + inResponseTo + ", expected " + expectedInResponseTo, expectedInResponseTo,
            inResponseTo);

    String address = subjectCD.getAddress();
    assertEquals("Address was " + address + ", expected " + expectedAddress, expectedAddress, address);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:22,代码来源:SubjectConfirmationDataTest.java

示例2: marshallAttributes

import org.opensaml.saml2.core.SubjectConfirmationData; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
    SubjectConfirmationData subjectCD = (SubjectConfirmationData) samlObject;

    if (subjectCD.getNotBefore() != null) {
        String notBeforeStr = Configuration.getSAMLDateFormatter().print(subjectCD.getNotBefore());
        domElement.setAttributeNS(null, SubjectConfirmationData.NOT_BEFORE_ATTRIB_NAME, notBeforeStr);
    }

    if (subjectCD.getNotOnOrAfter() != null) {
        String notOnOrAfterStr = Configuration.getSAMLDateFormatter().print(subjectCD.getNotOnOrAfter());
        domElement.setAttributeNS(null, SubjectConfirmationData.NOT_ON_OR_AFTER_ATTRIB_NAME, notOnOrAfterStr);
    }

    if (subjectCD.getRecipient() != null) {
        domElement.setAttributeNS(null, SubjectConfirmationData.RECIPIENT_ATTRIB_NAME, subjectCD.getRecipient());
    }

    if (subjectCD.getInResponseTo() != null) {
        domElement.setAttributeNS(null, SubjectConfirmationData.IN_RESPONSE_TO_ATTRIB_NAME, subjectCD
                .getInResponseTo());
    }

    if (subjectCD.getAddress() != null) {
        domElement.setAttributeNS(null, SubjectConfirmationData.ADDRESS_ATTRIB_NAME, subjectCD.getAddress());
    }

    Attr attribute;
    for (Entry<QName, String> entry : subjectCD.getUnknownAttributes().entrySet()) {
        attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey());
        attribute.setValue(entry.getValue());
        domElement.setAttributeNodeNS(attribute);
        if (Configuration.isIDAttribute(entry.getKey())
                || subjectCD.getUnknownAttributes().isIDAttribute(entry.getKey())) {
            attribute.getOwnerElement().setIdAttributeNode(attribute, true);
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:39,代码来源:SubjectConfirmationDataMarshaller.java


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