Package org.ldaptive
Class AddRequest
- java.lang.Object
-
- org.ldaptive.AbstractRequestMessage
-
- org.ldaptive.AddRequest
-
- All Implemented Interfaces:
Request
public class AddRequest extends AbstractRequestMessage
LDAP add request defined as:AddRequest ::= [APPLICATION 8] SEQUENCE { entry LDAPDN, attributes AttributeList } AttributeList ::= SEQUENCE OF attribute Attribute
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AddRequest.Builder
Add 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 LdapAttribute[]
attributes
Attributes to add to the entry.private String
ldapDn
LDAP DN to add.static int
PROTOCOL_OP
BER protocol number.-
Fields inherited from class org.ldaptive.AbstractRequestMessage
logger
-
-
Constructor Summary
Constructors Modifier Constructor Description private
AddRequest()
Default constructor.AddRequest(String dn, Collection<LdapAttribute> attrs)
Creates a new add request.AddRequest(String dn, LdapAttribute... attrs)
Creates a new add request.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AddRequest.Builder
builder()
Creates a builder for this class.LdapAttribute[]
getAttributes()
Returns the attributes.String
getDn()
Returns the DN.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
-
ldapDn
private String ldapDn
LDAP DN to add.
-
attributes
private LdapAttribute[] attributes
Attributes to add to the entry.
-
-
Constructor Detail
-
AddRequest
private AddRequest()
Default constructor.
-
AddRequest
public AddRequest(String dn, LdapAttribute... attrs)
Creates a new add request.- Parameters:
dn
- DN to addattrs
- to add to the entry
-
AddRequest
public AddRequest(String dn, Collection<LdapAttribute> attrs)
Creates a new add request.- Parameters:
dn
- DN to addattrs
- to add to the entry
-
-
Method Detail
-
getDn
public String getDn()
Returns the DN.- Returns:
- DN
-
getAttributes
public LdapAttribute[] getAttributes()
Returns the attributes.- Returns:
- add attributes
-
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
-
toString
public String toString()
- Overrides:
toString
in classAbstractRequestMessage
-
builder
public static AddRequest.Builder builder()
Creates a builder for this class.- Returns:
- new builder
-
-