use of org.apache.directory.api.ldap.codec.search.AttributeValueAssertionFilter in project directory-ldap-api by apache.
the class InitAssertionValueFilter method action.
/**
* {@inheritDoc}
*/
public void action(LdapMessageContainer<SearchRequestDecorator> container) throws DecoderException {
SearchRequestDecorator searchRequestDecorator = container.getMessage();
TLV tlv = container.getCurrentTLV();
// The value can be null.
byte[] assertion = tlv.getValue().getData();
AttributeValueAssertionFilter terminalFilter = (AttributeValueAssertionFilter) searchRequestDecorator.getTerminalFilter();
AttributeValueAssertion attributeValueAssertion = terminalFilter.getAssertion();
if (assertion == null) {
attributeValueAssertion.setAssertion(Strings.EMPTY_BYTES);
} else {
attributeValueAssertion.setAssertion(assertion);
}
// We now have to get back to the nearest filter which is
// not terminal.
searchRequestDecorator.unstackFilters(container);
if (IS_DEBUG) {
LOG.debug("Initialize Assertion Value filter");
}
}
use of org.apache.directory.api.ldap.codec.search.AttributeValueAssertionFilter in project directory-ldap-api by apache.
the class InitAttributeDescFilter method action.
/**
* {@inheritDoc}
*/
public void action(LdapMessageContainer<SearchRequestDecorator> container) throws DecoderException {
SearchRequestDecorator searchRequestDecorator = container.getMessage();
TLV tlv = container.getCurrentTLV();
AttributeValueAssertion assertion = new AttributeValueAssertion();
if (tlv.getLength() == 0) {
String msg = I18n.err(I18n.ERR_04007);
LOG.error(msg);
throw new DecoderException(msg);
} else {
String type = Strings.utf8ToString(tlv.getValue().getData());
assertion.setAttributeDesc(type);
AttributeValueAssertionFilter terminalFilter = (AttributeValueAssertionFilter) searchRequestDecorator.getTerminalFilter();
terminalFilter.setAssertion(assertion);
}
if (IS_DEBUG) {
LOG.debug("Initialize AttributeDesc filter");
}
}
use of org.apache.directory.api.ldap.codec.search.AttributeValueAssertionFilter 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");
}
}
use of org.apache.directory.api.ldap.codec.search.AttributeValueAssertionFilter 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");
}
}
use of org.apache.directory.api.ldap.codec.search.AttributeValueAssertionFilter 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");
}
}
Aggregations