Package org.ldaptive.ext
Class MergeRequest
- java.lang.Object
-
- org.ldaptive.ext.MergeRequest
-
public class MergeRequest extends Object
Contains the data required to perform a merge operation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
MergeRequest.AttributeModificationsHandler
Marker interface for an attribute modifications handler.static class
MergeRequest.BatchHandler
Processes attribute modifications so that any list of attribute modifications does not exceed the configured batch size.static class
MergeRequest.MaxSizeAttributeValueHandler
Processes attribute modifications to enforce the maximum number of attribute values in any single attribute.
-
Field Summary
Fields Modifier and Type Field Description private MergeRequest.AttributeModificationsHandler[]
attributeModificationsHandlers
Handler for attribute modifications.private boolean
deleteEntry
Whether to delete the entry.private String[]
excludeAttrs
Attribute names to exclude when performing a merge.private String[]
includeAttrs
Attribute names to include when performing a merge.private LdapEntry
ldapEntry
Ldap entry to merge.private String[]
searchAttrs
Attribute names to include in the search.private boolean
useReplace
Whether to use replace or add/delete for attribute modifications.
-
Constructor Summary
Constructors Constructor Description MergeRequest()
Default constructor.MergeRequest(LdapEntry entry)
Creates a new merge request.MergeRequest(LdapEntry entry, boolean delete)
Creates a new merge request.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static <T> void
divideList(List<T> list, int divisor, Consumer<List<T>> consumer)
Divides the supplied list into sub lists by the supplied divisor and passes each sub list to the consumer.MergeRequest.AttributeModificationsHandler[]
getAttributeModificationsHandlers()
Returns the attribute modifications handlers.boolean
getDeleteEntry()
Returns whether to delete the entry.LdapEntry
getEntry()
Returns the ldap entry to merge.String[]
getExcludeAttributes()
Returns the names of attributes that are excluded when performing a modify.String[]
getIncludeAttributes()
Returns the names of attributes that are included when performing a modify.String[]
getSearchAttributes()
Returns the names of attributes that are used when searching for the entry.boolean
isUseReplace()
Returns whether replace should be used for attribute modifications.void
setAttributeModificationsHandlers(MergeRequest.AttributeModificationsHandler... handlers)
Sets the attribute value processors.void
setDeleteEntry(boolean b)
Sets whether to delete the entry.void
setEntry(LdapEntry entry)
Sets the ldap entry to merge into the LDAP.void
setExcludeAttributes(String... attrs)
Sets the list of attribute names to exclude when performing a modify.void
setIncludeAttributes(String... attrs)
Sets the list of attribute names to include when performing modify.void
setSearchAttributes(String... attrs)
Sets the list of attribute names that are used when searching for the entry.void
setUseReplace(boolean replace)
Sets whether replace should be used for attribute modifications.String
toString()
-
-
-
Field Detail
-
ldapEntry
private LdapEntry ldapEntry
Ldap entry to merge.
-
deleteEntry
private boolean deleteEntry
Whether to delete the entry.
-
searchAttrs
private String[] searchAttrs
Attribute names to include in the search.
-
includeAttrs
private String[] includeAttrs
Attribute names to include when performing a merge.
-
excludeAttrs
private String[] excludeAttrs
Attribute names to exclude when performing a merge.
-
useReplace
private boolean useReplace
Whether to use replace or add/delete for attribute modifications.
-
attributeModificationsHandlers
private MergeRequest.AttributeModificationsHandler[] attributeModificationsHandlers
Handler for attribute modifications.
-
-
Constructor Detail
-
MergeRequest
public MergeRequest()
Default constructor.
-
MergeRequest
public MergeRequest(LdapEntry entry)
Creates a new merge request.- Parameters:
entry
- to merge into the LDAP
-
MergeRequest
public MergeRequest(LdapEntry entry, boolean delete)
Creates a new merge request.- Parameters:
entry
- to merge into the LDAPdelete
- whether the supplied entry should be deleted
-
-
Method Detail
-
getEntry
public LdapEntry getEntry()
Returns the ldap entry to merge.- Returns:
- ldap entry to merge
-
setEntry
public void setEntry(LdapEntry entry)
Sets the ldap entry to merge into the LDAP.- Parameters:
entry
- to merge
-
getDeleteEntry
public boolean getDeleteEntry()
Returns whether to delete the entry.- Returns:
- whether to delete the entry
-
setDeleteEntry
public void setDeleteEntry(boolean b)
Sets whether to delete the entry.- Parameters:
b
- whether to delete the entry
-
getSearchAttributes
public String[] getSearchAttributes()
Returns the names of attributes that are used when searching for the entry.- Returns:
- attribute names to return when searching
-
setSearchAttributes
public void setSearchAttributes(String... attrs)
Sets the list of attribute names that are used when searching for the entry.- Parameters:
attrs
- names to return when searching
-
getIncludeAttributes
public String[] getIncludeAttributes()
Returns the names of attributes that are included when performing a modify.- Returns:
- attribute names to include
-
setIncludeAttributes
public void setIncludeAttributes(String... attrs)
Sets the list of attribute names to include when performing modify.- Parameters:
attrs
- names to include
-
getExcludeAttributes
public String[] getExcludeAttributes()
Returns the names of attributes that are excluded when performing a modify.- Returns:
- attribute names to exclude
-
setExcludeAttributes
public void setExcludeAttributes(String... attrs)
Sets the list of attribute names to exclude when performing a modify.- Parameters:
attrs
- names to exclude
-
isUseReplace
public boolean isUseReplace()
Returns whether replace should be used for attribute modifications.- Returns:
- whether replace should be used for attribute modifications
-
setUseReplace
public void setUseReplace(boolean replace)
Sets whether replace should be used for attribute modifications.- Parameters:
replace
- whether replace should be used for attribute modifications
-
getAttributeModificationsHandlers
public MergeRequest.AttributeModificationsHandler[] getAttributeModificationsHandlers()
Returns the attribute modifications handlers.- Returns:
- attribute modifications handlers
-
setAttributeModificationsHandlers
public void setAttributeModificationsHandlers(MergeRequest.AttributeModificationsHandler... handlers)
Sets the attribute value processors.- Parameters:
handlers
- attribute modifications handlers
-
divideList
private static <T> void divideList(List<T> list, int divisor, Consumer<List<T>> consumer)
Divides the supplied list into sub lists by the supplied divisor and passes each sub list to the consumer.- Type Parameters:
T
- type of list element- Parameters:
list
- to dividedivisor
- to divide list byconsumer
- to process each sub list
-
-