/**
* {@inheritDoc}
*/
public void action( MethodDataContainer methodDataContainer ) throws DecoderException
{
TLV tlv = methodDataContainer.getCurrentTLV();
// The Length should not be null
if ( tlv.getLength() == 0 )
{
LOG.error( I18n.err( I18n.ERR_04066 ) );
// This will generate a PROTOCOL_ERROR
throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
}
// Now, let's decode the PA-DATA
Asn1Decoder paDataDecoder = new Asn1Decoder();
PaDataContainer paDataContainer = new PaDataContainer();
paDataContainer.setStream( methodDataContainer.getStream() );
// Compute the start position in the stream for the PA-DATA to decode :
// We have to move back to the PA-DATA tag
methodDataContainer.rewind();
// Decode the PA-DATA PDU
try
{
paDataDecoder.decode( methodDataContainer.getStream(), paDataContainer );
}
catch ( DecoderException de )
{
throw de;
}
// Update the expected length for the current TLV
tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
// Update the parent
methodDataContainer.updateParent();
// Store the PA-DATA in the container