/** * Adds the provided attribute to this entry, replacing any existing set of * values for the associated attribute. * * @param attributeName The name to use for the attribute. It must not be * {@code null}. * @param attributeValues The set of values to use for the attribute. It * must not be {@code null}. */ public void setAttribute(final String attributeName, final Collection<String> attributeValues) { ensureNotNull(attributeName, attributeValues); setAttribute(new Attribute(attributeName, schema, attributeValues)); }
/** * Adds the provided attribute to this entry, replacing any existing set of * values for the associated attribute. * * @param attributeName The name to use for the attribute. It must not be * {@code null}. * @param attributeValue The value to use for the attribute. It must not be * {@code null}. */ public void setAttribute(final String attributeName, final byte[] attributeValue) { ensureNotNull(attributeName, attributeValue); setAttribute(new Attribute(attributeName, schema, attributeValue)); }
/** * Adds the provided attribute to this entry, replacing any existing set of * values for the associated attribute. * * @param attributeName The name to use for the attribute. It must not be * {@code null}. * @param attributeValue The value to use for the attribute. It must not be * {@code null}. */ public void setAttribute(final String attributeName, final String attributeValue) { ensureNotNull(attributeName, attributeValue); setAttribute(new Attribute(attributeName, schema, attributeValue)); }
/** * Adds the provided attribute to this entry, replacing any existing set of * values for the associated attribute. * * @param attributeName The name to use for the attribute. It must not be * {@code null}. * @param attributeValue The value to use for the attribute. It must not be * {@code null}. */ public void setAttribute(final String attributeName, final byte[] attributeValue) { ensureNotNull(attributeName, attributeValue); setAttribute(new Attribute(attributeName, schema, attributeValue)); }
/** * Adds the provided attribute to this entry, replacing any existing set of * values for the associated attribute. * * @param attributeName The name to use for the attribute. It must not be * {@code null}. * @param attributeValues The set of values to use for the attribute. It * must not be {@code null}. */ public void setAttribute(final String attributeName, final String... attributeValues) { ensureNotNull(attributeName, attributeValues); setAttribute(new Attribute(attributeName, schema, attributeValues)); }
/** * Adds the provided attribute to this entry, replacing any existing set of * values for the associated attribute. * * @param attributeName The name to use for the attribute. It must not be * {@code null}. * @param attributeValue The value to use for the attribute. It must not be * {@code null}. */ public void setAttribute(final String attributeName, final String attributeValue) { ensureNotNull(attributeName, attributeValue); setAttribute(new Attribute(attributeName, schema, attributeValue)); }
/** * Adds the provided attribute to this entry, replacing any existing set of * values for the associated attribute. * * @param attributeName The name to use for the attribute. It must not be * {@code null}. * @param attributeValues The set of values to use for the attribute. It * must not be {@code null}. */ public void setAttribute(final String attributeName, final byte[]... attributeValues) { ensureNotNull(attributeName, attributeValues); setAttribute(new Attribute(attributeName, schema, attributeValues)); }
/** * Adds the provided attribute to this entry, replacing any existing set of * values for the associated attribute. * * @param attributeName The name to use for the attribute. It must not be * {@code null}. * @param attributeValues The set of values to use for the attribute. It * must not be {@code null}. */ public void setAttribute(final String attributeName, final String... attributeValues) { ensureNotNull(attributeName, attributeValues); setAttribute(new Attribute(attributeName, schema, attributeValues)); }
/** * Adds the provided attribute to this entry, replacing any existing set of * values for the associated attribute. * * @param attributeName The name to use for the attribute. It must not be * {@code null}. * @param attributeValues The set of values to use for the attribute. It * must not be {@code null}. */ public void setAttribute(final String attributeName, final byte[]... attributeValues) { ensureNotNull(attributeName, attributeValues); setAttribute(new Attribute(attributeName, schema, attributeValues)); }
/** * Adds the provided attribute to this entry, replacing any existing set of * values for the associated attribute. * * @param attributeName The name to use for the attribute. It must not be * {@code null}. * @param attributeValues The set of values to use for the attribute. It * must not be {@code null}. */ public void setAttribute(final String attributeName, final Collection<String> attributeValues) { ensureNotNull(attributeName, attributeValues); setAttribute(new Attribute(attributeName, schema, attributeValues)); }
@Override public LdapGroup createOrUpdateGroup(LdapGroup group) throws LdapSystemException { try (LDAPConnection conn = ldapPool.getConnection()) { LdapGroup current = getGroup(group.getName(), conn); if (current != null) { Modification[] mods = new Modification[]{ new Modification(REPLACE, GROUP_DESC_ATTR, group.getDescription()), new Modification(REPLACE, config.getLdapGroupsMemberAttr(), group.getMembersDn().toArray(new String[0])) }; conn.modify(current.getDn(), mods); current.setDescription(group.getDescription()); current.setMembersDn(group.getMembersDn()); } else { String dn = getGroupDN(group.getName()); Entry entry = new Entry(dn); entry.setAttribute(GROUP_NAME_ATTR, group.getName()); entry.setAttribute(GROUP_DESC_ATTR, group.getDescription()); entry.setAttribute(config.getLdapGroupsMemberAttr(), group.getMembersDn()); entry.setAttribute("objectClass", config.getLdapGroupsObjectClass()); conn.add(entry); current = new LdapGroup(dn, group.getName(), group.getDescription(), group.getMembersDn()); } return current; } catch (LDAPException e) { throw new LdapSystemException(e); } }
e.setAttribute("entryDN", StaticUtils.toLowerCase(e.getDN()));
e.setAttribute(m.getAttribute()); e.setAttribute(name, newValue.toString()); break;
e.setAttribute(m.getAttribute()); e.setAttribute(name, newValue.toString()); break;
modifiedEntry.setAttribute(new Attribute("modifiersName", DistinguishedNameMatchingRule.getInstance(), authzDN.toString())); modifiedEntry.setAttribute(new Attribute("modifyTimestamp", GeneralizedTimeMatchingRule.getInstance(), StaticUtils.encodeGeneralizedTime(new Date())));
entry.setAttribute("objectClass", newObjectClasses);
updatedEntry.setAttribute(new Attribute("modifiersName", DistinguishedNameMatchingRule.getInstance(), authzDN.toString())); updatedEntry.setAttribute(new Attribute("modifyTimestamp", GeneralizedTimeMatchingRule.getInstance(), StaticUtils.encodeGeneralizedTime(new Date()))); updatedEntry.setAttribute(new Attribute("entryDN", DistinguishedNameMatchingRule.getInstance(), newDN.toNormalizedString())); if (generateOperationalAttributes) e.setAttribute(new Attribute("entryDN", DistinguishedNameMatchingRule.getInstance(), newMapEntryDN.toNormalizedString()));