Search in sources :

Example 6 with ExtensibleMatchFilter

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

the class StoreTypeMatchingRule method action.

/**
 * {@inheritDoc}
 */
public void action(LdapMessageContainer<SearchRequestDecorator> container) throws DecoderException {
    SearchRequestDecorator searchRequest = container.getMessage();
    TLV tlv = container.getCurrentTLV();
    if (tlv.getLength() == 0) {
        String msg = I18n.err(I18n.ERR_04022);
        LOG.error(msg);
        throw new DecoderException(msg);
    } else {
        // Store the value.
        ExtensibleMatchFilter extensibleMatchFilter = (ExtensibleMatchFilter) searchRequest.getTerminalFilter();
        String type = Strings.utf8ToString(tlv.getValue().getData());
        extensibleMatchFilter.setType(type);
        if (IS_DEBUG) {
            LOG.debug("Stored a type matching rule : {}", type);
        }
    }
}
Also used : DecoderException(org.apache.directory.api.asn1.DecoderException) ExtensibleMatchFilter(org.apache.directory.api.ldap.codec.search.ExtensibleMatchFilter) SearchRequestDecorator(org.apache.directory.api.ldap.codec.decorators.SearchRequestDecorator) TLV(org.apache.directory.api.asn1.ber.tlv.TLV)

Aggregations

ExtensibleMatchFilter (org.apache.directory.api.ldap.codec.search.ExtensibleMatchFilter)6 SearchRequestDecorator (org.apache.directory.api.ldap.codec.decorators.SearchRequestDecorator)4 DecoderException (org.apache.directory.api.asn1.DecoderException)3 BerValue (org.apache.directory.api.asn1.ber.tlv.BerValue)3 TLV (org.apache.directory.api.asn1.ber.tlv.TLV)3 Filter (org.apache.directory.api.ldap.codec.search.Filter)3 Value (org.apache.directory.api.ldap.model.entry.Value)3 AttributeValueAssertion (org.apache.directory.api.ldap.codec.AttributeValueAssertion)2 AndFilter (org.apache.directory.api.ldap.codec.search.AndFilter)2 AttributeValueAssertionFilter (org.apache.directory.api.ldap.codec.search.AttributeValueAssertionFilter)2 ConnectorFilter (org.apache.directory.api.ldap.codec.search.ConnectorFilter)2 NotFilter (org.apache.directory.api.ldap.codec.search.NotFilter)2 OrFilter (org.apache.directory.api.ldap.codec.search.OrFilter)2 PresentFilter (org.apache.directory.api.ldap.codec.search.PresentFilter)2 SubstringFilter (org.apache.directory.api.ldap.codec.search.SubstringFilter)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