public class SearchResultEntryDecorator extends MessageDecorator<SearchResultEntry> implements SearchResultEntry
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(String type)
Create a new attribute
|
void |
addAttributeValue(Object value)
Add a new value to the current attribute
|
int |
computeLength()
Compute the SearchResultEntry length
SearchResultEntry : |
ByteBuffer |
encode(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, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
addAllControls, addControl, get, getControl, getControls, getMessageId, getType, hasControl, put, removeControl, setMessageId
public SearchResultEntryDecorator(LdapApiService codec, SearchResultEntry decoratedMessage)
codec
- The LDAP service instancedecoratedMessage
- the decorated SearchResultEntrypublic Attribute getCurrentAttribute()
public void addAttribute(String type) throws LdapException
type
- The attribute's typeLdapException
- If the value is invalidpublic void addAttribute(byte[] type) throws LdapException
type
- The attribute's typeLdapException
- If the value is invalidpublic void addAttributeValue(Object value) throws LdapException
value
- The added valueLdapException
- If the value is invalidpublic Dn getObjectName()
getObjectName
in interface SearchResultEntry
public void setObjectName(Dn objectName)
setObjectName
in interface SearchResultEntry
objectName
- the Dn of the entry returned.public Entry getEntry()
getEntry
in interface SearchResultEntry
public void setEntry(Entry entry)
setEntry
in interface SearchResultEntry
entry
- 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 Asn1Object
computeLength
in interface Decorator<SearchResultEntry>
public ByteBuffer encode(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 Asn1Object
encode
in interface Decorator<SearchResultEntry>
buffer
- The buffer where to put the PDUEncoderException
- if the buffer can't be encodedCopyright © 2003–2018 The Apache Software Foundation. All rights reserved.