本文整理汇总了Java中org.opensaml.saml2.metadata.AttributeAuthorityDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java AttributeAuthorityDescriptor类的具体用法?Java AttributeAuthorityDescriptor怎么用?Java AttributeAuthorityDescriptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AttributeAuthorityDescriptor类属于org.opensaml.saml2.metadata包,在下文中一共展示了AttributeAuthorityDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processChildElement
import org.opensaml.saml2.metadata.AttributeAuthorityDescriptor; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentElement, XMLObject childElement) throws UnmarshallingException {
AttributeAuthorityDescriptor descriptor = (AttributeAuthorityDescriptor) parentElement;
if (childElement instanceof AttributeService) {
descriptor.getAttributeServices().add((AttributeService) childElement);
} else if (childElement instanceof AssertionIDRequestService) {
descriptor.getAssertionIDRequestServices().add((AssertionIDRequestService) childElement);
} else if (childElement instanceof NameIDFormat) {
descriptor.getNameIDFormats().add((NameIDFormat) childElement);
} else if (childElement instanceof AttributeProfile) {
descriptor.getAttributeProfiles().add((AttributeProfile) childElement);
} else if (childElement instanceof Attribute) {
descriptor.getAttributes().add((Attribute) childElement);
} else {
super.processChildElement(parentElement, childElement);
}
}
示例2: testChildElementsUnmarshall
import org.opensaml.saml2.metadata.AttributeAuthorityDescriptor; //导入依赖的package包/类
/** {@inheritDoc} */
public void testChildElementsUnmarshall() {
EntityDescriptor descriptor = (EntityDescriptor) unmarshallElement(childElementsFile);
assertNotNull("Extensions child", descriptor.getExtensions());
assertNotNull("Signature child", descriptor.getSignature());
assertEquals("IDPSSODescriptor count", 2, descriptor.getRoleDescriptors(IDPSSODescriptor.DEFAULT_ELEMENT_NAME).size());
assertEquals("SPSSODescriptor count", 3, descriptor.getRoleDescriptors(SPSSODescriptor.DEFAULT_ELEMENT_NAME).size());
assertEquals("AuthnAuthorityDescriptor count", 2, descriptor.getRoleDescriptors(AuthnAuthorityDescriptor.DEFAULT_ELEMENT_NAME).size());
assertEquals("AttributeAuthorityDescriptor count", 1, descriptor.getRoleDescriptors(AttributeAuthorityDescriptor.DEFAULT_ELEMENT_NAME).size());
assertEquals("PDPDescriptor count", 2, descriptor.getRoleDescriptors(PDPDescriptor.DEFAULT_ELEMENT_NAME).size());
assertNotNull("AffiliationDescriptor ", descriptor.getAffiliationDescriptor());
assertNotNull("Organization ", descriptor.getOrganization());
assertEquals("ContactPerson count", 1, descriptor.getContactPersons().size());
assertEquals("AdditionalMetadataLocation count", 3, descriptor.getAdditionalMetadataLocations().size());
}
示例3: validateAttributeServices
import org.opensaml.saml2.metadata.AttributeAuthorityDescriptor; //导入依赖的package包/类
/**
* Checks that at least one AttributeService is present.
*
* @param attributeAuthorityDescriptor
* @throws ValidationException
*/
protected void validateAttributeServices(AttributeAuthorityDescriptor attributeAuthorityDescriptor)
throws ValidationException {
if (attributeAuthorityDescriptor.getAttributeServices() == null
|| attributeAuthorityDescriptor.getAttributeServices().size() == 0) {
throw new ValidationException("Must have one or more AttributeServices.");
}
}
示例4: getAttributeAuthorityDescriptor
import org.opensaml.saml2.metadata.AttributeAuthorityDescriptor; //导入依赖的package包/类
/** {@inheritDoc} */
public AttributeAuthorityDescriptor getAttributeAuthorityDescriptor(String supportedProtocol) {
List<RoleDescriptor> descriptors = getRoleDescriptors(AttributeAuthorityDescriptor.DEFAULT_ELEMENT_NAME,
supportedProtocol);
if (descriptors.size() > 0) {
return (AttributeAuthorityDescriptor) descriptors.get(0);
}
return null;
}
示例5: getAttributeQueryServiceLocation
import org.opensaml.saml2.metadata.AttributeAuthorityDescriptor; //导入依赖的package包/类
public String getAttributeQueryServiceLocation(String binding) throws IllegalArgumentException {
AttributeAuthorityDescriptor descriptor = entityDescriptor.getAttributeAuthorityDescriptor(SAMLConstants.SAML20P_NS);
if (descriptor == null) throw new IllegalArgumentException("Metadata does not contain a AttributeAuthorityDescriptor");
for (AttributeService service : descriptor.getAttributeServices()) {
if (binding.equals(service.getBinding())) {
return service.getLocation();
}
}
throw new IllegalArgumentException("Binding " + binding + " not found in AttributeServices");
}
示例6: populateRequiredData
import org.opensaml.saml2.metadata.AttributeAuthorityDescriptor; //导入依赖的package包/类
/** {@inheritDoc} */
protected void populateRequiredData() {
super.populateRequiredData();
AttributeAuthorityDescriptor attributeAuthorityDescriptor = (AttributeAuthorityDescriptor) target;
AttributeService attributeService = (AttributeService) buildXMLObject(new QName(SAMLConstants.SAML20MD_NS,
AttributeService.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX));
attributeAuthorityDescriptor.getAttributeServices().add(attributeService);
}
示例7: testAttributeServiceFailure
import org.opensaml.saml2.metadata.AttributeAuthorityDescriptor; //导入依赖的package包/类
/**
* Tests for AttributeService failure.
*
* @throws ValidationException
*/
public void testAttributeServiceFailure() throws ValidationException {
AttributeAuthorityDescriptor attributeAuthorityDescriptor = (AttributeAuthorityDescriptor) target;
attributeAuthorityDescriptor.getAttributeServices().clear();
assertValidationFail("Attribute Services list was empty, should raise Validation Exception");
}
示例8: populateRequiredData
import org.opensaml.saml2.metadata.AttributeAuthorityDescriptor; //导入依赖的package包/类
/** {@inheritDoc} */
protected void populateRequiredData() {
EntityDescriptor entityDescriptor = (EntityDescriptor) target;
AttributeAuthorityDescriptor attributeAuthorityDescriptor = (AttributeAuthorityDescriptor) buildXMLObject(new QName(
SAMLConstants.SAML20MD_NS, AttributeAuthorityDescriptor.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX));
entityDescriptor.getRoleDescriptors(AttributeAuthorityDescriptor.DEFAULT_ELEMENT_NAME).add(attributeAuthorityDescriptor);
entityDescriptor.setEntityID("entity id");
}
示例9: testWhiteListIdPRoles
import org.opensaml.saml2.metadata.AttributeAuthorityDescriptor; //导入依赖的package包/类
public void testWhiteListIdPRoles() throws Exception {
ArrayList<QName> retainedRoles = new ArrayList<QName>();
retainedRoles.add(IDPSSODescriptor.DEFAULT_ELEMENT_NAME);
retainedRoles.add(AttributeAuthorityDescriptor.DEFAULT_ELEMENT_NAME);
HTTPMetadataProvider metadataProvider = new HTTPMetadataProvider(inCommonMDURL, 1000 * 5);
metadataProvider.setParserPool(parser);
metadataProvider.setMetadataFilter(new EntityRoleFilter(retainedRoles));
metadataProvider.initialize();
EntitiesDescriptor descriptor = (EntitiesDescriptor) metadataProvider.getMetadata();
Marshaller marshaller = Configuration.getMarshallerFactory().getMarshaller(descriptor);
}
示例10: validate
import org.opensaml.saml2.metadata.AttributeAuthorityDescriptor; //导入依赖的package包/类
/** {@inheritDoc} */
public void validate(AttributeAuthorityDescriptor attributeAuthorityDescriptor) throws ValidationException {
super.validate(attributeAuthorityDescriptor);
validateAttributeServices(attributeAuthorityDescriptor);
}
示例11: buildObject
import org.opensaml.saml2.metadata.AttributeAuthorityDescriptor; //导入依赖的package包/类
/** {@inheritDoc} */
public AttributeAuthorityDescriptor buildObject() {
return buildObject(SAMLConstants.SAML20MD_NS, AttributeAuthorityDescriptor.DEFAULT_ELEMENT_LOCAL_NAME,
SAMLConstants.SAML20MD_PREFIX);
}
示例12: AttributeAuthorityDescriptorMarshaller
import org.opensaml.saml2.metadata.AttributeAuthorityDescriptor; //导入依赖的package包/类
/**
* Constructor
*/
public AttributeAuthorityDescriptorMarshaller() {
super(SAMLConstants.SAML20MD_NS, AttributeAuthorityDescriptor.DEFAULT_ELEMENT_LOCAL_NAME);
}
示例13: AttributeAuthorityDescriptorUnmarshaller
import org.opensaml.saml2.metadata.AttributeAuthorityDescriptor; //导入依赖的package包/类
/**
* Constructor
*/
public AttributeAuthorityDescriptorUnmarshaller() {
super(SAMLConstants.SAML20MD_NS, AttributeAuthorityDescriptor.DEFAULT_ELEMENT_LOCAL_NAME);
}
示例14: AttributeAuthorityDescriptorSchemaTest
import org.opensaml.saml2.metadata.AttributeAuthorityDescriptor; //导入依赖的package包/类
/** Constructor */
public AttributeAuthorityDescriptorSchemaTest() {
targetQName = new QName(SAMLConstants.SAML20MD_NS, AttributeAuthorityDescriptor.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
validator = new AttributeAuthorityDescriptorSchemaValidator();
}
示例15: AttributeAuthorityDescriptorSpecTest
import org.opensaml.saml2.metadata.AttributeAuthorityDescriptor; //导入依赖的package包/类
/** Constructor */
public AttributeAuthorityDescriptorSpecTest() {
targetQName = new QName(SAMLConstants.SAML20MD_NS, AttributeAuthorityDescriptor.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
validator = new AttributeAuthorityDescriptorSpecValidator();
}