use of org.apache.directory.api.asn1.ber.tlv.LongDecoderException in project directory-ldap-api by apache.
the class StoreSearchRequestSizeLimit method action.
/**
* {@inheritDoc}
*/
public void action(LdapMessageContainer<SearchRequestDecorator> container) throws DecoderException {
SearchRequest searchRequest = container.getMessage().getDecorated();
TLV tlv = container.getCurrentTLV();
// The current TLV should be a integer
// We get it and store it in sizeLimit
BerValue value = tlv.getValue();
long sizeLimit = 0;
try {
sizeLimit = LongDecoder.parse(value, 0, Integer.MAX_VALUE);
} catch (LongDecoderException lde) {
String msg = I18n.err(I18n.ERR_04103, value.toString());
LOG.error(msg);
throw new DecoderException(msg, lde);
}
searchRequest.setSizeLimit(sizeLimit);
if (IS_DEBUG) {
LOG.debug("The sizeLimit value is set to {} objects", Long.valueOf(sizeLimit));
}
}
Aggregations