/**
* {@inheritDoc}
*/
public void action( LdapMessageContainer<AddRequestDecorator> container )
{
AddRequestDecorator addRequest = container.getMessage();
TLV tlv = container.getCurrentTLV();
// Store the value. It can't be null
Object value = null;
if ( tlv.getLength() == 0 )
{
addRequest.addAttributeValue( "" );
}
else
{
if ( container.isBinary( addRequest.getCurrentAttributeType() ) )
{
value = tlv.getValue().getData();
if ( IS_DEBUG )
{
LOG.debug( "Adding value {}", Strings.dumpBytes((byte[]) value) );
}
addRequest.addAttributeValue( ( byte[] ) value );
}
else
{
value = Strings.utf8ToString(tlv.getValue().getData());
if ( IS_DEBUG )
{
LOG.debug( "Adding value {}" + value );
}
addRequest.addAttributeValue( ( String ) value );
}
}
// We can have an END transition