Search in sources :

Example 1 with Filter

use of org.apache.directory.api.ldap.codec.search.Filter in project directory-ldap-api by apache.

the class InitAndFilter method action.

/**
 * {@inheritDoc}
 */
public void action(LdapMessageContainer<SearchRequestDecorator> container) throws DecoderException {
    TLV tlv = container.getCurrentTLV();
    if (tlv.getLength() == 0) {
        String msg = I18n.err(I18n.ERR_04006);
        LOG.error(msg);
        throw new DecoderException(msg);
    }
    SearchRequestDecorator searchRequestDecorator = container.getMessage();
    // We can allocate the SearchRequest
    Filter andFilter = new AndFilter(container.getTlvId());
    // Set the filter
    searchRequestDecorator.addCurrentFilter(andFilter);
    if (IS_DEBUG) {
        LOG.debug("Initialize AND filter");
    }
}
Also used : DecoderException(org.apache.directory.api.asn1.DecoderException) AndFilter(org.apache.directory.api.ldap.codec.search.AndFilter) Filter(org.apache.directory.api.ldap.codec.search.Filter) AndFilter(org.apache.directory.api.ldap.codec.search.AndFilter) SearchRequestDecorator(org.apache.directory.api.ldap.codec.decorators.SearchRequestDecorator) TLV(org.apache.directory.api.asn1.ber.tlv.TLV)

Example 2 with Filter

use of org.apache.directory.api.ldap.codec.search.Filter in project directory-ldap-api by apache.

the class InitEqualityMatchFilter 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.EQUALITY_MATCH_FILTER);
    searchRequestDecorator.addCurrentFilter(filter);
    // Store the filter structure that still has to be
    // fulfilled
    searchRequestDecorator.setTerminalFilter(filter);
    if (IS_DEBUG) {
        LOG.debug("Initialize Equality Match filter");
    }
}
Also used : AttributeValueAssertionFilter(org.apache.directory.api.ldap.codec.search.AttributeValueAssertionFilter) Filter(org.apache.directory.api.ldap.codec.search.Filter) AttributeValueAssertionFilter(org.apache.directory.api.ldap.codec.search.AttributeValueAssertionFilter) SearchRequestDecorator(org.apache.directory.api.ldap.codec.decorators.SearchRequestDecorator)

Example 3 with Filter

use of org.apache.directory.api.ldap.codec.search.Filter in project directory-ldap-api by apache.

the class InitExtensibleMatchFilter method action.

/**
 * {@inheritDoc}
 */
public void action(LdapMessageContainer<SearchRequestDecorator> container) throws DecoderException {
    SearchRequestDecorator searchRequestDecorator = container.getMessage();
    // We can allocate the ExtensibleMatch Filter
    Filter extensibleMatchFilter = new ExtensibleMatchFilter(container.getTlvId());
    searchRequestDecorator.addCurrentFilter(extensibleMatchFilter);
    searchRequestDecorator.setTerminalFilter(extensibleMatchFilter);
    if (IS_DEBUG) {
        LOG.debug("Initialize Extensible Match filter");
    }
}
Also used : ExtensibleMatchFilter(org.apache.directory.api.ldap.codec.search.ExtensibleMatchFilter) Filter(org.apache.directory.api.ldap.codec.search.Filter) ExtensibleMatchFilter(org.apache.directory.api.ldap.codec.search.ExtensibleMatchFilter) SearchRequestDecorator(org.apache.directory.api.ldap.codec.decorators.SearchRequestDecorator)

Example 4 with Filter

use of org.apache.directory.api.ldap.codec.search.Filter in project directory-ldap-api by apache.

the class InitGreaterOrEqualFilter 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.GREATER_OR_EQUAL_FILTER);
    searchRequestDecorator.addCurrentFilter(filter);
    // Store the filter structure that still has to be
    // fulfilled
    searchRequestDecorator.setTerminalFilter(filter);
    if (IS_DEBUG) {
        LOG.debug("Initialize Greater Or Equal filter");
    }
}
Also used : AttributeValueAssertionFilter(org.apache.directory.api.ldap.codec.search.AttributeValueAssertionFilter) Filter(org.apache.directory.api.ldap.codec.search.Filter) AttributeValueAssertionFilter(org.apache.directory.api.ldap.codec.search.AttributeValueAssertionFilter) SearchRequestDecorator(org.apache.directory.api.ldap.codec.decorators.SearchRequestDecorator)

Example 5 with Filter

use of org.apache.directory.api.ldap.codec.search.Filter in project directory-ldap-api by apache.

the class InitLessOrEqualFilter 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.LESS_OR_EQUAL_FILTER);
    searchRequestDecorator.addCurrentFilter(filter);
    // Store the filter structure that still has to be
    // fulfilled
    searchRequestDecorator.setTerminalFilter(filter);
    if (IS_DEBUG) {
        LOG.debug("Initialize Less Or Equal filter");
    }
}
Also used : AttributeValueAssertionFilter(org.apache.directory.api.ldap.codec.search.AttributeValueAssertionFilter) Filter(org.apache.directory.api.ldap.codec.search.Filter) AttributeValueAssertionFilter(org.apache.directory.api.ldap.codec.search.AttributeValueAssertionFilter) SearchRequestDecorator(org.apache.directory.api.ldap.codec.decorators.SearchRequestDecorator)

Aggregations

Filter (org.apache.directory.api.ldap.codec.search.Filter)12 SearchRequestDecorator (org.apache.directory.api.ldap.codec.decorators.SearchRequestDecorator)9 AttributeValueAssertionFilter (org.apache.directory.api.ldap.codec.search.AttributeValueAssertionFilter)7 DecoderException (org.apache.directory.api.asn1.DecoderException)5 TLV (org.apache.directory.api.asn1.ber.tlv.TLV)5 AndFilter (org.apache.directory.api.ldap.codec.search.AndFilter)4 ExtensibleMatchFilter (org.apache.directory.api.ldap.codec.search.ExtensibleMatchFilter)4 NotFilter (org.apache.directory.api.ldap.codec.search.NotFilter)4 OrFilter (org.apache.directory.api.ldap.codec.search.OrFilter)4 SubstringFilter (org.apache.directory.api.ldap.codec.search.SubstringFilter)4 ConnectorFilter (org.apache.directory.api.ldap.codec.search.ConnectorFilter)3 PresentFilter (org.apache.directory.api.ldap.codec.search.PresentFilter)3 BerValue (org.apache.directory.api.asn1.ber.tlv.BerValue)2 AttributeValueAssertion (org.apache.directory.api.ldap.codec.AttributeValueAssertion)2 Value (org.apache.directory.api.ldap.model.entry.Value)2 AndNode (org.apache.directory.api.ldap.model.filter.AndNode)2 ApproximateNode (org.apache.directory.api.ldap.model.filter.ApproximateNode)2 BranchNode (org.apache.directory.api.ldap.model.filter.BranchNode)2 EqualityNode (org.apache.directory.api.ldap.model.filter.EqualityNode)2 ExtensibleNode (org.apache.directory.api.ldap.model.filter.ExtensibleNode)2