org.apache.directory.shared.ldap.codec.search
Class AttributeValueAssertionFilter

java.lang.Object
  extended by org.apache.directory.shared.asn1.AbstractAsn1Object
      extended by org.apache.directory.shared.ldap.codec.search.Filter
          extended by org.apache.directory.shared.ldap.codec.search.AttributeValueAssertionFilter
All Implemented Interfaces:
Asn1Object

public class AttributeValueAssertionFilter
extends Filter

Object to store the filter. A filter is seen as a tree with a root.

Version:
$Rev: 664290 $, $Date: 2008-06-07 08:28:06 +0200 (Sa, 07 Jun 2008) $,
Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
parent
 
Constructor Summary
AttributeValueAssertionFilter(int filterType)
          The constructor.
AttributeValueAssertionFilter(int tlvId, int filterType)
          The constructor.
 
Method Summary
 int computeLength()
          Compute the AttributeValueFilter length AttributeValueFilter : 0xA(3, 5, 6, 8) L1 | +--> 0x04 L2 attributeDesc +--> 0x04 L3 assertionValue L2 = Length(attributeDesc) L3 = Length(assertionValue) L1 = 1 + Length(L2) + L2 + 1 + Length(L3) + L3 Length(AttributeValueFilter) = Length(0xA?) + Length(L1) + 1 + Length(L2) + L2 + 1 + Length(L3) + L3
 java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
          Encode the AttributeValueAssertion Filters to a PDU.
 AttributeValueAssertion getAssertion()
          Get the assertion
 int getFilterType()
          Get the filter type
 void setAssertion(AttributeValueAssertion assertion)
          Set the assertion
 void setFilterType(int filterType)
          Set the filter type
 java.lang.String toString()
          Return a string compliant with RFC 2254 representing an item filter
 
Methods inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
addLength, 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

AttributeValueAssertionFilter

public AttributeValueAssertionFilter(int tlvId,
                                     int filterType)
The constructor.

Parameters:
filterType - The filter type

AttributeValueAssertionFilter

public AttributeValueAssertionFilter(int filterType)
The constructor.

Parameters:
filterType - The filter type
Method Detail

getAssertion

public AttributeValueAssertion getAssertion()
Get the assertion

Returns:
Returns the assertion.

setAssertion

public void setAssertion(AttributeValueAssertion assertion)
Set the assertion

Parameters:
assertion - The assertion to set.

getFilterType

public int getFilterType()
Get the filter type

Returns:
Returns the filterType.

setFilterType

public void setFilterType(int filterType)
Set the filter type

Parameters:
filterType - The filterType to set.

computeLength

public int computeLength()
Compute the AttributeValueFilter length AttributeValueFilter : 0xA(3, 5, 6, 8) L1 | +--> 0x04 L2 attributeDesc +--> 0x04 L3 assertionValue L2 = Length(attributeDesc) L3 = Length(assertionValue) L1 = 1 + Length(L2) + L2 + 1 + Length(L3) + L3 Length(AttributeValueFilter) = Length(0xA?) + Length(L1) + 1 + Length(L2) + L2 + 1 + Length(L3) + L3

Specified by:
computeLength in interface Asn1Object
Specified by:
computeLength in class AbstractAsn1Object
Returns:
The object's computed length

encode

public java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
                           throws EncoderException
Encode the AttributeValueAssertion Filters to a PDU. The following filters are to be encoded : - equality match - greater or equal - less or equal - approx match AttributeValueAssertion filters : 0xA[3, 5, 6, 8] LL 0x04 LL attributeDesc 0x04 LL assertionValue

Specified by:
encode in interface Asn1Object
Overrides:
encode in class AbstractAsn1Object
Parameters:
buffer - The buffer where to put the PDU
Returns:
The PDU.
Throws:
EncoderException - if the buffer can't be encoded

toString

public java.lang.String toString()
Return a string compliant with RFC 2254 representing an item filter

Overrides:
toString in class java.lang.Object
Returns:
The item filter string


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