org.apache.directory.api.ldap.model.message
Class DeleteRequestImpl

java.lang.Object
  extended by org.apache.directory.api.ldap.model.message.AbstractMessage
      extended by org.apache.directory.api.ldap.model.message.AbstractRequest
          extended by org.apache.directory.api.ldap.model.message.AbstractAbandonableRequest
              extended by org.apache.directory.api.ldap.model.message.DeleteRequestImpl
All Implemented Interfaces:
AbandonableRequest, DeleteRequest, Message, Request, ResultResponseRequest<DeleteResponse>, SingleReplyRequest<DeleteResponse>

public class DeleteRequestImpl
extends AbstractAbandonableRequest
implements DeleteRequest

Delete request implementation.

Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.api.ldap.model.message.AbstractMessage
controls
 
Fields inherited from interface org.apache.directory.api.ldap.model.message.DeleteRequest
RESP_TYPE, TYPE
 
Constructor Summary
DeleteRequestImpl()
          Creates a DeleteRequest implementing object used to delete a leaf entry from the DIT.
 
Method Summary
 DeleteRequest addAllControls(Control[] controls)
          Adds an array of controls to this Message.
 DeleteRequest addControl(Control control)
          Adds a control to this Message.
 boolean equals(Object obj)
          Checks to see if an object is equivalent to this DeleteRequest.
 Dn getName()
          Gets the distinguished name of the leaf entry to be deleted by this request.
 MessageTypeEnum getResponseType()
          Gets the protocol response message type for this request which produces at least one response.
 DeleteResponse getResultResponse()
          The result containing response for this request.
 int hashCode()
          
 DeleteRequest removeControl(Control control)
          Deletes a control removing it from this Message.
 DeleteRequest setMessageId(int messageId)
          Sets the Message ID for this request
 DeleteRequest setName(Dn name)
          Sets the distinguished name of the leaf entry to be deleted by this request.
 String toString()
          Return a String representing a DelRequest
 
Methods inherited from class org.apache.directory.api.ldap.model.message.AbstractAbandonableRequest
abandon, addAbandonListener, isAbandoned
 
Methods inherited from class org.apache.directory.api.ldap.model.message.AbstractRequest
hasResponse
 
Methods inherited from class org.apache.directory.api.ldap.model.message.AbstractMessage
get, getControl, getControls, getMessageId, getType, hasControl, put, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, 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
get, getControl, getControls, getMessageId, getType, hasControl, put
 
Methods inherited from interface org.apache.directory.api.ldap.model.message.AbandonableRequest
abandon, addAbandonListener, isAbandoned
 

Constructor Detail

DeleteRequestImpl

public DeleteRequestImpl()
Creates a DeleteRequest implementing object used to delete a leaf entry from the DIT.

Method Detail

getName

public Dn getName()
Gets the distinguished name of the leaf entry to be deleted by this request.

Specified by:
getName in interface DeleteRequest
Returns:
the Dn of the leaf entry to delete.

setName

public DeleteRequest setName(Dn name)
Sets the distinguished name of the leaf entry to be deleted by this request.

Specified by:
setName in interface DeleteRequest
Parameters:
name - the Dn of the leaf entry to delete.
Returns:
The DeleteRequest instance

setMessageId

public DeleteRequest setMessageId(int messageId)
Sets the Message ID for this request

Specified by:
setMessageId in interface DeleteRequest
Specified by:
setMessageId in interface Message
Overrides:
setMessageId in class AbstractMessage
Parameters:
messageId - The message Id
Returns:
A Message reference

addControl

public DeleteRequest addControl(Control control)
                         throws MessageException
Adds a control to this Message.

Specified by:
addControl in interface DeleteRequest
Specified by:
addControl in interface Message
Overrides:
addControl in class AbstractMessage
Parameters:
control - the control to add.
Returns:
A Message reference
Throws:
MessageException - if controls cannot be added to this Message or the control is not known etc.

addAllControls

public DeleteRequest addAllControls(Control[] controls)
                             throws MessageException
Adds an array of controls to this Message.

Specified by:
addAllControls in interface DeleteRequest
Specified by:
addAllControls in interface Message
Overrides:
addAllControls in class AbstractMessage
Parameters:
controls - the controls to add.
Returns:
A Message reference
Throws:
MessageException - if controls cannot be added to this Message or they are not known etc.

removeControl

public DeleteRequest removeControl(Control control)
                            throws MessageException
Deletes a control removing it from this Message.

Specified by:
removeControl in interface DeleteRequest
Specified by:
removeControl in interface Message
Overrides:
removeControl in class AbstractMessage
Parameters:
control - the control to remove.
Returns:
A Message reference
Throws:
MessageException - if controls cannot be added to this Message or the control is not known etc.

getResponseType

public MessageTypeEnum getResponseType()
Gets the protocol response message type for this request which produces at least one response.

Specified by:
getResponseType in interface SingleReplyRequest<DeleteResponse>
Returns:
the message type of the response.

getResultResponse

public DeleteResponse getResultResponse()
The result containing response for this request.

Specified by:
getResultResponse in interface ResultResponseRequest<DeleteResponse>
Returns:
the result containing response for this request

hashCode

public int hashCode()

Overrides:
hashCode in class AbstractRequest
Returns:
the instance's hash code
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)
Checks to see if an object is equivalent to this DeleteRequest. First there's a quick test to see if the obj is the same object as this one - if so true is returned. Next if the super method fails false is returned. Then the name of the entry is compared - if not the same false is returned. Finally the method exists returning true.

Overrides:
equals in class AbstractRequest
Parameters:
obj - the object to test for equality to this
Returns:
true if the obj is equal to this DeleteRequest, false otherwise

toString

public String toString()
Return a String representing a DelRequest

Overrides:
toString in class Object
Returns:
A DelRequest String


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