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

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.SubstringFilter
All Implemented Interfaces:
Asn1Object

public class SubstringFilter
extends Filter

A Object that stores the substring filter. A substring filter follow this grammar : substring = attr "=" ( ([initial] any [final] | (initial [any] [final) | ([initial] [any] final) ) initial = value any = "*" *(value "*") final = value

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
SubstringFilter()
          The constructor.
SubstringFilter(int tlvId)
          The constructor.
 
Method Summary
 void addAnySubstrings(java.lang.String any)
          Add a internal substring
 int computeLength()
          Compute the SubstringFilter length SubstringFilter : 0xA4 L1 | +--> 0x04 L2 type +--> 0x30 L3 | [+--> 0x80 L4 initial] [+--> 0x81 L5-1 any] [+--> 0x81 L5-2 any] [+--> ...
 java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
          Encode the Substrings Filter to a PDU.
 java.util.List<java.lang.String> getAnySubstrings()
          Get the internal substrings
 java.lang.String getFinalSubstrings()
          Get the final substring
 java.lang.String getInitialSubstrings()
          Get the initial substring
 int getSubstringsLength()
           
 java.lang.String getType()
          Get the attribute
 void setFinalSubstrings(java.lang.String finalSubstrings)
          Set the final substring
 void setInitialSubstrings(java.lang.String initialSubstrings)
          Set the initial substring
 void setSubstringsLength(int substringsLength)
           
 void setType(java.lang.String type)
          Set the attribute to match
 java.lang.String toString()
          Return a string compliant with RFC 2254 representing a Substring 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

SubstringFilter

public SubstringFilter(int tlvId)
The constructor. We will create the 'any' subsring arraylist with only one element.


SubstringFilter

public SubstringFilter()
The constructor. We will create the 'any' subsring arraylist with only one element.

Method Detail

getAnySubstrings

public java.util.List<java.lang.String> getAnySubstrings()
Get the internal substrings

Returns:
Returns the anySubstrings.

addAnySubstrings

public void addAnySubstrings(java.lang.String any)
Add a internal substring

Parameters:
any - The anySubstrings to set.

getFinalSubstrings

public java.lang.String getFinalSubstrings()
Get the final substring

Returns:
Returns the finalSubstrings.

setFinalSubstrings

public void setFinalSubstrings(java.lang.String finalSubstrings)
Set the final substring

Parameters:
finalSubstrings - The finalSubstrings to set.

getInitialSubstrings

public java.lang.String getInitialSubstrings()
Get the initial substring

Returns:
Returns the initialSubstrings.

setInitialSubstrings

public void setInitialSubstrings(java.lang.String initialSubstrings)
Set the initial substring

Parameters:
initialSubstrings - The initialSubstrings to set.

getType

public java.lang.String getType()
Get the attribute

Returns:
Returns the type.

setType

public void setType(java.lang.String type)
Set the attribute to match

Parameters:
type - The type to set.

getSubstringsLength

public int getSubstringsLength()
Returns:
Returns the substringsLength.

setSubstringsLength

public void setSubstringsLength(int substringsLength)
Parameters:
substringsLength - The substringsLength to set.

computeLength

public int computeLength()
Compute the SubstringFilter length SubstringFilter : 0xA4 L1 | +--> 0x04 L2 type +--> 0x30 L3 | [+--> 0x80 L4 initial] [+--> 0x81 L5-1 any] [+--> 0x81 L5-2 any] [+--> ... [+--> 0x81 L5-i any] [+--> ... [+--> 0x81 L5-n any] [+--> 0x82 L6 final]

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 Substrings Filter to a PDU. Substrings Filter : 0xA4 LL 0x30 LL substringsFilter 0x04 LL type 0x30 LL substrings sequence | 0x80 LL initial | / [0x81 LL any]* |/ [0x82 LL final] +--[0x81 LL any]+ \ [0x82 LL final] \ 0x82 LL final

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 a Substring filter

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


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