本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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));
}
示例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");
}
示例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");
}
示例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));
}
示例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));
}
示例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);
}
示例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);
}
示例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());
}
示例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());
}