public LdapSecurityRealmBuilder build() { assertNotBuilt(); built = true; if (filterName == null) filterName = String.format("(%s={0})", nameAttribute); return LdapSecurityRealmBuilder.this.setIdentityMapping(new IdentityMapping( searchDn, searchRecursive, searchTimeLimit, nameAttribute, attributes, newIdentityParent, newIdentityAttributes, filterName, iteratorFilter)); }
identityMappingBuilder.setRdnIdentifier(nameAttributeNode.asString()); identityMappingBuilder.setSearchDn(searchDnNode.asString()); identityMappingBuilder.searchRecursive(); identityMappingBuilder.map(b.build()); identityMappingBuilder.setFilterName(filterNameNode.asString()); identityMappingBuilder.setIteratorFilter(iteratorFilterNode.asString()); if (newIdentityParentDnNode.isDefined()) { try { identityMappingBuilder.setNewIdentityParent(new LdapName(newIdentityParentDnNode.asString())); } catch (InvalidNameException e) { throw new OperationFailedException(e); identityMappingBuilder.setNewIdentityAttributes(attributes); identityMappingBuilder.build();
/** * <p>Set the name of the context to be used when executing queries. * * <p>This option is specially useful when authenticating users based on names that don't use a X.500 format such as <em>plainUser</em>. * In this case, you must also provide {@link #setRdnIdentifier(String)} with the attribute name that contains the user name.</p> * * <p>If the names used to authenticate users are based on the X.500 format, this configuration can be suppressed. * * <p>Please note that by using this option the realm is able to authenticate users based on their simple or X.500 names. * * @param searchDn the name of the context to search * @return this builder */ public IdentityMappingBuilder setSearchDn(final String searchDn) { assertNotBuilt(); this.searchDn = searchDn; return this; }
/** * <p>Set the name of the context to be used when executing queries. * * <p>This option is specially useful when authenticating users based on names that don't use a X.500 format such as <em>plainUser</em>. * In this case, you must also provide {@link #setRdnIdentifier(String)} with the attribute name that contains the user name.</p> * * <p>If the names used to authenticate users are based on the X.500 format, this configuration can be suppressed. * * <p>Please note that by using this option the realm is able to authenticate users based on their simple or X.500 names. * * @param searchDn the name of the context to search * @return this builder */ public IdentityMappingBuilder setSearchDn(final String searchDn) { assertNotBuilt(); this.searchDn = searchDn; return this; }
/** * <p>Set the name of the context to be used when executing queries. * * <p>This option is specially useful when authenticating users based on names that don't use a X.500 format such as <em>plainUser</em>. * In this case, you must also provide {@link #setRdnIdentifier(String)} with the attribute name that contains the user name.</p> * * <p>If the names used to authenticate users are based on the X.500 format, this configuration can be suppressed. * * <p>Please note that by using this option the realm is able to authenticate users based on their simple or X.500 names. * * @param searchDn the name of the context to search * @return this builder */ public IdentityMappingBuilder setSearchDn(final String searchDn) { assertNotBuilt(); this.searchDn = searchDn; return this; }
public IdentityMappingBuilder identityMapping() { assertNotBuilt(); return new IdentityMappingBuilder(); }
public IdentityMappingBuilder identityMapping() { assertNotBuilt(); return new IdentityMappingBuilder(); }
public IdentityMappingBuilder identityMapping() { assertNotBuilt(); return new IdentityMappingBuilder(); }
public LdapSecurityRealmBuilder build() { assertNotBuilt(); built = true; if (filterName == null) filterName = String.format("(%s={0})", nameAttribute); return LdapSecurityRealmBuilder.this.setIdentityMapping(new IdentityMapping( searchDn, searchRecursive, searchTimeLimit, nameAttribute, attributes, newIdentityParent, newIdentityAttributes, filterName, iteratorFilter)); }
/** * Sets the time limit of LDAP search in milliseconds. * * @param limit the limit in milliseconds. Defaults to {@value #DEFAULT_SEARCH_TIME_LIMIT} milliseconds. * @return this builder */ public IdentityMappingBuilder setSearchTimeLimit(int limit) { assertNotBuilt(); this.searchTimeLimit = limit; return this; }
/** * Define an attribute mapping configuration. * * @param attributes one or more {@link AttributeMapping} configuration * @return this builder */ public IdentityMappingBuilder map(AttributeMapping... attributes) { assertNotBuilt(); this.attributes.addAll(Arrays.asList(attributes)); return this; }
public IdentityMappingBuilder setNewIdentityAttributes(Attributes newIdentityAttributes) { assertNotBuilt(); this.newIdentityAttributes = newIdentityAttributes; return this; }
public IdentityMappingBuilder setNewIdentityParent(LdapName newIdentityParent) { assertNotBuilt(); this.newIdentityParent = newIdentityParent; return this; }
public IdentityMappingBuilder setFilterName(String filterName) { assertNotBuilt(); this.filterName = filterName; return this; }
/** * Indicate if queries are searchRecursive, searching the entire subtree rooted at the name specified in {@link #setSearchDn(String)}. * Otherwise search one level of the named context. * * @return this builder */ public IdentityMappingBuilder searchRecursive() { assertNotBuilt(); this.searchRecursive = true; return this; }
public IdentityMappingBuilder setIteratorFilter(String iteratorFilter) { assertNotBuilt(); this.iteratorFilter = iteratorFilter; return this; }
/** * Indicate if queries are searchRecursive, searching the entire subtree rooted at the name specified in {@link #setSearchDn(String)}. * Otherwise search one level of the named context. * * @return this builder */ public IdentityMappingBuilder searchRecursive() { assertNotBuilt(); this.searchRecursive = true; return this; }
/** * Set the name of the attribute in LDAP that holds the user name and will appear in path of new entries. * * @param nameAttribute the name attribute * @return this builder */ public IdentityMappingBuilder setRdnIdentifier(final String nameAttribute) { assertNotBuilt(); this.nameAttribute = nameAttribute; return this; }
public IdentityMappingBuilder setNewIdentityParent(LdapName newIdentityParent) { assertNotBuilt(); this.newIdentityParent = newIdentityParent; return this; }
public LdapSecurityRealmBuilder build() { assertNotBuilt(); built = true; if (filterName == null) filterName = String.format("(%s={0})", nameAttribute); return LdapSecurityRealmBuilder.this.setIdentityMapping(new IdentityMapping( searchDn, searchRecursive, searchTimeLimit, nameAttribute, attributes, newIdentityParent, newIdentityAttributes, filterName, iteratorFilter)); }