use of org.apache.directory.api.ldap.codec.search.Filter in project directory-ldap-api by apache.
the class InitSubstringsFilter method action.
/**
* {@inheritDoc}
*/
public void action(LdapMessageContainer<SearchRequestDecorator> container) throws DecoderException {
SearchRequestDecorator searchRequestDecorator = container.getMessage();
TLV tlv = container.getCurrentTLV();
int expectedLength = tlv.getLength();
if (expectedLength == 0) {
String msg = I18n.err(I18n.ERR_04012);
LOG.error(msg);
throw new DecoderException(msg);
}
// We can allocate the SearchRequest
Filter substringFilter = new SubstringFilter(container.getTlvId());
searchRequestDecorator.addCurrentFilter(substringFilter);
searchRequestDecorator.setTerminalFilter(substringFilter);
if (IS_DEBUG) {
LOG.debug("Initialize Substrings filter");
}
}
use of org.apache.directory.api.ldap.codec.search.Filter in project directory-ldap-api by apache.
the class InitApproxMatchFilter method action.
/**
* {@inheritDoc}
*/
public void action(LdapMessageContainer<SearchRequestDecorator> container) throws DecoderException {
SearchRequestDecorator searchRequestDecorator = container.getMessage();
// We can allocate the Attribute Value Assertion
Filter filter = new AttributeValueAssertionFilter(container.getTlvId(), LdapCodecConstants.APPROX_MATCH_FILTER);
searchRequestDecorator.addCurrentFilter(filter);
// Store the filter structure that still has to be
// fulfilled
searchRequestDecorator.setTerminalFilter(filter);
if (IS_DEBUG) {
LOG.debug("Initialize Approx Match filter");
}
}
Aggregations