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