org.apache.directory.shared.ldap.codec.compare
Class CompareRequestCodec

java.lang.Object
  extended by org.apache.directory.shared.asn1.AbstractAsn1Object
      extended by org.apache.directory.shared.ldap.codec.LdapMessageCodec
          extended by org.apache.directory.shared.ldap.codec.compare.CompareRequestCodec
All Implemented Interfaces:
Asn1Object

public class CompareRequestCodec
extends LdapMessageCodec

A CompareRequest Message. Its syntax is : CompareRequest ::= [APPLICATION 14] SEQUENCE { entry LDAPDN, ava AttributeValueAssertion } AttributeValueAssertion ::= SEQUENCE { attributeDesc AttributeDescription, assertionValue AssertionValue } AttributeDescription ::= LDAPString AssertionValue ::= OCTET STRING

Version:
$Rev: 918756 $, $Date: 2010-03-04 00:05:29 +0100 (Thu, 04 Mar 2010) $,
Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.ldap.codec.LdapMessageCodec
ldapMessageLength
 
Fields inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
parent
 
Constructor Summary
CompareRequestCodec()
          Creates a new CompareRequest object.
 
Method Summary
protected  int computeLengthProtocolOp()
          Compute the CompareRequest length CompareRequest : 0x6E L1 | +--> 0x04 L2 entry +--> 0x30 L3 (ava) | +--> 0x04 L4 attributeDesc +--> 0x04 L5 assertionValue L3 = Length(0x04) + Length(L4) + L4 + Length(0x04) + Length(L5) + L5 Length(CompareRequest) = Length(0x6E) + Length(L1) + L1 + Length(0x04) + Length(L2) + L2 + Length(0x30) + Length(L3) + L3
protected  void encodeProtocolOp(java.nio.ByteBuffer buffer)
          Encode the CompareRequest message to a PDU.
 java.lang.Object getAssertionValue()
          Get the assertion value
 java.lang.String getAttributeDesc()
          Get the attribute description
 DN getEntry()
          Get the entry to be compared
 MessageTypeEnum getMessageType()
          Get the message type
 java.lang.String getMessageTypeName()
          Get the message type Name
 void setAssertionValue(java.lang.Object assertionValue)
          Set the assertion value
 void setAttributeDesc(java.lang.String attributeDesc)
          Set the attribute description
 void setEntry(DN entry)
          Set the entry to be compared
 java.lang.String toString()
          Get a String representation of a Compare Request
 
Methods inherited from class org.apache.directory.shared.ldap.codec.LdapMessageCodec
addControl, addControls, computeLength, encode, getCodecControl, getControls, getControls, getCurrentControl, getMessageId, initControls, setMessageId, toString
 
Methods inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
addLength, encode, getCurrentLength, getExpectedLength, getParent, getTlvId, setCurrentLength, setExpectedLength, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompareRequestCodec

public CompareRequestCodec()
Creates a new CompareRequest object.

Method Detail

getMessageType

public MessageTypeEnum getMessageType()
Get the message type

Specified by:
getMessageType in class LdapMessageCodec
Returns:
Returns the type.

getMessageTypeName

public java.lang.String getMessageTypeName()
Get the message type Name

Specified by:
getMessageTypeName in class LdapMessageCodec
Returns:
The message type name

getEntry

public DN getEntry()
Get the entry to be compared

Returns:
Returns the entry.

setEntry

public void setEntry(DN entry)
Set the entry to be compared

Parameters:
entry - The entry to set.

getAssertionValue

public java.lang.Object getAssertionValue()
Get the assertion value

Returns:
Returns the assertionValue.

setAssertionValue

public void setAssertionValue(java.lang.Object assertionValue)
Set the assertion value

Parameters:
assertionValue - The assertionValue to set.

getAttributeDesc

public java.lang.String getAttributeDesc()
Get the attribute description

Returns:
Returns the attributeDesc.

setAttributeDesc

public void setAttributeDesc(java.lang.String attributeDesc)
Set the attribute description

Parameters:
attributeDesc - The attributeDesc to set.

computeLengthProtocolOp

protected int computeLengthProtocolOp()
Compute the CompareRequest length CompareRequest : 0x6E L1 | +--> 0x04 L2 entry +--> 0x30 L3 (ava) | +--> 0x04 L4 attributeDesc +--> 0x04 L5 assertionValue L3 = Length(0x04) + Length(L4) + L4 + Length(0x04) + Length(L5) + L5 Length(CompareRequest) = Length(0x6E) + Length(L1) + L1 + Length(0x04) + Length(L2) + L2 + Length(0x30) + Length(L3) + L3

Specified by:
computeLengthProtocolOp in class LdapMessageCodec
Returns:
The CompareRequest PDU's length

encodeProtocolOp

protected void encodeProtocolOp(java.nio.ByteBuffer buffer)
                         throws EncoderException
Encode the CompareRequest message to a PDU. CompareRequest : 0x6E LL 0x04 LL entry 0x30 LL attributeValueAssertion 0x04 LL attributeDesc 0x04 LL assertionValue

Specified by:
encodeProtocolOp in class LdapMessageCodec
Parameters:
buffer - The buffer where to put the PDU
Throws:
EncoderException

toString

public java.lang.String toString()
Get a String representation of a Compare Request

Overrides:
toString in class java.lang.Object
Returns:
A Compare Request String


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.