Class AbstractResultResponseRequestDsml<E extends ResultResponseRequest,F extends ResultResponse>
- java.lang.Object
-
- org.apache.directory.api.dsmlv2.AbstractDsmlMessageDecorator<E>
-
- org.apache.directory.api.dsmlv2.request.AbstractRequestDsml<E>
-
- org.apache.directory.api.dsmlv2.request.AbstractResultResponseRequestDsml<E,F>
-
- Type Parameters:
E
- The response request result typeF
- The response result type
- All Implemented Interfaces:
DsmlDecorator<E>
,AbandonableRequest
,Message
,Request
,ResultResponseRequest
- Direct Known Subclasses:
AddRequestDsml
,BindRequestDsml
,CompareRequestDsml
,DelRequestDsml
,ExtendedRequestDsml
,ModifyDNRequestDsml
,ModifyRequestDsml
,SearchRequestDsml
public abstract class AbstractResultResponseRequestDsml<E extends ResultResponseRequest,F extends ResultResponse> extends AbstractRequestDsml<E> implements ResultResponseRequest, AbandonableRequest
Abstract class for DSML requests.- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description AbstractResultResponseRequestDsml(LdapApiService codec, E ldapMessage)
Creates a new instance of AbstractRequestDsml.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abandon()
Abandons this request.AbandonableRequest
addAbandonListener(AbandonListener listener)
Adds listener to be notified if this request gets abandoned.int
computeLength()
ByteBuffer
encode(ByteBuffer buffer)
Encode the request.ResultResponse
getResultResponse()
If called for the first time, this method creates a result containing response object for this request.boolean
isAbandoned()
Checks to see if this request has been abandoned.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.request.AbstractRequestDsml
hasResponse
-
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
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.Request
hasResponse
-
-
-
-
Constructor Detail
-
AbstractResultResponseRequestDsml
public AbstractResultResponseRequestDsml(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 ResultResponseRequest>
- Overrides:
toDsml
in classAbstractRequestDsml<E extends ResultResponseRequest>
- Parameters:
root
- the root element- Returns:
- the Request Element of the given name containing
-
computeLength
public int computeLength()
- Overrides:
computeLength
in classAbstractRequestDsml<E extends ResultResponseRequest>
- Returns:
- the buffer's length (always 0)
-
encode
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
Encode the request. Always return an empty buffer.- Overrides:
encode
in classAbstractRequestDsml<E extends ResultResponseRequest>
- Parameters:
buffer
- The buffer to allocate- Returns:
- The resulting buffer
- Throws:
EncoderException
- If we had an error while encoding the request
-
getResultResponse
public ResultResponse getResultResponse()
If called for the first time, this method creates a result containing response object for this request.- Specified by:
getResultResponse
in interfaceResultResponseRequest
- Returns:
- a result containing response with defaults and the messageId set in response to this specific request
-
abandon
public void abandon()
Abandons this request.- Specified by:
abandon
in interfaceAbandonableRequest
-
isAbandoned
public boolean isAbandoned()
Checks to see if this request has been abandoned.- Specified by:
isAbandoned
in interfaceAbandonableRequest
- Returns:
- true if the request has been abandoned.
-
addAbandonListener
public AbandonableRequest addAbandonListener(AbandonListener listener)
Adds listener to be notified if this request gets abandoned.- Specified by:
addAbandonListener
in interfaceAbandonableRequest
- Parameters:
listener
- to be notified if this request gets abandoned.- Returns:
- An AbandonableRequest reference
-
-