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 intcomputeLength()ByteBufferencode(ByteBuffer buffer)Encode the request.protected StringgetRequestName()Gets the name of the request according to the type of the decorated element.booleanhasResponse()Tests to see if this Request produces one or more response types.ElementtoDsml(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
clone, equals, finalize, 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 Element toDsml(Element root)
Creates the Request Element and adds RequestID and Controls.- Specified by:
toDsmlin interfaceDsmlDecorator<E extends Request>- Parameters:
root- the root element- Returns:
- the Request Element of the given name containing
-
getRequestName
protected String getRequestName()
Gets the name of the request according to the type of the decorated element.- Returns:
- the name of the request according to the type of the decorated element.
-
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:
hasResponsein interfaceRequest- Returns:
- true if a response can be expected, false otherwise.
-
-