| | |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2012 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.forgerock.opendj.ldap; |
| | |
| | | |
| | | import java.util.Collection; |
| | | |
| | | import org.forgerock.i18n.LocalizedIllegalArgumentException; |
| | | |
| | | import com.forgerock.opendj.util.Iterables; |
| | | import com.forgerock.opendj.util.Predicate; |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean addAttribute(final Attribute attribute) |
| | | throws UnsupportedOperationException, NullPointerException |
| | | { |
| | | return addAttribute(attribute, null); |
| | | } |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | public Entry addAttribute(final String attributeDescription, |
| | | final Object... values) throws LocalizedIllegalArgumentException, |
| | | UnsupportedOperationException, NullPointerException |
| | | final Object... values) |
| | | { |
| | | addAttribute(new LinkedAttribute(attributeDescription, values), null); |
| | | return this; |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean containsAttribute(final Attribute attribute, |
| | | final Collection<ByteString> missingValues) throws NullPointerException |
| | | final Collection<ByteString> missingValues) |
| | | { |
| | | final Attribute a = getAttribute(attribute.getAttributeDescription()); |
| | | if (a == null) |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean containsAttribute(final String attributeDescription, |
| | | final Object... values) throws LocalizedIllegalArgumentException, |
| | | NullPointerException |
| | | final Object... values) |
| | | { |
| | | return containsAttribute(new LinkedAttribute(attributeDescription, values), |
| | | null); |
| | |
| | | */ |
| | | public Iterable<Attribute> getAllAttributes( |
| | | final AttributeDescription attributeDescription) |
| | | throws NullPointerException |
| | | { |
| | | Validator.ensureNotNull(attributeDescription); |
| | | |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | public Iterable<Attribute> getAllAttributes(final String attributeDescription) |
| | | throws LocalizedIllegalArgumentException, NullPointerException |
| | | { |
| | | return getAllAttributes(AttributeDescription.valueOf(attributeDescription)); |
| | | } |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | public Attribute getAttribute(final String attributeDescription) |
| | | throws LocalizedIllegalArgumentException, NullPointerException |
| | | { |
| | | return getAttribute(AttributeDescription.valueOf(attributeDescription)); |
| | | } |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean removeAttribute(final AttributeDescription attributeDescription) |
| | | throws UnsupportedOperationException, NullPointerException |
| | | { |
| | | return removeAttribute( |
| | | Attributes.emptyAttribute(attributeDescription), null); |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | public Entry removeAttribute(final String attributeDescription, |
| | | final Object... values) throws LocalizedIllegalArgumentException, |
| | | UnsupportedOperationException, NullPointerException |
| | | final Object... values) |
| | | { |
| | | removeAttribute(new LinkedAttribute(attributeDescription, values), null); |
| | | return this; |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean replaceAttribute(final Attribute attribute) |
| | | throws UnsupportedOperationException, NullPointerException |
| | | { |
| | | if (attribute.isEmpty()) |
| | | { |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | public Entry replaceAttribute(final String attributeDescription, |
| | | final Object... values) throws LocalizedIllegalArgumentException, |
| | | UnsupportedOperationException, NullPointerException |
| | | final Object... values) |
| | | { |
| | | replaceAttribute(new LinkedAttribute(attributeDescription, values)); |
| | | return this; |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | public Entry setName(final String dn) |
| | | throws LocalizedIllegalArgumentException, UnsupportedOperationException, |
| | | NullPointerException |
| | | { |
| | | return setName(DN.valueOf(dn)); |
| | | } |