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


Java AttributeConsumingService.setIndex方法代码示例

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


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

示例1: testChildElementsMarshall

import org.opensaml.saml2.metadata.AttributeConsumingService; //导入方法依赖的package包/类
public void testChildElementsMarshall()
{
    QName qname = new QName(SAMLConstants.SAML20MD_NS, AttributeConsumingService.DEFAULT_ELEMENT_LOCAL_NAME);
    AttributeConsumingService service = (AttributeConsumingService) buildXMLObject(qname);
    
    service.setIndex(expectedIndex);
    
    QName serviceNameQName = new QName(SAMLConstants.SAML20MD_NS, ServiceName.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    for (int i = 0; i < expectedServiceNameCount; i++) {
        service.getNames().add((ServiceName) buildXMLObject(serviceNameQName));
    }

    QName serviceDescQName = new QName(SAMLConstants.SAML20MD_NS, ServiceDescription.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX);
    for (int i = 0; i < expectedServiceDecsriptionCount; i++) {
        service.getDescriptions().add((ServiceDescription) buildXMLObject(serviceDescQName));
    }

    service.getRequestAttributes().add((RequestedAttribute) buildXMLObject(RequestedAttribute.DEFAULT_ELEMENT_NAME));

    assertEquals(expectedChildElementsDOM, service);

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

示例2: processAttribute

import org.opensaml.saml2.metadata.AttributeConsumingService; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
    AttributeConsumingService service = (AttributeConsumingService) samlObject;

    if (attribute.getLocalName().equals(AttributeConsumingService.INDEX_ATTRIB_NAME)) {
        service.setIndex(Integer.valueOf(attribute.getValue()));
    } else if (attribute.getLocalName().equals(AttributeConsumingService.IS_DEFAULT_ATTRIB_NAME)) {
        service.setIsDefault(XSBooleanValue.valueOf(attribute.getValue()));
    } else {
        super.processAttribute(samlObject, attribute);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:AttributeConsumingServiceUnmarshaller.java

示例3: createAttributeConsumingService

import org.opensaml.saml2.metadata.AttributeConsumingService; //导入方法依赖的package包/类
public static AttributeConsumingService createAttributeConsumingService(String serviceName) {
	AttributeConsumingService service = SAMLUtil.buildXMLObject(AttributeConsumingService.class);
	ServiceName name = SAMLUtil.buildXMLObject(ServiceName.class);
	name.setName(new LocalizedString(serviceName, "en"));
	service.getNames().add(name);
	
	service.setIndex(0);
	service.setIsDefault(true);

	return service;
}
 
开发者ID:amagdenko,项目名称:oiosaml.java,代码行数:12,代码来源:SAMLUtil.java

示例4: populateRequiredData

import org.opensaml.saml2.metadata.AttributeConsumingService; //导入方法依赖的package包/类
/** {@inheritDoc} */
protected void populateRequiredData() {
    super.populateRequiredData();
    AttributeConsumingService attributeConsumingService = (AttributeConsumingService) target;
    ServiceName name = (ServiceName) buildXMLObject(new QName(SAMLConstants.SAML20MD_NS, ServiceName.DEFAULT_ELEMENT_LOCAL_NAME,
            SAMLConstants.SAML20MD_PREFIX));
    RequestedAttribute attribute = (RequestedAttribute) buildXMLObject(new QName(SAMLConstants.SAML20MD_NS,
            RequestedAttribute.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX));
    attributeConsumingService.setIndex(5);
    attributeConsumingService.getNames().add(name);
    attributeConsumingService.getRequestAttributes().add(attribute);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:13,代码来源:AttributeConsumingServiceSchemaTest.java

示例5: testIndexFailure

import org.opensaml.saml2.metadata.AttributeConsumingService; //导入方法依赖的package包/类
/**
 * Tests for Index failure.
 * 
 * @throws ValidationException
 */
public void testIndexFailure() throws ValidationException {
    AttributeConsumingService attributeConsumingService = (AttributeConsumingService) target;

    attributeConsumingService.setIndex(-3);
    assertValidationFail("Index was negative, should raise a Validation Exception.");
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:12,代码来源:AttributeConsumingServiceSchemaTest.java

示例6: testSingleElementMarshall

import org.opensaml.saml2.metadata.AttributeConsumingService; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void testSingleElementMarshall() {
    QName qname = new QName(SAMLConstants.SAML20MD_NS, AttributeConsumingService.DEFAULT_ELEMENT_LOCAL_NAME);
    AttributeConsumingService service = (AttributeConsumingService) buildXMLObject(qname);
    
    service.setIndex(expectedIndex);

    assertEquals(expectedDOM, service);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:10,代码来源:AttributeConsumingServiceTest.java

示例7: testSingleElementOptionalAttributesMarshall

import org.opensaml.saml2.metadata.AttributeConsumingService; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void testSingleElementOptionalAttributesMarshall() {
    QName qname = new QName(SAMLConstants.SAML20MD_NS, AttributeConsumingService.DEFAULT_ELEMENT_LOCAL_NAME);
    AttributeConsumingService service = (AttributeConsumingService) buildXMLObject(qname);
    
    service.setIndex(expectedIndex);
    service.setIsDefault(expectedIsDefault);

    assertEquals(expectedOptionalAttributesDOM, service);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:11,代码来源:AttributeConsumingServiceTest.java


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