org.apache.directory.api.dsmlv2.request
Class AbstractResultResponseRequestDsml<E extends ResultResponseRequest<F>,F extends ResultResponse>

java.lang.Object
  extended by org.apache.directory.api.dsmlv2.AbstractDsmlMessageDecorator<E>
      extended by org.apache.directory.api.dsmlv2.request.AbstractRequestDsml<E>
          extended by org.apache.directory.api.dsmlv2.request.AbstractResultResponseRequestDsml<E,F>
All Implemented Interfaces:
DsmlDecorator<E>, AbandonableRequest, Message, Request, ResultResponseRequest<F>
Direct Known Subclasses:
AddRequestDsml, BindRequestDsml, CompareRequestDsml, DelRequestDsml, ExtendedRequestDsml, ModifyDNRequestDsml, ModifyRequestDsml, SearchRequestDsml

public abstract class AbstractResultResponseRequestDsml<E extends ResultResponseRequest<F>,F extends ResultResponse>
extends AbstractRequestDsml<E>
implements ResultResponseRequest<F>, AbandonableRequest

Abstract class for DSML requests.

Author:
Apache Directory Project

Constructor Summary
AbstractResultResponseRequestDsml(LdapApiService codec, E ldapMessage)
          Creates a new instance of AbstractRequestDsml.
 
Method Summary
 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)
           
 F getResultResponse()
          If called for the first time, this methohd 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.directory.api.ldap.model.message.Request
hasResponse
 
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

AbstractResultResponseRequestDsml

public AbstractResultResponseRequestDsml(LdapApiService codec,
                                         E ldapMessage)
Creates a new instance of AbstractRequestDsml.

Parameters:
ldapMessage - 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 interface DsmlDecorator<E extends ResultResponseRequest<F>>
Overrides:
toDsml in class AbstractRequestDsml<E extends ResultResponseRequest<F>>
Parameters:
root - the root element
Returns:
the Request Element of the given name containing

computeLength

public int computeLength()
Overrides:
computeLength in class AbstractRequestDsml<E extends ResultResponseRequest<F>>

encode

public ByteBuffer encode(ByteBuffer buffer)
                  throws EncoderException
Overrides:
encode in class AbstractRequestDsml<E extends ResultResponseRequest<F>>
Throws:
EncoderException

getResultResponse

public F getResultResponse()
If called for the first time, this methohd creates a result containing response object for this request.

Specified by:
getResultResponse in interface ResultResponseRequest<F extends ResultResponse>
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 interface AbandonableRequest

isAbandoned

public boolean isAbandoned()
Checks to see if this request has been abandoned.

Specified by:
isAbandoned in interface AbandonableRequest
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 interface AbandonableRequest
Parameters:
listener - to be notified if this request gets abandoned.
Returns:
An AbandonableRequest reference


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.