Class AddRequest
- All Implemented Interfaces:
- Entry,- ProtocolOp,- Request,- ChangeRecord
 The RDN attribute(s) may or may not be included in the Add request.
 NO-USER-MODIFICATION attributes such as the createTimestamp or
 creatorsName attributes must not be included, since the server
 maintains these automatically.
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.forgerock.opendj.ldap.messages.RequestRequest.RequestType
- 
Method SummaryModifier and TypeMethodDescription<R,P, E extends Exception> 
 Raccept(RequestVisitor<R, P, E> v, P p) Applies aRequestVisitorto thisRequest.addAttribute(String attributeDescription, Object... values) Ensures that this entry contains the provided attribute and values (optional operation).booleanaddAttribute(Attribute attribute) Ensures that this entry contains the provided attribute and values (optional operation).booleanaddAttribute(Attribute attribute, Collection<? super ByteString> duplicateValues) Ensures that this entry contains the provided attribute and values (optional operation).addAttributeIfAbsent(Attribute attribute) Adds the provided attribute if it is not already present in this Entry and returnsnull.final AddRequestaddControl(Control control) Adds the provided control to this protocol-op.final AddRequestaddControls(Iterable<? extends Control> controls) Adds the provided controls to this protocol-op.Removes all the attributes from this entry (optional operation).booleancontainsAnyAttributes(String attributeDescription) Returnstrueif this entry contains any non-empty attributes having an attribute description which is a sub-type of the provided attribute description.booleancontainsAnyAttributes(AttributeDescription attributeDescription) Returnstrueif this entry contains any non-empty attributes having an attribute description which is a sub-type of the provided attribute description.booleancontainsAttribute(String attributeDescription, Object... values) Returnstrueif this entry contains all of the attribute values contained invalues.booleancontainsAttribute(AttributeDescription attributeDescription, Object... values) Returnstrueif this entry contains all of the attribute values contained invalues.booleancontainsAttribute(Attribute attribute, Collection<? super ByteString> missingValues) Returnstrueif this entry contains all of the attribute values contained inattribute.final booleancontainsControl(String oid) Returnstrueif this protocol-op contains the specified control.booleanReturnstrueifobjectis an entry which is equal to this entry.Returns anIterablecontaining all of the attributes in this entry.getAllAttributes(String attributeDescription) Returns anIterablecontaining all the attributes in this entry having an attribute description which is a sub-type of the provided attribute description.getAllAttributes(AttributeDescription attributeDescription) Returns anIterablecontaining all the attributes in this entry having an attribute description which is a sub-type of the provided attribute description.getAttribute(String attributeDescription) Returns the named attribute contained in this entry, ornullif it is not included with this entry.getAttribute(AttributeDescription attributeDescription) Returns the named attribute contained in this entry, ornullif it is not included with this entry.intReturns the number of attributes in this entry.final <C extends Control>
 CgetControl(ControlDecoder<C> decoder, DecodeOptions options) Decodes and returns the first control in this protocol-op having an OID corresponding to the provided control decoder.Returns aListcontaining the controls included with this protocol-op.getName()Returns the distinguished name of the entry being modified by thisChangeRecord.getType()Returns the type of this request to avoid expensiveinstanceofchecks.inthashCode()Returns the hash code for this entry.mergeAttribute(Attribute attribute, BiFunction<? super Attribute, ? super Attribute, ? extends Attribute> mergeFunction) Adds the provided attribute if it is not already present in this Entry.parseAttribute(String attributeDescription) Returns a parser for the named attribute contained in this entry.parseAttribute(AttributeDescription attributeDescription) Returns a parser for the named attribute contained in this entry.removeAttribute(String attributeDescription, Object... values) Removes all of the attribute values contained invaluesfrom the named attribute in this entry if it is present (optional operation).booleanremoveAttribute(AttributeDescription attributeDescription) Removes the named attribute from this entry if it is present (optional operation).booleanremoveAttribute(Attribute attribute, Collection<? super ByteString> missingValues) Removes all of the attribute values contained inattributefrom this entry if it is present (optional operation).final AddRequestremoveControls(String oid) Removes all the controls having the specified OID.replaceAttribute(String attributeDescription, Object... values) Adds all of the attribute values contained invaluesto this entry, replacing any existing attribute values (optional operation).booleanreplaceAttribute(Attribute attribute) Adds all of the attribute values contained inattributeto this entry, replacing any existing attribute values (optional operation).Sets the distinguished name of the entry to be updated.Sets the distinguished name of the entry to be updated.toString()Returns a string representation of this entry.Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.forgerock.opendj.ldif.ChangeRecordaddControl, addControlsMethods inherited from interface org.forgerock.opendj.ldap.messages.ProtocolOpcontainsControl, getControl, getControl, getControlsMethods inherited from interface org.forgerock.opendj.ldap.messages.RequestremoveControls
- 
Method Details- 
acceptDescription copied from interface:RequestApplies aRequestVisitorto thisRequest.- Specified by:
- acceptin interface- Request
- Type Parameters:
- R- The return type of the visitor's methods.
- P- The type of the additional parameters to the visitor's methods.
- E- The type of the exception thrown by the visitor method if it fails, or- NeverThrowsExceptionif the visitor cannot fail.
- Parameters:
- v- The request visitor.
- p- Optional additional visitor parameter.
- Returns:
- A result as specified by the visitor.
- Throws:
- E- If the visitor failed.
 
- 
addAttributeDescription copied from interface:EntryEnsures that this entry contains the provided attribute and values (optional operation). This method has the following semantics:- If this entry does not already contain an attribute with a
 matchingattribute description, then this entry will be modified such that it containsattribute, even if it is empty.
- If this entry already contains an attribute with a
 matchingattribute description, then the attribute values contained inattributewill be merged with the existing attribute values.
 NOTE: When attributeis non-empty, this method implements LDAP Modify add semantics.- Specified by:
- addAttributein interface- Entry
- Parameters:
- attribute- The attribute values to be added to this entry, merging with any existing attribute values.
- Returns:
- trueif this entry changed as a result of this call.
 
- If this entry does not already contain an attribute with a
 
- 
addAttributeDescription copied from interface:EntryEnsures that this entry contains the provided attribute and values (optional operation). This method has the following semantics:- If this entry does not already contain an attribute with a
 matchingattribute description, then this entry will be modified such that it containsattribute, even if it is empty.
- If this entry already contains an attribute with a
 matchingattribute description, then the attribute values contained inattributewill be merged with the existing attribute values.
 NOTE: When attributeis non-empty, this method implements LDAP Modify add semantics.- Specified by:
- addAttributein interface- Entry
- Parameters:
- attribute- The attribute values to be added to this entry, merging with any existing attribute values.
- duplicateValues- A collection into which duplicate values will be added, or- nullif duplicate values should not be saved.
- Returns:
- trueif this entry changed as a result of this call.
 
- If this entry does not already contain an attribute with a
 
- 
addAttributeDescription copied from interface:EntryEnsures that this entry contains the provided attribute and values (optional operation). This method has the following semantics:- If this entry does not already contain an attribute with a
 matchingattribute description, then this entry will be modified such that it containsattribute, even if it is empty.
- If this entry already contains an attribute with a
 matchingattribute description, then the attribute values contained inattributewill be merged with the existing attribute values.
 The attribute description will be decoded using the schema associated with this entry (usually the default schema). Any attribute values which are not instances of ByteStringwill be converted using theByteString.valueOfObject(Object)method.NOTE: When attributeis non-empty, this method implements LDAP Modify add semantics.- Specified by:
- addAttributein interface- Entry
- Parameters:
- attributeDescription- The name of the attribute whose values are to be added.
- values- The attribute values to be added to this entry, merging any existing attribute values.
- Returns:
- This entry.
 
- If this entry does not already contain an attribute with a
 
- 
addAttributeIfAbsentDescription copied from interface:EntryAdds the provided attribute if it is not already present in this Entry and returnsnull. Otherwise returns the existing attribute.NOTE: this method is equivalent to Map.putIfAbsent(Object, Object).- Specified by:
- addAttributeIfAbsentin interface- Entry
- Parameters:
- attribute- The non-- nullattribute to be added if it is not already present.
- Returns:
- nullif the attribute was added, or the existing attribute (in which case the entry is unchanged).
 
- 
mergeAttributepublic Attribute mergeAttribute(Attribute attribute, BiFunction<? super Attribute, ? super Attribute, ? extends Attribute> mergeFunction) Description copied from interface:EntryAdds the provided attribute if it is not already present in this Entry. Otherwise, replaces the existing attribute with the results of the remapping function, or removes it if the result isnull.NOTE: this method is equivalent to Map.merge(Object, Object, BiFunction).- Specified by:
- mergeAttributein interface- Entry
- Parameters:
- attribute- The non-- nullattribute to be added or merged with the existing attribute.
- mergeFunction- The function to recompute the attribute if it is already present in this Entry.
- Returns:
- The attribute that was added or merged, or nullif the attribute was removed.
 
- 
clearAttributesDescription copied from interface:EntryRemoves all the attributes from this entry (optional operation).- Specified by:
- clearAttributesin interface- Entry
- Returns:
- This entry.
 
- 
containsAnyAttributesDescription copied from interface:EntryReturnstrueif this entry contains any non-empty attributes having an attribute description which is a sub-type of the provided attribute description.NOTE: this method performs the matching defined for an LDAP search presence filter. For example, given the attribute description "name" then this method will return trueif the entry contains "name", "name;option", "cn", or "cn;option". This method is NOT suitable for schema checking, which uses different matching semantics. Specifically, an entry which MUST contain "name" is not valid if it contains "cn", but not "name". See RFC 4512 - Attribute Description Hierarchies.- Specified by:
- containsAnyAttributesin interface- Entry
- Parameters:
- attributeDescription- The name of the attribute whose presence in this entry is to be tested.
- Returns:
- trueif this entry contains any non-empty attributes having an attribute description which is a sub-type of the provided attribute description.
 
- 
containsAnyAttributesDescription copied from interface:EntryReturnstrueif this entry contains any non-empty attributes having an attribute description which is a sub-type of the provided attribute description.NOTE: this method performs the matching defined for an LDAP search presence filter. For example, given the attribute description "name" then this method will return trueif the entry contains "name", "name;option", "cn", or "cn;option". This method is NOT suitable for schema checking, which uses different matching semantics. Specifically, an entry which MUST contain "name" is not valid if it contains "cn", but not "name". See RFC 4512 - Attribute Description Hierarchies.- Specified by:
- containsAnyAttributesin interface- Entry
- Parameters:
- attributeDescription- The name of the attribute whose presence in this entry is to be tested.
- Returns:
- trueif this entry contains any non-empty attributes having an attribute description which is a sub-type of the provided attribute description.
 
- 
containsAttributeDescription copied from interface:EntryReturnstrueif this entry contains all of the attribute values contained inattribute. Ifattributeis empty then this method will returntrueif the attribute is present in this entry, regardless of how many values it contains.- Specified by:
- containsAttributein interface- Entry
- Parameters:
- attribute- The attribute values whose presence in this entry is to be tested.
- missingValues- A collection into which missing values will be added, or- nullif missing values should not be saved.
- Returns:
- trueif this entry contains all of the attribute values contained in- attribute.
 
- 
containsAttributeDescription copied from interface:EntryReturnstrueif this entry contains all of the attribute values contained invalues. Ifvaluesisnullor empty then this method will returntrueif the attribute is present in this entry, regardless of how many values it contains.The attribute description will be decoded using the schema associated with this entry (usually the default schema). Any attribute values which are not instances of ByteStringwill be converted using theByteString.valueOfObject(Object)method.- Specified by:
- containsAttributein interface- Entry
- Parameters:
- attributeDescription- The name of the attribute whose presence in this entry is to be tested.
- values- The attribute values whose presence in this entry is to be tested, which may be- null.
- Returns:
- trueif this entry contains all of the attribute values contained in- values.
 
- 
containsAttributeDescription copied from interface:EntryReturnstrueif this entry contains all of the attribute values contained invalues. Ifvaluesisnullor empty then this method will returntrueif the attribute is present in this entry, regardless of how many values it contains.The attribute description will be decoded using the schema associated with this entry (usually the default schema). Any attribute values which are not instances of ByteStringwill be converted using theByteString.valueOfObject(Object)method.- Specified by:
- containsAttributein interface- Entry
- Parameters:
- attributeDescription- The name of the attribute whose presence in this entry is to be tested.
- values- The attribute values whose presence in this entry is to be tested, which may be- null.
- Returns:
- trueif this entry contains all of the attribute values contained in- values.
 
- 
equalsDescription copied from interface:EntryReturnstrueifobjectis an entry which is equal to this entry. Two entries are considered equal if their distinguished names are equal, they both have the same number of attributes, and every attribute contained in the first entry is also contained in the second entry.
- 
getAllAttributesDescription copied from interface:EntryReturns anIterablecontaining all of the attributes in this entry. The returnedIterablemay be used to remove attributes if permitted by this entry.- Specified by:
- getAllAttributesin interface- Entry
- Returns:
- An Iterablecontaining all of the attributes.
 
- 
getAllAttributesDescription copied from interface:EntryReturns anIterablecontaining all the attributes in this entry having an attribute description which is a sub-type of the provided attribute description. The returnedIterablemay be used to remove attributes if permitted by this entry.- Specified by:
- getAllAttributesin interface- Entry
- Parameters:
- attributeDescription- The name of the attributes to be returned.
- Returns:
- An Iterablecontaining the matching attributes.
 
- 
getAllAttributesDescription copied from interface:EntryReturns anIterablecontaining all the attributes in this entry having an attribute description which is a sub-type of the provided attribute description. The returnedIterablemay be used to remove attributes if permitted by this entry.The attribute description will be decoded using the schema associated with this entry (usually the default schema). - Specified by:
- getAllAttributesin interface- Entry
- Parameters:
- attributeDescription- The name of the attributes to be returned.
- Returns:
- An Iterablecontaining the matching attributes.
 
- 
getAttributeDescription copied from interface:EntryReturns the named attribute contained in this entry, ornullif it is not included with this entry.- Specified by:
- getAttributein interface- Entry
- Parameters:
- attributeDescription- The name of the attribute to be returned.
- Returns:
- The named attribute, or nullif it is not included with this entry.
 
- 
getAttributeDescription copied from interface:EntryReturns the named attribute contained in this entry, ornullif it is not included with this entry.The attribute description will be decoded using the schema associated with this entry (usually the default schema). - Specified by:
- getAttributein interface- Entry
- Parameters:
- attributeDescription- The name of the attribute to be returned.
- Returns:
- The named attribute, or nullif it is not included with this entry.
 
- 
getAttributeCountpublic int getAttributeCount()Description copied from interface:EntryReturns the number of attributes in this entry.- Specified by:
- getAttributeCountin interface- Entry
- Returns:
- The number of attributes.
 
- 
getNameDescription copied from interface:ChangeRecordReturns the distinguished name of the entry being modified by thisChangeRecord.- Specified by:
- getNamein interface- ChangeRecord
- Specified by:
- getNamein interface- Entry
- Returns:
- The distinguished name of the entry being modified.
 
- 
hashCodepublic int hashCode()Description copied from interface:EntryReturns the hash code for this entry. It will be calculated as the sum of the hash codes of the distinguished name and all of the attributes.
- 
parseAttributeDescription copied from interface:EntryReturns a parser for the named attribute contained in this entry.- Specified by:
- parseAttributein interface- Entry
- Parameters:
- attributeDescription- The name of the attribute to be parsed.
- Returns:
- A parser for the named attribute.
 
- 
parseAttributeDescription copied from interface:EntryReturns a parser for the named attribute contained in this entry.The attribute description will be decoded using the schema associated with this entry (usually the default schema). - Specified by:
- parseAttributein interface- Entry
- Parameters:
- attributeDescription- The name of the attribute to be parsed.
- Returns:
- A parser for the named attribute.
 
- 
removeAttributeDescription copied from interface:EntryRemoves all of the attribute values contained inattributefrom this entry if it is present (optional operation). Ifattributeis empty then the entire attribute will be removed if it is present.NOTE: This method implements LDAP Modify delete semantics. - Specified by:
- removeAttributein interface- Entry
- Parameters:
- attribute- The attribute values to be removed from this entry, which may be empty if the entire attribute is to be removed.
- missingValues- A collection into which missing values will be added, or- nullif missing values should not be saved.
- Returns:
- trueif this entry changed as a result of this call.
 
- 
removeAttributeDescription copied from interface:EntryRemoves the named attribute from this entry if it is present (optional operation). If this attribute does not contain the attribute, the call leaves this entry unchanged and returnsfalse.- Specified by:
- removeAttributein interface- Entry
- Parameters:
- attributeDescription- The name of the attribute to be removed.
- Returns:
- trueif this entry changed as a result of this call.
 
- 
removeAttributeDescription copied from interface:EntryRemoves all of the attribute values contained invaluesfrom the named attribute in this entry if it is present (optional operation). Ifvaluesisnullor empty then the entire attribute will be removed if it is present.The attribute description will be decoded using the schema associated with this entry (usually the default schema). Any attribute values which are not instances of ByteStringwill be converted using theByteString.valueOfObject(Object)method.NOTE: This method implements LDAP Modify delete semantics. - Specified by:
- removeAttributein interface- Entry
- Parameters:
- attributeDescription- The name of the attribute whose values are to be removed.
- values- The attribute values to be removed from this entry, which may be- nullor empty if the entire attribute is to be removed.
- Returns:
- This entry.
 
- 
replaceAttributeDescription copied from interface:EntryAdds all of the attribute values contained inattributeto this entry, replacing any existing attribute values (optional operation). Ifattributeis empty then the entire attribute will be removed if it is present.NOTE: This method implements LDAP Modify replace semantics as described in RFC 4511 - Section 4.6. Modify Operation. - Specified by:
- replaceAttributein interface- Entry
- Parameters:
- attribute- The attribute values to be added to this entry, replacing any existing attribute values, and which may be empty if the entire attribute is to be removed.
- Returns:
- trueif this entry changed as a result of this call.
 
- 
replaceAttributeDescription copied from interface:EntryAdds all of the attribute values contained invaluesto this entry, replacing any existing attribute values (optional operation). Ifvaluesisnullor empty then the entire attribute will be removed if it is present.The attribute description will be decoded using the schema associated with this entry (usually the default schema). Any attribute values which are not instances of ByteStringwill be converted using theByteString.valueOfObject(Object)method.NOTE: This method implements LDAP Modify replace semantics as described in RFC 4511 - Section 4.6. Modify Operation. - Specified by:
- replaceAttributein interface- Entry
- Parameters:
- attributeDescription- The name of the attribute whose values are to be replaced.
- values- The attribute values to be added to this entry, replacing any existing attribute values, and which may be- nullor empty if the entire attribute is to be removed.
- Returns:
- This entry.
 
- 
setNameDescription copied from interface:ChangeRecordSets the distinguished name of the entry to be updated. The server shall not perform any alias dereferencing in determining the object to be updated.- Specified by:
- setNamein interface- ChangeRecord
- Specified by:
- setNamein interface- Entry
- Parameters:
- dn- The distinguished name of the entry to be updated.
- Returns:
- This change record.
 
- 
setNameDescription copied from interface:ChangeRecordSets the distinguished name of the entry to be updated. The server shall not perform any alias dereferencing in determining the object to be updated.- Specified by:
- setNamein interface- ChangeRecord
- Specified by:
- setNamein interface- Entry
- Parameters:
- dn- The distinguished name of the entry to be updated.
- Returns:
- This change record.
 
- 
getTypeDescription copied from interface:RequestReturns the type of this request to avoid expensiveinstanceofchecks.
- 
toStringDescription copied from interface:EntryReturns a string representation of this entry.
- 
addControlDescription copied from interface:ProtocolOpAdds the provided control to this protocol-op.- Specified by:
- addControlin interface- ProtocolOp
- Parameters:
- control- The control to be added to this protocol-op.
- Returns:
- This protocol-op.
 
- 
addControlsDescription copied from interface:ProtocolOpAdds the provided controls to this protocol-op.- Specified by:
- addControlsin interface- ProtocolOp
- Parameters:
- controls- The controls to be added to this protocol-op.
- Returns:
- This protocol-op.
 
- 
removeControlsDescription copied from interface:ProtocolOpRemoves all the controls having the specified OID.- Specified by:
- removeControlsin interface- ProtocolOp
- Parameters:
- oid- The numeric OID of the protocol-op control to remove.
- Returns:
- This protocol-op.
 
- 
containsControlDescription copied from interface:ProtocolOpReturnstrueif this protocol-op contains the specified control.- Specified by:
- containsControlin interface- ProtocolOp
- Parameters:
- oid- The numeric OID of the protocol-op control.
- Returns:
- trueif this protocol-op contains the specified control.
 
- 
getControlpublic final <C extends Control> C getControl(ControlDecoder<C> decoder, DecodeOptions options) throws DecodeException Description copied from interface:ProtocolOpDecodes and returns the first control in this protocol-op having an OID corresponding to the provided control decoder.- Specified by:
- getControlin interface- ProtocolOp
- Type Parameters:
- C- The type of control to be decoded and returned.
- Parameters:
- decoder- The control decoder.
- options- The set of decode options which should be used when decoding the control.
- Returns:
- The decoded control, or nullif the control is not included with this protocol-op.
- Throws:
- DecodeException- If the control could not be decoded because it was malformed in some way (e.g. the control value was missing, or its content could not be decoded).
 
- 
getControlsDescription copied from interface:ProtocolOpReturns aListcontaining the controls included with this protocol-op. The returnedListmay be modified if permitted by this protocol-op.- Specified by:
- getControlsin interface- ProtocolOp
- Returns:
- A Listcontaining the controls.
 
 
-