* {@inheritDoc}
*/
public void action( LdapMessageContainer<IntermediateResponseDecorator> container ) throws DecoderException
{
// We can get the IntermediateResponse Object
IntermediateResponse intermediateResponse = container.getMessage();
// Get the Value and store it in the IntermediateResponse
TLV tlv = container.getCurrentTLV();
// We have to handle the special case of a 0 length matched
// OID.
if ( tlv.getLength() == 0 )
{
String msg = I18n.err( I18n.ERR_04095 );
LOG.error( msg );
// This will generate a PROTOCOL_ERROR
throw new DecoderException( msg );
}
else
{
byte[] responseNameBytes = tlv.getValue().getData();
String oidStr = Strings.utf8ToString( responseNameBytes );
if ( Oid.isOid( oidStr ) )
{
Oid.isOid( oidStr );
intermediateResponse.setResponseName( oidStr );
}
else
{
String msg = "The Intermediate Response name is not a valid OID : "
+ Strings.utf8ToString( responseNameBytes ) + " ("
+ Strings.dumpBytes( responseNameBytes ) + ") is invalid";
LOG.error( "{} : {}", msg, oidStr );
// Rethrow the exception, we will get a PROTOCOL_ERROR
throw new DecoderException( msg );
}
}
// We can have an END transition
container.setGrammarEndAllowed( true );
if ( IS_DEBUG )
{
LOG.debug( "OID read : {}", intermediateResponse.getResponseName() );
}
}