Package org.ldaptive
Class ModifyRequest
- java.lang.Object
-
- org.ldaptive.AbstractRequestMessage
-
- org.ldaptive.ModifyRequest
-
- All Implemented Interfaces:
Request
public class ModifyRequest extends AbstractRequestMessage
LDAP modify request defined as:ModifyRequest ::= [APPLICATION 6] SEQUENCE { object LDAPDN, changes SEQUENCE OF change SEQUENCE { operation ENUMERATED { add (0), delete (1), replace (2), ... }, modification PartialAttribute } } PartialAttribute ::= SEQUENCE { type AttributeDescription, vals SET OF value AttributeValue } Attribute ::= PartialAttribute(WITH COMPONENTS { ..., vals (SIZE(1..MAX))})
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ModifyRequest.Builder
Modify request builder.-
Nested classes/interfaces inherited from class org.ldaptive.AbstractRequestMessage
AbstractRequestMessage.AbstractBuilder<B,T extends AbstractRequestMessage>
-
-
Field Summary
Fields Modifier and Type Field Description private static byte[]
EMPTY_BYTE
Empty byte.private String
ldapDn
LDAP DN to modify.private AttributeModification[]
modifications
Modifications to perform.static int
PROTOCOL_OP
BER protocol number.-
Fields inherited from class org.ldaptive.AbstractRequestMessage
logger
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ModifyRequest()
Default constructor.ModifyRequest(String entry, AttributeModification... mod)
Creates a new modify request.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ModifyRequest.Builder
builder()
Creates a builder for this class.private DEREncoder[]
getAttributeValueEncoders(Collection<byte[]> values)
Returns attribute value encoders for the supplied values.String
getDn()
Returns the DN.AttributeModification[]
getModifications()
Returns the attribute modifications.protected DEREncoder[]
getRequestEncoders(int id)
Returns the request encoders for this message.String
toString()
-
Methods inherited from class org.ldaptive.AbstractRequestMessage
encode, getControls, getResponseTimeout, setControls, setResponseTimeout
-
-
-
-
Field Detail
-
PROTOCOL_OP
public static final int PROTOCOL_OP
BER protocol number.- See Also:
- Constant Field Values
-
EMPTY_BYTE
private static final byte[] EMPTY_BYTE
Empty byte.
-
ldapDn
private String ldapDn
LDAP DN to modify.
-
modifications
private AttributeModification[] modifications
Modifications to perform.
-
-
Constructor Detail
-
ModifyRequest
private ModifyRequest()
Default constructor.
-
ModifyRequest
public ModifyRequest(String entry, AttributeModification... mod)
Creates a new modify request.- Parameters:
entry
- DN to modifymod
- to make on the object
-
-
Method Detail
-
getDn
public String getDn()
Returns the DN.- Returns:
- DN
-
getModifications
public AttributeModification[] getModifications()
Returns the attribute modifications.- Returns:
- attributes modifications
-
getRequestEncoders
protected DEREncoder[] getRequestEncoders(int id)
Description copied from class:AbstractRequestMessage
Returns the request encoders for this message.- Specified by:
getRequestEncoders
in classAbstractRequestMessage
- Parameters:
id
- message ID- Returns:
- request encoders
-
getAttributeValueEncoders
private DEREncoder[] getAttributeValueEncoders(Collection<byte[]> values)
Returns attribute value encoders for the supplied values.- Parameters:
values
- to create encoders for- Returns:
- attribute value encoders
-
toString
public String toString()
- Overrides:
toString
in classAbstractRequestMessage
-
builder
public static ModifyRequest.Builder builder()
Creates a builder for this class.- Returns:
- new builder
-
-