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

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.CompareRequestImpl
All Implemented Interfaces:
AbandonableRequest, CompareRequest, Message, Request, ResultResponseRequest<CompareResponse>, SingleReplyRequest<CompareResponse>

public class CompareRequestImpl
extends AbstractAbandonableRequest
implements CompareRequest

Comparison 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.CompareRequest
RESP_TYPE, TYPE
 
Constructor Summary
CompareRequestImpl()
          Creates an CompareRequest implementation to compare a named entry with an attribute value assertion pair.
 
Method Summary
 CompareRequest addAllControls(Control[] controls)
          Adds an array of controls to this Message.
 CompareRequest addControl(Control control)
          Adds a control to this Message.
 boolean equals(Object obj)
          Checks to see if an object is equivalent to this CompareRequest.
 Value<?> getAssertionValue()
          Gets the attribute value to use in making the comparison.
 String getAttributeId()
          Gets the attribute id use in making the comparison.
 Dn getName()
          Gets the distinguished name of the entry to be compared using the attribute value assertion.
 MessageTypeEnum getResponseType()
          Gets the protocol response message type for this request which produces at least one response.
 CompareResponse getResultResponse()
          The result containing response for this request.
 int hashCode()
          
 CompareRequest removeControl(Control control)
          Deletes a control removing it from this Message.
 CompareRequest setAssertionValue(byte[] value)
          Sets the attribute value to use in the comparison.
 CompareRequest setAssertionValue(String value)
          Sets the attribute value to use in the comparison.
 CompareRequest setAttributeId(String attributeId)
          Sets the attribute id used in the comparison.
 CompareRequest setMessageId(int messageId)
          Sets the Message ID for this request
 CompareRequest setName(Dn name)
          Sets the distinguished name of the entry to be compared using the attribute value assertion.
 String toString()
          Get a String representation of a Compare Request
 
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

CompareRequestImpl

public CompareRequestImpl()
Creates an CompareRequest implementation to compare a named entry with an attribute value assertion pair.

Method Detail

getName

public Dn getName()
Gets the distinguished name of the entry to be compared using the attribute value assertion.

Specified by:
getName in interface CompareRequest
Returns:
the Dn of the compared entry.

setName

public CompareRequest setName(Dn name)
Sets the distinguished name of the entry to be compared using the attribute value assertion.

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

getAssertionValue

public Value<?> getAssertionValue()
Gets the attribute value to use in making the comparison.

Specified by:
getAssertionValue in interface CompareRequest
Returns:
the attribute value to used in comparison.

setAssertionValue

public CompareRequest setAssertionValue(String value)
Sets the attribute value to use in the comparison.

Specified by:
setAssertionValue in interface CompareRequest
Parameters:
value - the attribute value used in comparison.
Returns:
The CompareRequest instance

setAssertionValue

public CompareRequest setAssertionValue(byte[] value)
Sets the attribute value to use in the comparison.

Specified by:
setAssertionValue in interface CompareRequest
Parameters:
value - the attribute value used in comparison.
Returns:
The CompareRequest instance

getAttributeId

public String getAttributeId()
Gets the attribute id use in making the comparison.

Specified by:
getAttributeId in interface CompareRequest
Returns:
the attribute id used in comparison.

setAttributeId

public CompareRequest setAttributeId(String attributeId)
Sets the attribute id used in the comparison.

Specified by:
setAttributeId in interface CompareRequest
Parameters:
attributeId - the attribute id used in comparison.
Returns:
The CompareRequest instance

setMessageId

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

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

addControl

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

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

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

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

getResultResponse

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

Specified by:
getResultResponse in interface ResultResponseRequest<CompareResponse>
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 CompareRequest.

Overrides:
equals in class AbstractRequest
Parameters:
obj - the obj to compare with this CompareRequest
Returns:
true if the obj is equal to this request, false otherwise

toString

public String toString()
Get a String representation of a Compare Request

Overrides:
toString in class Object
Returns:
A Compare Request String


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