Class AbstractRequestDsml<E extends Request>
- java.lang.Object
-
- org.apache.directory.api.dsmlv2.AbstractDsmlMessageDecorator<E>
-
- org.apache.directory.api.dsmlv2.request.AbstractRequestDsml<E>
-
- Type Parameters:
E
- The request type
- All Implemented Interfaces:
DsmlDecorator<E>
,Message
,Request
- Direct Known Subclasses:
AbandonRequestDsml
,AbstractResultResponseRequestDsml
public abstract class AbstractRequestDsml<E extends Request> extends AbstractDsmlMessageDecorator<E> implements Request
Abstract class for DSML requests.- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description AbstractRequestDsml(LdapApiService codec, E ldapMessage)
Creates a new instance of AbstractRequestDsml.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
computeLength()
ByteBuffer
encode(ByteBuffer buffer)
Encode the request.boolean
hasResponse()
Tests to see if this Request produces one or more response types.org.dom4j.Element
toDsml(org.dom4j.Element root)
Creates the Request Element and adds RequestID and Controls.-
Methods inherited from class org.apache.directory.api.dsmlv2.AbstractDsmlMessageDecorator
addAllControls, addControl, get, getCodecService, getControl, getControls, getCurrentControl, getDecorated, getMessageId, getType, hasControl, put, removeControl, setMessageId
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.Message
addAllControls, addControl, get, getControl, getControls, getMessageId, getType, hasControl, put, removeControl, setMessageId
-
-
-
-
Constructor Detail
-
AbstractRequestDsml
public AbstractRequestDsml(LdapApiService codec, E ldapMessage)
Creates a new instance of AbstractRequestDsml.- Parameters:
codec
- The LDAP Service to useldapMessage
- the message to decorate
-
-
Method Detail
-
toDsml
public org.dom4j.Element toDsml(org.dom4j.Element root)
Creates the Request Element and adds RequestID and Controls.- Specified by:
toDsml
in interfaceDsmlDecorator<E extends Request>
- Parameters:
root
- the root element- Returns:
- the Request Element of the given name containing
-
computeLength
public int computeLength()
- Returns:
- the buffer's length (always 0)
-
encode
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
Encode the request. Always return an empty buffer.- Parameters:
buffer
- The buffer to allocate- Returns:
- The resulting buffer
- Throws:
EncoderException
- If we had an error while encoding the request
-
hasResponse
public boolean hasResponse()
Tests to see if this Request produces one or more response types.- Specified by:
hasResponse
in interfaceRequest
- Returns:
- true if a response can be expected, false otherwise.
-
-