7.1 AbandonRequest

This request is used to tell the server that a given previous request must be abandonned. The only needed parameter is the ID of the request you want to stop.

public interface AbandonRequest extends Request
{
    /**
     * Gets the id of the request operation to terminate.
     * 
     * @return the id of the request message to abandon
     */
    int getAbandoned();


    /**
     * Sets the id of the request operation to terminate.
     * 
     * @param requestId the sequence id of the request message to abandon
     * @return The AbandonRequest instance
     */
    AbandonRequest setAbandoned( int requestId );
}

There are two existing implementations you can use :

  • AbandonRequestImpl : The default implementation.
  • AbandonRequestDsml : An implementation used when you want to generate a DSML request

The AbandonRequest message does not have a response, the abandonned request will just be stopped.

Usage

It's pretty easy. You just have inject the ID of the request you want to abandon :

connection.abandon( messageId );

This will interrupt the request which ID is messageId.

Adding some controls

You can add a control in the AbandonRequest, as soon as you create an instance of _AbandonRequestImpl :

AbandonRequest abandonRequest = new AbandonRequestImpl( messageId );

// Add your control 
abandonRequest.addControl( control );

// Send the request
connection.abandon( abandonRequest );

_