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


Java Subject类代码示例

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


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

示例1: testFullElementsMarshall

import org.opensaml.saml1.core.Subject; //导入依赖的package包/类
/**
 * Test Marshalling up a file with children
 * 
 */
public void testFullElementsMarshall() {
    AuthorizationDecisionQuery authorizationDecisionQuery;
    authorizationDecisionQuery = (AuthorizationDecisionQuery) buildXMLObject(qname);
    authorizationDecisionQuery.setSubject((Subject) buildXMLObject(new QName(SAMLConstants.SAML1_NS, Subject.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX)));

    QName actionQname = new QName(SAMLConstants.SAML1_NS, Action.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
    List <Action> list = authorizationDecisionQuery.getActions();
    list.add((Action) buildXMLObject(actionQname));
    list.add((Action) buildXMLObject(actionQname));
    list.add((Action) buildXMLObject(actionQname));
    
    authorizationDecisionQuery.setEvidence((Evidence) buildXMLObject(new QName(SAMLConstants.SAML1_NS, Evidence.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX)));
    assertEquals(expectedFullDOM, authorizationDecisionQuery);

}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:20,代码来源:AuthorizationDecisionQueryTest.java

示例2: testChildElementsMarshall

import org.opensaml.saml1.core.Subject; //导入依赖的package包/类
/** {@inheritDoc} */

    public void testChildElementsMarshall() {
        AuthorizationDecisionStatement authorizationDecisionStatement;

        authorizationDecisionStatement = (AuthorizationDecisionStatement) buildXMLObject(qname);

        QName oqname = new QName(SAMLConstants.SAML1_NS, Subject.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
        authorizationDecisionStatement.setSubject((Subject) buildXMLObject(oqname));
        oqname = new QName(SAMLConstants.SAML1_NS, Action.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
        authorizationDecisionStatement.getActions().add((Action) buildXMLObject(oqname));
        authorizationDecisionStatement.getActions().add((Action) buildXMLObject(oqname));
        authorizationDecisionStatement.getActions().add((Action) buildXMLObject(oqname));
        oqname = new QName(SAMLConstants.SAML1_NS, Evidence.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
        authorizationDecisionStatement.setEvidence((Evidence) buildXMLObject(oqname));

        authorizationDecisionStatement.setEvidence((Evidence) buildXMLObject(oqname));

        assertEquals(expectedChildElementsDOM, authorizationDecisionStatement);
    }
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:21,代码来源:AuthorizationDecisionStatementTest.java

示例3: newSubject

import org.opensaml.saml1.core.Subject; //导入依赖的package包/类
private Subject newSubject(final String identifier) {
    final SubjectConfirmation confirmation = newSamlObject(SubjectConfirmation.class);
    final ConfirmationMethod method = newSamlObject(ConfirmationMethod.class);
    method.setConfirmationMethod(CONFIRMATION_METHOD);
    confirmation.getConfirmationMethods().add(method);
    final NameIdentifier nameIdentifier = newSamlObject(NameIdentifier.class);
    nameIdentifier.setNameIdentifier(identifier);
    final Subject subject = newSamlObject(Subject.class);
    subject.setNameIdentifier(nameIdentifier);
    subject.setSubjectConfirmation(confirmation);
    return subject;
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:13,代码来源:Saml10SuccessResponseView.java

示例4: processChildElement

import org.opensaml.saml1.core.Subject; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {
    SubjectQuery query = (SubjectQuery) parentSAMLObject;

    if (childSAMLObject instanceof Subject) {
        query.setSubject((Subject) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:SubjectQueryUnmarshaller.java

示例5: processChildElement

import org.opensaml.saml1.core.Subject; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {

    Subject subject = (Subject) parentSAMLObject;

    if (childSAMLObject instanceof NameIdentifier) {
        subject.setNameIdentifier((NameIdentifier) childSAMLObject);
    } else if (childSAMLObject instanceof SubjectConfirmation) {
        subject.setSubjectConfirmation((SubjectConfirmation) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:SubjectUnmarshaller.java

示例6: processChildElement

import org.opensaml.saml1.core.Subject; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {
    SubjectStatement statement = (SubjectStatement) parentSAMLObject;

    if (childSAMLObject instanceof Subject) {
        statement.setSubject((Subject) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:SubjectStatementUnmarshaller.java

示例7: populateRequiredData

import org.opensaml.saml1.core.Subject; //导入依赖的package包/类
/** {@inheritDoc} */
protected void populateRequiredData() {
    super.populateRequiredData();

    Subject subject = (Subject) target;
    
    QName qname = new QName(SAMLConstants.SAML1_NS, NameIdentifier.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
    subject.setNameIdentifier((NameIdentifier)buildXMLObject(qname));
    qname = new QName(SAMLConstants.SAML1_NS, SubjectConfirmation.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
    subject.setSubjectConfirmation((SubjectConfirmation)buildXMLObject(qname));
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:12,代码来源:SubjectSchemaTest.java

示例8: testMissingNameId

import org.opensaml.saml1.core.Subject; //导入依赖的package包/类
public void testMissingNameId(){
    Subject subject = (Subject) target;

    subject.setNameIdentifier(null);
    assertValidationPass("No NameIdenitifer, but SubjectConfirmation still present, should be valid");
    subject.setSubjectConfirmation(null);
    assertValidationFail("No NameIdenitifer and no SubjectConfirmation");
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:9,代码来源:SubjectSchemaTest.java

示例9: testMissingSubjectConf

import org.opensaml.saml1.core.Subject; //导入依赖的package包/类
public void testMissingSubjectConf(){
    Subject subject = (Subject) target;

    subject.setSubjectConfirmation(null);
    assertValidationPass("No SubjectConfirmation, but NameIdenitifer still present, should be valid");
    subject.setNameIdentifier(null);
    assertValidationFail("No NameIdenitifer and no SubjectConfirmation");
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:9,代码来源:SubjectSchemaTest.java

示例10: populateRequiredData

import org.opensaml.saml1.core.Subject; //导入依赖的package包/类
/** {@inheritDoc} */
protected void populateRequiredData() {
    super.populateRequiredData();
    
    SubjectQuery query = (SubjectQuery) target;
    QName qname = new QName(SAMLConstants.SAML1_NS, Subject.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
    query.setSubject((Subject) buildXMLObject(qname));
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:9,代码来源:SubjectQuerySpecTestBase.java

示例11: populateRequiredData

import org.opensaml.saml1.core.Subject; //导入依赖的package包/类
/** {@inheritDoc} */
protected void populateRequiredData() {
    super.populateRequiredData();

    SubjectStatement subjectStatement= (SubjectStatement) target;
    
    QName qname = new QName(SAMLConstants.SAML1_NS, Subject.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
    subjectStatement.setSubject((Subject)buildXMLObject(qname));
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:10,代码来源:SubjectStatementSchemaTestBase.java

示例12: testChildElementsMarshall

import org.opensaml.saml1.core.Subject; //导入依赖的package包/类
/** {@inheritDoc} */

    public void testChildElementsMarshall() {
        AuthenticationStatement authenticationStatement = (AuthenticationStatement) buildXMLObject(qname);

        authenticationStatement.setSubject((Subject) buildXMLObject(new QName(SAMLConstants.SAML1_NS, Subject.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX)));

        authenticationStatement.setSubjectLocality((SubjectLocality) buildXMLObject(new QName(SAMLConstants.SAML1_NS, SubjectLocality.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX)));
        QName authQname = new QName(SAMLConstants.SAML1_NS, AuthorityBinding.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
        authenticationStatement.getAuthorityBindings().add((AuthorityBinding) buildXMLObject(authQname));
        authenticationStatement.getAuthorityBindings().add((AuthorityBinding) buildXMLObject(authQname));

        assertEquals(expectedChildElementsDOM, authenticationStatement);
    }
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:15,代码来源:AuthenticationStatementTest.java

示例13: SubjectTest

import org.opensaml.saml1.core.Subject; //导入依赖的package包/类
/**
 * Constructor
 */
public SubjectTest() {
    super();

    singleElementFile = "/data/org/opensaml/saml1/impl/singleSubject.xml";
    childElementsFile = "/data/org/opensaml/saml1/impl/SubjectWithChildren.xml";
    qname = new QName(SAMLConstants.SAML1_NS, Subject.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML1_PREFIX);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:11,代码来源:SubjectTest.java

示例14: testSingleElementUnmarshall

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

    assertNull("Non zero number of child NameIdentifier elements", subject.getNameIdentifier());
    assertNull("Non zero number of child SubjectConfirmation elements", subject.getSubjectConfirmation());
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:8,代码来源:SubjectTest.java

示例15: testChildElementsUnmarshall

import org.opensaml.saml1.core.Subject; //导入依赖的package包/类
/**
 * Test an XML file with children
 */
public void testChildElementsUnmarshall() {
    Subject subject = (Subject) unmarshallElement(childElementsFile);

    assertNotNull("Zero child NameIdentifier elements", subject.getNameIdentifier());
    assertNotNull("Zero child SubjectConfirmation elements", subject.getSubjectConfirmation());
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:10,代码来源:SubjectTest.java


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