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


Java RegisteredService.isIgnoreAttributes方法代码示例

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


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

示例1: filter

import org.jasig.cas.services.RegisteredService; //导入方法依赖的package包/类
@Override
public Map<String, Object> filter(final String principalId, final Map<String, Object> givenAttributes,
        final RegisteredService registeredService) {
    final Map<String, Object> attributes = new HashMap<String, Object>();

    if (registeredService.isIgnoreAttributes()) {
        logger.debug("Service [{}] is set to ignore attribute release policy. Releasing all attributes.",
                registeredService.getName());
        attributes.putAll(givenAttributes);
    } else {
        for (final String attribute : registeredService.getAllowedAttributes()) {
            final Object value = givenAttributes.get(attribute);

            if (value != null) {
                logger.debug("Found attribute [{}] in the list of allowed attributes for service [{}]", attribute,
                        registeredService.getName());
                attributes.put(attribute, value);
            }
        }
    }
    return Collections.unmodifiableMap(attributes);
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:23,代码来源:RegisteredServiceDefaultAttributeFilter.java

示例2: validate

import org.jasig.cas.services.RegisteredService; //导入方法依赖的package包/类
@Override
public void validate(final Object o, final Errors errors) {
    final RegisteredService r = (RegisteredService) o;

    if (r.getServiceId() != null) {
        for (final RegisteredService service : this.servicesManager.getAllServices()) {
            if (r.getServiceId().equals(service.getServiceId())
                    && r.getId() != service.getId()) {
                errors.rejectValue("serviceId",
                        "registeredService.serviceId.exists", null);
                break;
            }
        }
    }

    if (r.getDescription() != null
            && r.getDescription().length() > this.maxDescriptionLength) {
        errors.rejectValue("description",
                "registeredService.description.length", null);
    }

    if (!StringUtils.isBlank(r.getUsernameAttribute()) && !r.isAnonymousAccess()) {
        if (!r.isIgnoreAttributes() && !r.getAllowedAttributes().contains(r.getUsernameAttribute())) {
            errors.rejectValue("usernameAttribute", "registeredService.usernameAttribute.notAvailable",
                    "This attribute is not available for this service.");
        } else {
            Set<String> availableAttributes = this.personAttributeDao.getPossibleUserAttributeNames();
            if (availableAttributes != null) {
                if (!availableAttributes.contains(r.getUsernameAttribute())) {
                    errors.rejectValue("usernameAttribute", "registeredService.usernameAttribute.notAvailable",
                            "This attribute is not available from configured user attribute sources.");
                }
            }
        }
    }
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:37,代码来源:RegisteredServiceValidator.java


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