• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java AttributeConsumingService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: selectService

import org.opensaml.saml2.metadata.AttributeConsumingService; //导入依赖的package包/类
/**
 * Select the AttributeConsumingService.
 * 
 * @return the selected AttributeConsumingService, or null
 */
public AttributeConsumingService selectService() {
    List<AttributeConsumingService> candidates = getCandidates();

    if (candidates == null || candidates.isEmpty()) {
        log.debug("AttributeConsumingService candidate list was empty, can not select service");
        return null;
    }

    log.debug("AttributeConsumingService index was specified: {}", index != null);

    AttributeConsumingService acs = null;
    if (index != null) {
        acs = selectByIndex(candidates);
        if (acs == null && isOnBadIndexUseDefault()) {
            acs = selectDefault(candidates);
        }
    } else {
        return selectDefault(candidates);
    }

    return acs;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:28,代码来源:AttributeConsumingServiceSelector.java


示例2: selectByIndex

import org.opensaml.saml2.metadata.AttributeConsumingService; //导入依赖的package包/类
/**
 * Select the service based on the index value.
 * 
 * @param candidates the list of candiate services
 * @return the selected candidate or null
 */
private AttributeConsumingService selectByIndex(List<AttributeConsumingService> candidates) {
    log.debug("Selecting AttributeConsumingService by index");
    for (AttributeConsumingService attribCS : candidates) {
        // Check for null b/c don't ever want to fail with an NPE due to autoboxing.
        // Note: metadata index property is an int, not an Integer.
        if (index != null) {
            if (index == attribCS.getIndex()) {
                log.debug("Selected AttributeConsumingService with index: {}", index);
                return attribCS;
            }
        }
    }
    log.debug("A service index of '{}' was specified, but was not found in metadata", index);
    return null;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:AttributeConsumingServiceSelector.java


示例3: selectDefault

import org.opensaml.saml2.metadata.AttributeConsumingService; //导入依赖的package包/类
/**
 * Select the default service.
 * 
 * @param candidates the list of candiate services
 * @return the selected candidate or null
 */
private AttributeConsumingService selectDefault(List<AttributeConsumingService> candidates) {
    log.debug("Selecting default AttributeConsumingService");
    AttributeConsumingService firstNoDefault = null;
    for (AttributeConsumingService attribCS : candidates) {
        if (attribCS.isDefault()) {
            log.debug("Selected AttributeConsumingService with explicit isDefault of true");
            return attribCS;
        }

        // This records the first element whose isDefault is not explicitly false
        if (firstNoDefault == null && attribCS.isDefaultXSBoolean() == null) {
            firstNoDefault = attribCS;
        }
    }

    if (firstNoDefault != null) {
        log.debug("Selected first AttributeConsumingService with no explicit isDefault");
        return firstNoDefault;
    } else {
        log.debug("Selected first AttributeConsumingService with explicit isDefault of false");
        return candidates.get(0);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:30,代码来源:AttributeConsumingServiceSelector.java


示例4: 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


示例5: testXSBooleanAttributes

import org.opensaml.saml2.metadata.AttributeConsumingService; //导入依赖的package包/类
/**
 * Test the proper behavior of the XSBooleanValue attributes.
 */
public void testXSBooleanAttributes() {
    AttributeConsumingService acs = 
        (AttributeConsumingService) buildXMLObject(AttributeConsumingService.DEFAULT_ELEMENT_NAME);
    
    // isDefault attribute
    acs.setIsDefault(Boolean.TRUE);
    assertEquals("Unexpected value for boolean attribute found", Boolean.TRUE, acs.isDefault());
    assertNotNull("XSBooleanValue was null", acs.isDefaultXSBoolean());
    assertEquals("XSBooleanValue was unexpected value", new XSBooleanValue(Boolean.TRUE, false),
            acs.isDefaultXSBoolean());
    assertEquals("XSBooleanValue string was unexpected value", "true", acs.isDefaultXSBoolean().toString());
    
    acs.setIsDefault(Boolean.FALSE);
    assertEquals("Unexpected value for boolean attribute found", Boolean.FALSE, acs.isDefault());
    assertNotNull("XSBooleanValue was null", acs.isDefaultXSBoolean());
    assertEquals("XSBooleanValue was unexpected value", new XSBooleanValue(Boolean.FALSE, false),
            acs.isDefaultXSBoolean());
    assertEquals("XSBooleanValue string was unexpected value", "false", acs.isDefaultXSBoolean().toString());
    
    acs.setIsDefault((Boolean) null);
    assertEquals("Unexpected default value for boolean attribute found", Boolean.FALSE, acs.isDefault());
    assertNull("XSBooleanValue was not null", acs.isDefaultXSBoolean());
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:27,代码来源:AttributeConsumingServiceTest.java


示例6: processChildElement

import org.opensaml.saml2.metadata.AttributeConsumingService; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {
    AttributeQueryDescriptorType descriptor = (AttributeQueryDescriptorType) parentSAMLObject;

    if (childSAMLObject instanceof AttributeConsumingService) {
        descriptor.getAttributeConsumingServices().add((AttributeConsumingService) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:AttributeQueryDescriptorTypeUnmarshaller.java


示例7: validateRequestedAttributes

import org.opensaml.saml2.metadata.AttributeConsumingService; //导入依赖的package包/类
/**
 * Checks that one or more Requested Attributes are present.
 * 
 * @param attributeConsumingService
 * @throws ValidationException
 */
protected void validateRequestedAttributes(AttributeConsumingService attributeConsumingService)
        throws ValidationException {
    if (attributeConsumingService.getRequestAttributes() == null
            || attributeConsumingService.getRequestAttributes().size() == 0) {
        throw new ValidationException("Must have one or more Requested Attributes.");
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:AttributeConsumingServiceSchemaValidator.java


示例8: processChildElement

import org.opensaml.saml2.metadata.AttributeConsumingService; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {
    AttributeConsumingService service = (AttributeConsumingService) parentSAMLObject;

    if (childSAMLObject instanceof ServiceName) {
        service.getNames().add((ServiceName) childSAMLObject);
    } else if (childSAMLObject instanceof ServiceDescription) {
        service.getDescriptions().add((ServiceDescription) childSAMLObject);
    } else if (childSAMLObject instanceof RequestedAttribute) {
        service.getRequestAttributes().add((RequestedAttribute) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:AttributeConsumingServiceUnmarshaller.java


示例9: 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


示例10: marshallAttributes

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

    domElement.setAttributeNS(null, AttributeConsumingService.INDEX_ATTRIB_NAME, Integer.toString(service
            .getIndex()));

    if (service.isDefaultXSBoolean() != null) {
        domElement.setAttributeNS(null, AttributeConsumingService.IS_DEFAULT_ATTRIB_NAME, service
                .isDefaultXSBoolean().toString());
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:AttributeConsumingServiceMarshaller.java


示例11: processChildElement

import org.opensaml.saml2.metadata.AttributeConsumingService; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
        throws UnmarshallingException {
    SPSSODescriptor descriptor = (SPSSODescriptor) parentSAMLObject;

    if (childSAMLObject instanceof AssertionConsumerService) {
        descriptor.getAssertionConsumerServices().add((AssertionConsumerService) childSAMLObject);
    } else if (childSAMLObject instanceof AttributeConsumingService) {
        descriptor.getAttributeConsumingServices().add((AttributeConsumingService) childSAMLObject);
    } else {
        super.processChildElement(parentSAMLObject, childSAMLObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:SPSSODescriptorUnmarshaller.java


示例12: 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


示例13: getDefaultAttributeConsumingService

import org.opensaml.saml2.metadata.AttributeConsumingService; //导入依赖的package包/类
/** {@inheritDoc} */
public AttributeConsumingService getDefaultAttributeConsumingService(){
    for(AttributeConsumingService service : attributeConsumingServices){
        if(service.isDefault()){
            return service;
        }
    }
    
    return null;
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:11,代码来源:SPSSODescriptorImpl.java


示例14: marshallAttributes

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

    domElement.setAttributeNS(null, AttributeConsumingService.INDEX_ATTRIB_NAME, Integer.toString(service
            .getIndex()));

    if (service.isDefaultXSBoolean() != null) {
        domElement.setAttributeNS(null, AttributeConsumingService.IS_DEFAULT_ATTRIB_NAME,
                service.isDefaultXSBoolean().toString());
    }
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:13,代码来源:AttributeConsumingServiceMarshaller.java


示例15: populateRequiredData

import org.opensaml.saml2.metadata.AttributeConsumingService; //导入依赖的package包/类
/** {@inheritDoc} */
protected void populateRequiredData() {
    super.populateRequiredData();
    SPSSODescriptor spssoDescriptor = (SPSSODescriptor) target;
    AttributeConsumingService attributeConsumingService = (AttributeConsumingService) buildXMLObject(new QName(SAMLConstants.SAML20MD_NS,
            AttributeConsumingService.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX));
    spssoDescriptor.getAttributeConsumingServices().add(attributeConsumingService);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:9,代码来源:SPSSODescriptorSchemaTest.java


示例16: 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


示例17: 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


示例18: testServiceNameFailure

import org.opensaml.saml2.metadata.AttributeConsumingService; //导入依赖的package包/类
/**
 * Tests for Service Name Failure
 * 
 * @throws ValidationException
 */
public void testServiceNameFailure() throws ValidationException {
    AttributeConsumingService attributeConsumingService = (AttributeConsumingService) target;

    attributeConsumingService.getNames().clear();
    assertValidationFail("Service Names list was empty, should raise a Validation Exception");
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:12,代码来源:AttributeConsumingServiceSchemaTest.java


示例19: testSingleElementOptionalAttributesUnmarshall

import org.opensaml.saml2.metadata.AttributeConsumingService; //导入依赖的package包/类
/** {@inheritDoc} */
public void testSingleElementOptionalAttributesUnmarshall() {
    AttributeConsumingService service = (AttributeConsumingService) unmarshallElement(singleElementOptionalAttributesFile);
    
    assertEquals("Index was not expected value", expectedIndex, service.getIndex());
    assertEquals("isDefault was not expected value", expectedIsDefault, service.isDefaultXSBoolean());
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:8,代码来源:AttributeConsumingServiceTest.java


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ContentType类代码示例发布时间:2022-05-15
下一篇:
Java SemiJoinRule类代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap