當前位置: 首頁>>代碼示例>>Java>>正文


Java MultivaluedAttributeMerger類代碼示例

本文整理匯總了Java中org.jasig.services.persondir.support.merger.MultivaluedAttributeMerger的典型用法代碼示例。如果您正苦於以下問題:Java MultivaluedAttributeMerger類的具體用法?Java MultivaluedAttributeMerger怎麽用?Java MultivaluedAttributeMerger使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MultivaluedAttributeMerger類屬於org.jasig.services.persondir.support.merger包,在下文中一共展示了MultivaluedAttributeMerger類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getAttributeMerger

import org.jasig.services.persondir.support.merger.MultivaluedAttributeMerger; //導入依賴的package包/類
/**
 * Get attribute merger.
 * @return the attribute merger
 */
public IAttributeMerger getAttributeMerger() {
    final String name = this.name().toUpperCase();

    switch (name.toUpperCase()) {
        case "REPLACE":
            return new ReplacingAttributeAdder();
        case "ADD":
            return new NoncollidingAttributeAdder();
        case "MULTIVALUED":
            return new MultivaluedAttributeMerger();
        default:
            return null;
    }
}
 
開發者ID:hsj-xiaokang,項目名稱:springboot-shiro-cas-mybatis,代碼行數:19,代碼來源:AbstractPrincipalAttributesRepository.java

示例2: mapPrincipalRepository

import org.jasig.services.persondir.support.merger.MultivaluedAttributeMerger; //導入依賴的package包/類
@Override
public void mapPrincipalRepository(final PrincipalAttributesRepository pr, final ServiceData bean) {
    final RegisteredServiceAttributeReleasePolicyEditBean attrPolicyBean = bean.getAttrRelease();
    if (pr instanceof DefaultPrincipalAttributesRepository) {
        attrPolicyBean.setAttrOption(RegisteredServiceAttributeReleasePolicyEditBean.Types.DEFAULT.toString());
    } else if (pr instanceof AbstractPrincipalAttributesRepository) {
        attrPolicyBean.setAttrOption(RegisteredServiceAttributeReleasePolicyEditBean.Types.CACHED.toString());

        final AbstractPrincipalAttributesRepository cc = (AbstractPrincipalAttributesRepository) pr;

        attrPolicyBean.setCachedExpiration(cc.getExpiration());
        attrPolicyBean.setCachedTimeUnit(cc.getTimeUnit().name());

        final IAttributeMerger merger = cc.getMergingStrategy().getAttributeMerger();

        if (merger != null) {
            if (merger instanceof NoncollidingAttributeAdder) {
                attrPolicyBean.setMergingStrategy(RegisteredServiceAttributeReleasePolicyEditBean
                        .AttributeMergerTypes.ADD.toString());
            } else if (merger instanceof MultivaluedAttributeMerger) {
                attrPolicyBean.setMergingStrategy(RegisteredServiceAttributeReleasePolicyEditBean
                        .AttributeMergerTypes.MULTIVALUED.toString());
            } else if (merger instanceof ReplacingAttributeAdder) {
                attrPolicyBean.setMergingStrategy(RegisteredServiceAttributeReleasePolicyEditBean
                        .AttributeMergerTypes.REPLACE.toString());
            }
        }
    }
}
 
開發者ID:hsj-xiaokang,項目名稱:springboot-shiro-cas-mybatis,代碼行數:30,代碼來源:DefaultPrincipalAttributesRepositoryMapper.java

示例3: verifyMergingStrategyWithMultivaluedAttributeMerger

import org.jasig.services.persondir.support.merger.MultivaluedAttributeMerger; //導入依賴的package包/類
@Test
public void verifyMergingStrategyWithMultivaluedAttributeMerger() throws Exception {
    final CachingPrincipalAttributesRepository repository = new CachingPrincipalAttributesRepository(this.dao,
            TimeUnit.SECONDS, 5);
    repository.setMergingStrategy(new MultivaluedAttributeMerger());

    assertTrue(repository.getAttributes(this.principal).get("mail") instanceof List);

    final List<?> values = (List) repository.getAttributes(this.principal).get("mail");
    assertTrue(values.contains("[email protected]"));
    assertTrue(values.contains("[email protected]"));
    ((Closeable) repository).close();
}
 
開發者ID:hsj-xiaokang,項目名稱:springboot-shiro-cas-mybatis,代碼行數:14,代碼來源:CachingPrincipalAttributesRepositoryTests.java


注:本文中的org.jasig.services.persondir.support.merger.MultivaluedAttributeMerger類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。