public void action( SubentriesContainer container ) throws DecoderException { TLV tlv = container.getCurrentTLV(); // We get the value. If it's a 0, it's a FALSE. If it's // a FF, it's a TRUE. Any other value should be an error, // but we could relax this constraint. So if we have // something // which is not 0, it will be interpreted as TRUE, but we // will generate a warning. Value value = tlv.getValue(); try { container.getSubentriesControl().setVisibility( BooleanDecoder.parse( value ) ); // We can have an END transition container.setGrammarEndAllowed( true ); } catch ( BooleanDecoderException bde ) { LOG.error( I18n.err( I18n.ERR_04054, Strings.dumpBytes( value.getData()), bde.getMessage() ) ); // This will generate a PROTOCOL_ERROR throw new DecoderException( bde.getMessage() ); } } } );
.err( I18n.ERR_04110, Strings.dumpBytes(value.getData()), bde.getMessage() ) ); throw new DecoderException( bde.getMessage() );
public void action( LdapMessageContainer<SearchRequestDecorator> container ) throws DecoderException { SearchRequest searchRequest = container.getMessage().getDecorated(); TLV tlv = container.getCurrentTLV(); // We get the value. If it's a 0, it's a FALSE. If it's // a FF, it's a TRUE. Any other value should be an error, // but we could relax this constraint. So if we have // something // which is not 0, it will be interpreted as TRUE, but we // will generate a warning. Value value = tlv.getValue(); try { searchRequest.setTypesOnly( BooleanDecoder.parse( value ) ); } catch ( BooleanDecoderException bde ) { LOG.error( I18n .err( I18n.ERR_04105, Strings.dumpBytes(value.getData()), bde.getMessage() ) ); throw new DecoderException( bde.getMessage() ); } if ( IS_DEBUG ) { LOG.debug( "The search will return {}", ( searchRequest.getTypesOnly() ? "only attributs type" : "attributes types and values" ) ); } } } );
.err( I18n.ERR_04091, Strings.dumpBytes(value.getData()), bde.getMessage() ) ); throw new DecoderException( bde.getMessage() );
.err( I18n.ERR_04100, Strings.dumpBytes(value.getData()), bde.getMessage() ) ); throw new DecoderException( bde.getMessage() );