Delete License

Execution

The license can be deleted using the deleteLicense() method:

DeleteLicenseRequest request = new DeleteLicenseRequest();

AcknowledgedResponse response = client.license().deleteLicense(request, RequestOptions.DEFAULT);

Response

The returned DeleteLicenseResponse contains the acknowledged flag, which returns true if the request was processed by all nodes.

boolean acknowledged = response.isAcknowledged(); 

Check the acknowledge flag. It should be true if license deletion is acknowledged.

Asynchronous Execution

This request can be executed asynchronously:

client.license().deleteLicenseAsync(
    request, RequestOptions.DEFAULT, listener); 

The DeleteLicenseRequest to execute and the ActionListener to use when the execution completes

The asynchronous method does not block and returns immediately. Once it is completed the ActionListener is called back using the onResponse method if the execution successfully completed or using the onFailure method if it failed.

A typical listener for DeleteLicenseResponse looks like:

ActionListener<AcknowledgedResponse> listener = new ActionListener<AcknowledgedResponse>() {
    @Override
    public void onResponse(AcknowledgedResponse deleteLicenseResponse) {
        
    }

    @Override
    public void onFailure(Exception e) {
        
    }
};

Called when the execution is successfully completed. The response is provided as an argument

Called in case of failure. The raised exception is provided as an argument