org.apache.directory.api.dsmlv2.request
Class CompareRequestDsml

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<CompareRequest,CompareResponse>
              extended by org.apache.directory.api.dsmlv2.request.CompareRequestDsml
All Implemented Interfaces:
DsmlDecorator<CompareRequest>, AbandonableRequest, CompareRequest, Message, Request, ResultResponseRequest<CompareResponse>, SingleReplyRequest<CompareResponse>

public class CompareRequestDsml
extends AbstractResultResponseRequestDsml<CompareRequest,CompareResponse>
implements CompareRequest

DSML Decorator for CompareRequest

Author:
Apache Directory Project

Field Summary
 
Fields inherited from interface org.apache.directory.api.ldap.model.message.CompareRequest
RESP_TYPE, TYPE
 
Constructor Summary
CompareRequestDsml(LdapApiService codec)
          Creates a new getDecoratedMessage() of CompareRequestDsml.
CompareRequestDsml(LdapApiService codec, CompareRequest ldapMessage)
          Creates a new getDecoratedMessage() of CompareRequestDsml.
 
Method Summary
 CompareRequest addAllControls(Control[] controls)
          Adds an array of controls to this Message.
 CompareRequest addControl(Control control)
          Adds a control to this Message.
 Value<?> getAssertionValue()
          Gets the attribute value to use in making the comparison.
 String getAttributeDesc()
          Get the attribute description
 String getAttributeId()
          Gets the attribute id use in making the comparison.
 Dn getName()
          Get the entry to be compared
 MessageTypeEnum getResponseType()
          Gets the protocol response message type for this request which produces at least one response.
 MessageTypeEnum getType()
          Gets the LDAP message type code associated with this Message.
 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.
 void setAssertionValue(Object assertionValue)
          Set the assertion value
 CompareRequest setAssertionValue(String value)
          Sets the attribute value to use in the comparison.
 void setAttributeDesc(String attributeDesc)
          Set the attribute description
 CompareRequest setAttributeId(String attrId)
          Sets the attribute id used in the comparison.
 CompareRequest setMessageId(int messageId)
          Sets the Message ID for this request
 CompareRequest setName(Dn entry)
          Set the entry to be compared
 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.AbstractResultResponseRequestDsml
abandon, addAbandonListener, computeLength, encode, getResultResponse, isAbandoned
 
Methods inherited from class org.apache.directory.api.dsmlv2.request.AbstractRequestDsml
hasResponse
 
Methods inherited from class org.apache.directory.api.dsmlv2.AbstractDsmlMessageDecorator
get, getCodecService, getControl, getControls, getCurrentControl, getDecorated, getMessageId, hasControl, put
 
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.ResultResponseRequest
getResultResponse
 
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, hasControl, put
 
Methods inherited from interface org.apache.directory.api.ldap.model.message.AbandonableRequest
abandon, addAbandonListener, isAbandoned
 

Constructor Detail

CompareRequestDsml

public CompareRequestDsml(LdapApiService codec)
Creates a new getDecoratedMessage() of CompareRequestDsml.


CompareRequestDsml

public CompareRequestDsml(LdapApiService codec,
                          CompareRequest ldapMessage)
Creates a new getDecoratedMessage() of CompareRequestDsml.

Parameters:
ldapMessage - the message to decorate
Method Detail

getType

public MessageTypeEnum getType()
Gets the LDAP message type code associated with this Message. Each request and response type has a unique message type code defined by the protocol in RFC 2251.

Specified by:
getType in interface Message
Overrides:
getType in class AbstractDsmlMessageDecorator<CompareRequest>
Returns:
the message type code.

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<CompareRequest>
Overrides:
toDsml in class AbstractResultResponseRequestDsml<CompareRequest,CompareResponse>
Parameters:
root - the root element
Returns:
the Request Element of the given name containing

getName

public Dn getName()
Get the entry to be compared

Specified by:
getName in interface CompareRequest
Returns:
Returns the entry.

setName

public CompareRequest setName(Dn entry)
Set the entry to be compared

Specified by:
setName in interface CompareRequest
Parameters:
entry - The entry to set.
Returns:
The CompareRequest instance

setAssertionValue

public void setAssertionValue(Object assertionValue)
Set the assertion value

Parameters:
assertionValue - The assertionValue to set.

getAttributeDesc

public String getAttributeDesc()
Get the attribute description

Returns:
Returns the attributeDesc.

setAttributeDesc

public void setAttributeDesc(String attributeDesc)
Set the attribute description

Parameters:
attributeDesc - The attributeDesc to set.

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.

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 attrId)
Sets the attribute id used in the comparison.

Specified by:
setAttributeId in interface CompareRequest
Parameters:
attrId - the attribute id used in comparison.
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.

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 AbstractDsmlMessageDecorator<CompareRequest>
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 AbstractDsmlMessageDecorator<CompareRequest>
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 AbstractDsmlMessageDecorator<CompareRequest>
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 AbstractDsmlMessageDecorator<CompareRequest>
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.


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