public class AddRequestCodec extends LdapMessageCodec
ldapMessageLength
parent
Constructor and Description |
---|
AddRequestCodec()
Creates a new AddRequest object.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributeType(String type)
Create a new attributeValue
|
void |
addAttributeValue(byte[] value)
Add a new value to the current attribute
|
void |
addAttributeValue(String value)
Add a new value to the current attribute
|
void |
addAttributeValue(Value<?> value)
Add a new value to the current attribute
|
protected int |
computeLengthProtocolOp()
Compute the AddRequest length
AddRequest :
0x68 L1
|
+--> 0x04 L2 entry
+--> 0x30 L3 (attributes)
|
+--> 0x30 L4-1 (attribute)
| |
| +--> 0x04 L5-1 type
| +--> 0x31 L6-1 (values)
| |
| +--> 0x04 L7-1-1 value
| +--> ...
|
protected void |
encodeProtocolOp(ByteBuffer buffer)
Encode the AddRequest message to a PDU.
|
String |
getCurrentAttributeType() |
Entry |
getEntry()
Get the entry to be added
|
DN |
getEntryDn()
Get the added DN
|
MessageTypeEnum |
getMessageType()
Get the message type
|
String |
getMessageTypeName()
Get the message type Name
|
void |
initEntry()
Initialize the Entry.
|
void |
setEntry(Entry entry)
Sets the entry.
|
void |
setEntryDn(DN entryDn)
Set the added DN.
|
String |
toString()
Return a String representing an AddRequest
|
addControl, addControls, computeLength, encode, getCodecControl, getControls, getControls, getCurrentControl, getMessageId, initControls, setMessageId, toString
addLength, encode, getCurrentLength, getExpectedLength, getParent, getTlvId, setCurrentLength, setExpectedLength, setParent
public MessageTypeEnum getMessageType()
getMessageType
in class LdapMessageCodec
public String getMessageTypeName()
getMessageTypeName
in class LdapMessageCodec
public void initEntry()
public Entry getEntry()
public void setEntry(Entry entry)
entry
- the entrypublic void addAttributeType(String type) throws LdapException
type
- The attribute's name (called 'type' in the grammar)LdapException
public void addAttributeValue(String value)
value
- The value to addpublic void addAttributeValue(Value<?> value)
value
- The value to addpublic void addAttributeValue(byte[] value)
value
- The value to addpublic DN getEntryDn()
public void setEntryDn(DN entryDn)
entry
- The DN to set.protected int computeLengthProtocolOp()
computeLengthProtocolOp
in class LdapMessageCodec
protected void encodeProtocolOp(ByteBuffer buffer) throws EncoderException
encodeProtocolOp
in class LdapMessageCodec
buffer
- The buffer where to put the PDUEncoderException
public String getCurrentAttributeType()
Copyright © 2003–2015 The Apache Software Foundation. All rights reserved.