001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *
024 *      Copyright 2009 Sun Microsystems, Inc.
025 *      Portions copyright 2012 ForgeRock AS.
026 */
027
028package org.forgerock.opendj.ldap.responses;
029
030import java.util.Collection;
031import java.util.List;
032
033import org.forgerock.opendj.ldap.Attribute;
034import org.forgerock.opendj.ldap.AttributeDescription;
035import org.forgerock.opendj.ldap.ByteString;
036import org.forgerock.opendj.ldap.DN;
037import org.forgerock.opendj.ldap.DecodeException;
038import org.forgerock.opendj.ldap.DecodeOptions;
039import org.forgerock.opendj.ldap.Entry;
040import org.forgerock.opendj.ldap.controls.Control;
041import org.forgerock.opendj.ldap.controls.ControlDecoder;
042
043/**
044 * A Search Result Entry represents an entry found during a Search operation.
045 * <p>
046 * Each entry returned in a Search Result Entry will contain all appropriate
047 * attributes as specified in the Search request, subject to access control and
048 * other administrative policy.
049 * <p>
050 * Note that a Search Result Entry may hold zero attributes. This may happen
051 * when none of the attributes of an entry were requested or could be returned.
052 * <p>
053 * Note also that each returned attribute may hold zero attribute values. This
054 * may happen when only attribute types are requested, access controls prevent
055 * the return of values, or other reasons.
056 */
057public interface SearchResultEntry extends Response, Entry {
058
059    @Override
060    boolean addAttribute(Attribute attribute);
061
062    @Override
063    boolean addAttribute(Attribute attribute, Collection<? super ByteString> duplicateValues);
064
065    @Override
066    SearchResultEntry addAttribute(String attributeDescription, Object... values);
067
068    @Override
069    SearchResultEntry addControl(Control control);
070
071    @Override
072    SearchResultEntry clearAttributes();
073
074    @Override
075    boolean containsAttribute(Attribute attribute, Collection<? super ByteString> missingValues);
076
077    @Override
078    boolean containsAttribute(String attributeDescription, Object... values);
079
080    @Override
081    Iterable<Attribute> getAllAttributes();
082
083    @Override
084    Iterable<Attribute> getAllAttributes(AttributeDescription attributeDescription);
085
086    @Override
087    Iterable<Attribute> getAllAttributes(String attributeDescription);
088
089    @Override
090    Attribute getAttribute(AttributeDescription attributeDescription);
091
092    @Override
093    Attribute getAttribute(String attributeDescription);
094
095    @Override
096    int getAttributeCount();
097
098    @Override
099    <C extends Control> C getControl(ControlDecoder<C> decoder, DecodeOptions options)
100            throws DecodeException;
101
102    @Override
103    List<Control> getControls();
104
105    @Override
106    DN getName();
107
108    @Override
109    boolean removeAttribute(Attribute attribute, Collection<? super ByteString> missingValues);
110
111    @Override
112    boolean removeAttribute(AttributeDescription attributeDescription);
113
114    @Override
115    SearchResultEntry removeAttribute(String attributeDescription, Object... values);
116
117    @Override
118    boolean replaceAttribute(Attribute attribute);
119
120    @Override
121    SearchResultEntry replaceAttribute(String attributeDescription, Object... values);
122
123    @Override
124    SearchResultEntry setName(DN dn);
125
126    @Override
127    SearchResultEntry setName(String dn);
128
129}