public void action( LdapMessageContainer<MessageDecorator<? extends Message>> container ) throws DecoderException
{
TLV tlv = container.getCurrentTLV();
// Get the current control
Control control = null;
MessageDecorator<? extends Message> message = container.getMessage();
control = message.getCurrentControl();
// Store the criticality
// 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
{
control.setCritical( BooleanDecoder.parse( value ) );
}
catch ( BooleanDecoderException bde )
{
LOG.error( I18n
.err( I18n.ERR_04100, Strings.dumpBytes( value.getData() ), bde.getMessage() ) );
// This will generate a PROTOCOL_ERROR
throw new DecoderException( bde.getMessage() );
}
// We can have an END transition
container.setGrammarEndAllowed( true );
if ( IS_DEBUG )
{
LOG.debug( "Control criticality : " + control.isCritical() );
}
}