LOG.error( msg );
throw new DecoderException( msg );
}
else
{
StoredProcedureParameter parameter = new StoredProcedureParameter();
byte[] parameterType = tlv.getValue().getData();
parameter.setType( parameterType );
// We store the type in the current parameter.
storedProcedure.setCurrentParameter( parameter );
if ( LOG.isDebugEnabled() )
{
LOG.debug( "Parameter type found : " + Strings.dumpBytes(parameterType) );
}
}
}
} );
// Parameter ::= {
// ...
// value OCTETSTRING (Tag)
// }
// Store the parameter value
super.transitions[StoredProcedureStatesEnum.PARAMETER_TYPE_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] =
new GrammarTransition<StoredProcedureContainer>( StoredProcedureStatesEnum.PARAMETER_TYPE_STATE,
StoredProcedureStatesEnum.PARAMETER_VALUE_STATE,
UniversalTag.OCTET_STRING.getValue(),
new GrammarAction<StoredProcedureContainer>( "Store parameter value" )
{
public void action( StoredProcedureContainer container ) throws DecoderException
{
StoredProcedureContainer storedProcedureContainer = ( StoredProcedureContainer ) container;
TLV tlv = storedProcedureContainer.getCurrentTLV();
StoredProcedureRequestDecorator storedProcedure = storedProcedureContainer.getStoredProcedure();
// Store the value.
if ( tlv.getLength() == 0 )
{
// We can't have a void parameter value !
String msg = I18n.err( I18n.ERR_04041 );
LOG.error( msg );
throw new DecoderException( msg );
}
else
{
byte[] parameterValue = tlv.getValue().getData();
if ( parameterValue.length != 0 )
{
StoredProcedureParameter parameter = storedProcedure.getCurrentParameter();
parameter.setValue( parameterValue );
// We can now add a new Parameter to the procedure
storedProcedure.addParameter( parameter );
if ( LOG.isDebugEnabled() )