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

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.ModifyRequestImpl
All Implemented Interfaces:
AbandonableRequest, Message, ModifyRequest, Request, ResultResponseRequest<ModifyResponse>, SingleReplyRequest<ModifyResponse>

public class ModifyRequestImpl
extends AbstractAbandonableRequest
implements ModifyRequest

Lockable ModifyRequest 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.ModifyRequest
RESP_TYPE, TYPE
 
Constructor Summary
ModifyRequestImpl()
          Creates a ModifyRequest implementing object used to modify the attributes of an entry.
 
Method Summary
 ModifyRequest add(Attribute attr)
          marks a given attribute for addition in the target entry.
 ModifyRequest add(String attributeName, byte[]... attributeValue)
           
 ModifyRequest add(String attributeName, String... attributeValue)
          marks a given attribute for addition in the target entry with the given values.
 ModifyRequest addAllControls(Control[] controls)
          Adds an array of controls to this Message.
 ModifyRequest addControl(Control control)
          Adds a control to this Message.
 ModifyRequest addModification(Attribute attr, ModificationOperation modOp)
          Add a modification
 ModifyRequest addModification(Modification mod)
          Adds a ModificationItem to the set of modifications composing this modify request.
 boolean equals(Object obj)
          Checks to see if ModifyRequest stub equals another by factoring in checks for the name and modification items of the request.
 Collection<Modification> getModifications()
          Gets an immutable Collection of modification items representing the atomic changes to perform on the candidate entry to modify.
 Dn getName()
          Gets the distinguished name of the entry to be modified by this request.
 MessageTypeEnum getResponseType()
          Gets the protocol response message type for this request which produces at least one response.
 ModifyResponse getResultResponse()
          The result containing response for this request.
 int hashCode()
          
 ModifyRequest remove(Attribute attr)
          marks a given attribute for removal from the target entry.
 ModifyRequest remove(String attributeName, byte[]... attributeValue)
          
 ModifyRequest remove(String attributeName, String... attributeValue)
          marks a given attribute for removal with the given values from the target entry.
 ModifyRequest removeControl(Control control)
          Deletes a control removing it from this Message.
 ModifyRequest removeModification(Modification mod)
          Removes a ModificationItem to the set of modifications composing this modify request.
 ModifyRequest replace(Attribute attr)
          marks a given attribute for replacement in the target entry.
 ModifyRequest replace(String attributeName)
           
 ModifyRequest replace(String attributeName, byte[]... attributeValue)
           
 ModifyRequest replace(String attributeName, String... attributeValue)
          marks a given attribute for replacement with the given values in the target entry.
 ModifyRequest setMessageId(int messageId)
          Sets the Message ID for this request
 ModifyRequest setName(Dn name)
          Sets the distinguished name of the entry to be modified by this request.
 String toString()
          Get a String representation of a ModifyRequest
 
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

ModifyRequestImpl

public ModifyRequestImpl()
Creates a ModifyRequest implementing object used to modify the attributes of an entry.

Method Detail

getModifications

public Collection<Modification> getModifications()
Gets an immutable Collection of modification items representing the atomic changes to perform on the candidate entry to modify.

Specified by:
getModifications in interface ModifyRequest
Returns:
an immutable Collection of Modification instances.

getName

public Dn getName()
Gets the distinguished name of the entry to be modified by this request. This property represents the PDU's object field.

Specified by:
getName in interface ModifyRequest
Returns:
the Dn of the modified entry.

setName

public ModifyRequest setName(Dn name)
Sets the distinguished name of the entry to be modified by this request. This property represents the PDU's object field.

Specified by:
setName in interface ModifyRequest
Parameters:
name - the Dn of the modified entry.
Returns:
The ModifyRequest instance

addModification

public ModifyRequest addModification(Modification mod)
Adds a ModificationItem to the set of modifications composing this modify request.

Specified by:
addModification in interface ModifyRequest
Parameters:
mod - a Modification to add.
Returns:
The ModifyRequest instance

addModification

public ModifyRequest addModification(Attribute attr,
                                     ModificationOperation modOp)
Add a modification

Specified by:
addModification in interface ModifyRequest
Parameters:
attr - The attribute to be modified
modOp - The operation
Returns:
The ModifyRequest instance

add

public ModifyRequest add(String attributeName,
                         String... attributeValue)
marks a given attribute for addition in the target entry with the given values.

Specified by:
add in interface ModifyRequest
Parameters:
attributeName - name of the attribute to be added
attributeValue - values of the attribute
Returns:
The ModifyRequest instance

add

public ModifyRequest add(String attributeName,
                         byte[]... attributeValue)
Specified by:
add in interface ModifyRequest
See Also:
add(String, String...)

add

public ModifyRequest add(Attribute attr)
marks a given attribute for addition in the target entry.

Specified by:
add in interface ModifyRequest
Parameters:
attr - the attribute to be added
Returns:
The ModifyRequest instance

replace

public ModifyRequest replace(String attributeName)
Specified by:
replace in interface ModifyRequest
See Also:
replace(String, String...)

replace

public ModifyRequest replace(String attributeName,
                             String... attributeValue)
marks a given attribute for replacement with the given values in the target entry.

Specified by:
replace in interface ModifyRequest
Parameters:
attributeName - name of the attribute to be added
attributeValue - values of the attribute
Returns:
The ModifyRequest instance

replace

public ModifyRequest replace(String attributeName,
                             byte[]... attributeValue)
Specified by:
replace in interface ModifyRequest
See Also:
replace(String, String...)

replace

public ModifyRequest replace(Attribute attr)
marks a given attribute for replacement in the target entry.

Specified by:
replace in interface ModifyRequest
Parameters:
attr - the attribute to be added
Returns:
The ModifyRequest instance

removeModification

public ModifyRequest removeModification(Modification mod)
Removes a ModificationItem to the set of modifications composing this modify request.

Specified by:
removeModification in interface ModifyRequest
Parameters:
mod - a Modification to remove.
Returns:
The ModifyRequest instance

remove

public ModifyRequest remove(String attributeName,
                            String... attributeValue)
marks a given attribute for removal with the given values from the target entry.

Specified by:
remove in interface ModifyRequest
Parameters:
attributeName - name of the attribute to be added
attributeValue - values of the attribute
Returns:
The ModifyRequest instance

remove

public ModifyRequest remove(String attributeName,
                            byte[]... attributeValue)

Specified by:
remove in interface ModifyRequest
See Also:
ModifyRequest.remove(String, String...)

remove

public ModifyRequest remove(Attribute attr)
marks a given attribute for removal from the target entry.

Specified by:
remove in interface ModifyRequest
Parameters:
attr - the attribute to be added
Returns:
The ModifyRequest instance

setMessageId

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

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

addControl

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

Specified by:
addControl in interface Message
Specified by:
addControl in interface ModifyRequest
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 ModifyRequest addAllControls(Control[] controls)
                             throws MessageException
Adds an array of controls to this Message.

Specified by:
addAllControls in interface Message
Specified by:
addAllControls in interface ModifyRequest
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 ModifyRequest removeControl(Control control)
                            throws MessageException
Deletes a control removing it from this Message.

Specified by:
removeControl in interface Message
Specified by:
removeControl in interface ModifyRequest
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<ModifyResponse>
Returns:
the message type of the response.

getResultResponse

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

Specified by:
getResultResponse in interface ResultResponseRequest<ModifyResponse>
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 ModifyRequest stub equals another by factoring in checks for the name and modification items of the request.

Overrides:
equals in class AbstractRequest
Parameters:
obj - the object to compare this ModifyRequest to
Returns:
true if obj equals this ModifyRequest, false otherwise

toString

public String toString()
Get a String representation of a ModifyRequest

Overrides:
toString in class Object
Returns:
A ModifyRequest String


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