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 classAddRequest.BuilderAdd 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[]attributesAttributes to add to the entry.private StringldapDnLDAP DN to add.static intPROTOCOL_OPBER protocol number.-
Fields inherited from class org.ldaptive.AbstractRequestMessage
logger
-
-
Constructor Summary
Constructors Modifier Constructor Description privateAddRequest()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.Builderbuilder()Creates a builder for this class.LdapAttribute[]getAttributes()Returns the attributes.StringgetDn()Returns the DN.protected DEREncoder[]getRequestEncoders(int id)Returns the request encoders for this message.StringtoString()-
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:AbstractRequestMessageReturns the request encoders for this message.- Specified by:
getRequestEncodersin classAbstractRequestMessage- Parameters:
id- message ID- Returns:
- request encoders
-
toString
public String toString()
- Overrides:
toStringin classAbstractRequestMessage
-
builder
public static AddRequest.Builder builder()
Creates a builder for this class.- Returns:
- new builder
-
-