Package com.unboundid.ldap.sdk
Interface ReadOnlyAddRequest
-
- All Superinterfaces:
ReadOnlyLDAPRequest
,java.io.Serializable
- All Known Implementing Classes:
AddRequest
@NotExtensible @ThreadSafety(level=INTERFACE_NOT_THREADSAFE) public interface ReadOnlyAddRequest extends ReadOnlyLDAPRequest
This interface defines a set of methods that may be safely called in an LDAP add request without altering its contents. This interface must not be implemented by any class other thanAddRequest
.
This interface does not inherently provide the assurance of thread safety for the methods that it exposes, because it is still possible for a thread referencing the object which implements this interface to alter the request using methods not included in this interface. However, if it can be guaranteed that no thread will alter the underlying object, then the methods exposed by this interface can be safely invoked concurrently by any number of threads.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AddRequest
duplicate()
Creates a new instance of this LDAP request that may be modified without impacting this request.AddRequest
duplicate(Control[] controls)
Creates a new instance of this LDAP request that may be modified without impacting this request.Attribute
getAttribute(java.lang.String attributeName)
Retrieves the specified attribute from this add request.java.util.List<Attribute>
getAttributes()
Retrieves the set of attributes for this add request.java.lang.String
getDN()
Retrieves the DN for this add request.boolean
hasAttribute(Attribute attribute)
Indicates whether this add request contains the specified attribute.boolean
hasAttribute(java.lang.String attributeName)
Indicates whether this add request contains the specified attribute.boolean
hasAttributeValue(java.lang.String attributeName, byte[] attributeValue)
Indicates whether this add request contains an attribute with the given name and value.boolean
hasAttributeValue(java.lang.String attributeName, byte[] attributeValue, MatchingRule matchingRule)
Indicates whether this add request contains an attribute with the given name and value.boolean
hasAttributeValue(java.lang.String attributeName, java.lang.String attributeValue)
Indicates whether this add request contains an attribute with the given name and value.boolean
hasAttributeValue(java.lang.String attributeName, java.lang.String attributeValue, MatchingRule matchingRule)
Indicates whether this add request contains an attribute with the given name and value.boolean
hasObjectClass(java.lang.String objectClassName)
Indicates whether this add request contains the specified object class.Entry
toEntry()
Retrieves anEntry
object containing the DN and attributes of this add request.java.lang.String[]
toLDIF()
Retrieves a string array whose lines contain an LDIF representation of the corresponding add change record.LDIFAddChangeRecord
toLDIFChangeRecord()
Retrieves an LDIF add change record with the contents of this add request.java.lang.String
toLDIFString()
Retrieves an LDIF string representation of this add request.-
Methods inherited from interface com.unboundid.ldap.sdk.ReadOnlyLDAPRequest
followReferrals, getControl, getControlList, getControls, getReferralConnector, getResponseTimeoutMillis, hasControl, hasControl, toCode, toString, toString
-
-
-
-
Method Detail
-
getDN
java.lang.String getDN()
Retrieves the DN for this add request.- Returns:
- The DN for this add request.
-
getAttributes
java.util.List<Attribute> getAttributes()
Retrieves the set of attributes for this add request.- Returns:
- The set of attributes for this add request.
-
getAttribute
Attribute getAttribute(java.lang.String attributeName)
Retrieves the specified attribute from this add request.- Parameters:
attributeName
- The name of the attribute to retrieve. It must not benull
.- Returns:
- The requested attribute, or
null
if it does not exist in the add request.
-
hasAttribute
boolean hasAttribute(java.lang.String attributeName)
Indicates whether this add request contains the specified attribute.- Parameters:
attributeName
- The name of the attribute for which to make the determination. It must not benull
.- Returns:
true
if this add request contains the specified attribute, orfalse
if not.
-
hasAttribute
boolean hasAttribute(Attribute attribute)
Indicates whether this add request contains the specified attribute. It will only returntrue
if this add request contains an attribute with the same name and exact set of values.- Parameters:
attribute
- The attribute for which to make the determination. It must not benull
.- Returns:
true
if this add request contains the specified attribute, orfalse
if not.
-
hasAttributeValue
boolean hasAttributeValue(java.lang.String attributeName, java.lang.String attributeValue)
Indicates whether this add request contains an attribute with the given name and value.- Parameters:
attributeName
- The name of the attribute for which to make the determination. It must not benull
.attributeValue
- The value for which to make the determination. It must not benull
.- Returns:
true
if this add request contains an attribute with the specified name and value, orfalse
if not.
-
hasAttributeValue
boolean hasAttributeValue(java.lang.String attributeName, java.lang.String attributeValue, MatchingRule matchingRule)
Indicates whether this add request contains an attribute with the given name and value.- Parameters:
attributeName
- The name of the attribute for which to make the determination. It must not benull
.attributeValue
- The value for which to make the determination. It must not benull
.matchingRule
- The matching rule to use to make the determination. It must not benull
.- Returns:
true
if this add request contains an attribute with the specified name and value, orfalse
if not.
-
hasAttributeValue
boolean hasAttributeValue(java.lang.String attributeName, byte[] attributeValue)
Indicates whether this add request contains an attribute with the given name and value.- Parameters:
attributeName
- The name of the attribute for which to make the determination. It must not benull
.attributeValue
- The value for which to make the determination. It must not benull
.- Returns:
true
if this add request contains an attribute with the specified name and value, orfalse
if not.
-
hasAttributeValue
boolean hasAttributeValue(java.lang.String attributeName, byte[] attributeValue, MatchingRule matchingRule)
Indicates whether this add request contains an attribute with the given name and value.- Parameters:
attributeName
- The name of the attribute for which to make the determination. It must not benull
.attributeValue
- The value for which to make the determination. It must not benull
.matchingRule
- The matching rule to use to make the determination. It must not benull
.- Returns:
true
if this add request contains an attribute with the specified name and value, orfalse
if not.
-
hasObjectClass
boolean hasObjectClass(java.lang.String objectClassName)
Indicates whether this add request contains the specified object class.- Parameters:
objectClassName
- The name of the object class for which to make the determination. It must not benull
.- Returns:
true
if this add request contains the specified object class, orfalse
if not.
-
toEntry
Entry toEntry()
Retrieves anEntry
object containing the DN and attributes of this add request.- Returns:
- An
Entry
object containing the DN and attributes of this add request.
-
duplicate
AddRequest duplicate()
Creates a new instance of this LDAP request that may be modified without impacting this request.- Specified by:
duplicate
in interfaceReadOnlyLDAPRequest
- Returns:
- A new instance of this LDAP request that may be modified without impacting this request.
-
duplicate
AddRequest duplicate(Control[] controls)
Creates a new instance of this LDAP request that may be modified without impacting this request. The provided controls will be used for the new request instead of duplicating the controls from this request.- Specified by:
duplicate
in interfaceReadOnlyLDAPRequest
- Parameters:
controls
- The set of controls to include in the duplicate request.- Returns:
- A new instance of this LDAP request that may be modified without impacting this request.
-
toLDIFChangeRecord
LDIFAddChangeRecord toLDIFChangeRecord()
Retrieves an LDIF add change record with the contents of this add request.- Returns:
- An LDIF add change record with the contents of this add request.
-
toLDIF
java.lang.String[] toLDIF()
Retrieves a string array whose lines contain an LDIF representation of the corresponding add change record.- Returns:
- A string array whose lines contain an LDIF representation of the corresponding add change record.
-
toLDIFString
java.lang.String toLDIFString()
Retrieves an LDIF string representation of this add request.- Returns:
- An LDIF string representation of this add request.
-
-