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.requests; 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; 042import org.forgerock.opendj.ldif.ChangeRecord; 043import org.forgerock.opendj.ldif.ChangeRecordVisitor; 044 045/** 046 * The Add operation allows a client to request the addition of an entry into 047 * the Directory. 048 * <p> 049 * The RDN attribute(s) may or may not be included in the Add request. 050 * NO-USER-MODIFICATION attributes such as the {@code createTimestamp} or 051 * {@code creatorsName} attributes must not be included, since the server 052 * maintains these automatically. 053 */ 054public interface AddRequest extends Request, ChangeRecord, Entry { 055 056 @Override 057 <R, P> R accept(ChangeRecordVisitor<R, P> v, P p); 058 059 @Override 060 boolean addAttribute(Attribute attribute); 061 062 @Override 063 boolean addAttribute(Attribute attribute, Collection<? super ByteString> duplicateValues); 064 065 @Override 066 AddRequest addAttribute(String attributeDescription, Object... values); 067 068 @Override 069 AddRequest addControl(Control control); 070 071 @Override 072 AddRequest 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 AddRequest removeAttribute(String attributeDescription, Object... values); 116 117 @Override 118 boolean replaceAttribute(Attribute attribute); 119 120 @Override 121 AddRequest replaceAttribute(String attributeDescription, Object... values); 122 123 @Override 124 AddRequest setName(DN dn); 125 126 @Override 127 AddRequest setName(String dn); 128 129}