本文整理匯總了Java中org.jasig.services.persondir.support.merger.NoncollidingAttributeAdder類的典型用法代碼示例。如果您正苦於以下問題:Java NoncollidingAttributeAdder類的具體用法?Java NoncollidingAttributeAdder怎麽用?Java NoncollidingAttributeAdder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
NoncollidingAttributeAdder類屬於org.jasig.services.persondir.support.merger包,在下文中一共展示了NoncollidingAttributeAdder類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getAttributeMerger
import org.jasig.services.persondir.support.merger.NoncollidingAttributeAdder; //導入依賴的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.NoncollidingAttributeAdder; //導入依賴的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: verifyMergingStrategyWithNoncollidingAttributeAdder
import org.jasig.services.persondir.support.merger.NoncollidingAttributeAdder; //導入依賴的package包/類
@Test
public void verifyMergingStrategyWithNoncollidingAttributeAdder() throws Exception {
final CachingPrincipalAttributesRepository repository = new CachingPrincipalAttributesRepository(this.dao,
TimeUnit.SECONDS, 5);
repository.setMergingStrategy(new NoncollidingAttributeAdder());
assertTrue(repository.getAttributes(this.principal).containsKey("mail"));
assertEquals(repository.getAttributes(this.principal).get("mail").toString(), "[email protected]");
((Closeable) repository).close();
}
開發者ID:hsj-xiaokang,項目名稱:springboot-shiro-cas-mybatis,代碼行數:11,代碼來源:CachingPrincipalAttributesRepositoryTests.java
示例4: getRegisteredService
import org.jasig.services.persondir.support.merger.NoncollidingAttributeAdder; //導入依賴的package包/類
public static AbstractRegisteredService getRegisteredService(final String id) {
try {
final RegexRegisteredService s = new RegexRegisteredService();
s.setServiceId(id);
s.setEvaluationOrder(1);
s.setName("Test registered service");
s.setDescription("Registered service description");
s.setProxyPolicy(new RegexMatchingRegisteredServiceProxyPolicy("^https?://.+"));
s.setId(new SecureRandom().nextInt(Math.abs(s.hashCode())));
s.setTheme("exampleTheme");
s.setUsernameAttributeProvider(new PrincipalAttributeRegisteredServiceUsernameProvider("uid"));
final DefaultRegisteredServiceAccessStrategy accessStrategy =
new DefaultRegisteredServiceAccessStrategy(true, true);
accessStrategy.setRequireAllAttributes(true);
accessStrategy.setRequiredAttributes(getTestAttributes());
s.setAccessStrategy(accessStrategy);
s.setLogo(new URL("https://logo.example.org/logo.png"));
s.setLogoutType(LogoutType.BACK_CHANNEL);
s.setLogoutUrl(new URL("https://sys.example.org/logout.png"));
s.setProxyPolicy(new RegexMatchingRegisteredServiceProxyPolicy("^http.+"));
s.setPublicKey(new RegisteredServicePublicKeyImpl("classpath:pub.key", "RSA"));
final ReturnAllowedAttributeReleasePolicy policy = new ReturnAllowedAttributeReleasePolicy();
policy.setAuthorizedToReleaseCredentialPassword(true);
policy.setAuthorizedToReleaseProxyGrantingTicket(true);
final CachingPrincipalAttributesRepository repo =
new CachingPrincipalAttributesRepository(new StubPersonAttributeDao(), 10);
repo.setMergingStrategy(new NoncollidingAttributeAdder());
policy.setPrincipalAttributesRepository(repo);
policy.setAttributeFilter(new RegisteredServiceRegexAttributeFilter("https://.+"));
policy.setAllowedAttributes(new ArrayList(getTestAttributes().keySet()));
s.setAttributeReleasePolicy(policy);
return s;
} catch (final Exception e) {
throw new RuntimeException(e);
}
}