public class SearchResultEntryDecorator extends MessageDecorator<SearchResultEntry> implements SearchResultEntry
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<byte[]> |
attributeIds
The list of all attributes Id bytes
|
private java.util.List<java.lang.Integer> |
attributeLength
The list of all attributes length
|
private int |
attributesLength
The partial attributes length
|
private Attribute |
currentAttribute
The current attribute being processed
|
private byte[] |
objectNameBytes
A temporary storage for the byte[] representing the objectName
|
private int |
searchResultEntryLength
The search result entry length
|
private java.util.List<java.lang.Integer> |
valuesLength
The list of all values length
|
messageLength| Constructor and Description |
|---|
SearchResultEntryDecorator(LdapApiService codec,
SearchResultEntry decoratedMessage)
Makes a SearchResultEntry encodable.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(byte[] type)
Create a new attribute
|
void |
addAttribute(java.lang.String type)
Create a new attribute
|
void |
addAttributeValue(java.lang.Object value)
Add a new value to the current attribute
|
int |
computeLength()
Compute the SearchResultEntry length
SearchResultEntry :
|
java.nio.ByteBuffer |
encode(java.nio.ByteBuffer buffer)
Encode the SearchResultEntry message to a PDU.
|
Attribute |
getCurrentAttribute() |
Entry |
getEntry()
Gets the entry.
|
Dn |
getObjectName()
Gets the distinguished name of the entry object returned.
|
void |
setEntry(Entry entry)
Sets an entry
|
void |
setObjectName(Dn objectName)
Sets the distinguished name of the entry object returned.
|
addAllControls, addControl, get, getCodecService, getControl, getControls, getControlsLength, getCurrentControl, getDecorated, getDecorator, getMessageId, getMessageLength, getType, hasControl, put, removeControl, setControlsLength, setMessageId, setMessageLength, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddAllControls, addControl, get, getControl, getControls, getMessageId, getType, hasControl, put, removeControl, setMessageIdprivate byte[] objectNameBytes
private int searchResultEntryLength
private int attributesLength
private java.util.List<java.lang.Integer> attributeLength
private java.util.List<byte[]> attributeIds
private java.util.List<java.lang.Integer> valuesLength
private Attribute currentAttribute
public SearchResultEntryDecorator(LdapApiService codec, SearchResultEntry decoratedMessage)
decoratedMessage - the decorated SearchResultEntrypublic Attribute getCurrentAttribute()
public void addAttribute(java.lang.String type)
throws LdapException
type - The attribute's typeLdapExceptionpublic void addAttribute(byte[] type)
throws LdapException
type - The attribute's typeLdapExceptionpublic void addAttributeValue(java.lang.Object value)
throws LdapException
value - The added valueLdapExceptionpublic Dn getObjectName()
getObjectName in interface SearchResultEntrypublic void setObjectName(Dn objectName)
setObjectName in interface SearchResultEntryobjectName - the Dn of the entry returned.public Entry getEntry()
getEntry in interface SearchResultEntrypublic void setEntry(Entry entry)
setEntry in interface SearchResultEntryentry - the entrypublic int computeLength()
0x64 L1
|
+--> 0x04 L2 objectName
+--> 0x30 L3 (attributes)
|
+--> 0x30 L4-1 (partial attributes list)
| |
| +--> 0x04 L5-1 type
| +--> 0x31 L6-1 (values)
| |
| +--> 0x04 L7-1-1 value
| +--> ...
| +--> 0x04 L7-1-n value
|
+--> 0x30 L4-2 (partial attributes list)
| |
| +--> 0x04 L5-2 type
| +--> 0x31 L6-2 (values)
| |
| +--> 0x04 L7-2-1 value
| +--> ...
| +--> 0x04 L7-2-n value
|
+--> ...
|
+--> 0x30 L4-m (partial attributes list)
|
+--> 0x04 L5-m type
+--> 0x31 L6-m (values)
|
+--> 0x04 L7-m-1 value
+--> ...
+--> 0x04 L7-m-n value
computeLength in interface Asn1ObjectcomputeLength in interface Decorator<SearchResultEntry>public java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
throws EncoderException
0x64 LL
0x04 LL objectName
0x30 LL attributes
0x30 LL partialAttributeList
0x04 LL type
0x31 LL vals
0x04 LL attributeValue
...
0x04 LL attributeValue
...
0x30 LL partialAttributeList
0x04 LL type
0x31 LL vals
0x04 LL attributeValue
...
0x04 LL attributeValue
encode in interface Asn1Objectencode in interface Decorator<SearchResultEntry>buffer - The buffer where to put the PDUsearchResultEntryDecorator - the SearchResultEntry decoratorEncoderException - if the buffer can't be encoded