title: 7.1 - AbandonRequest navPrev: 7-requests-responses.html navPrevText: 7 - Requests and Responses navUp: 7-requests-responses.html navUpText: 7 - Requests and Responses navNext: 7.2-add-request.html navNextText: 7.2 - AddRequest

7.1 AbandonRequest

This request is used to tell the server that a given request (sent previously) has been abandoned. The only required parameter is the ID field of a request you want to stop.

:::Java
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 that can used:

  • 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 to do. You just to inject the ID of the request you want to abandon:

:::Java
connection.abandon( messageId );

This will interrupt the request whose ID equals messageId.

Adding some controls

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

:::Java
AbandonRequest abandonRequest = new AbandonRequestImpl( messageId );

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

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

_