Get Licenseedit

Executionedit

The license can be added or updated using the getLicense() method:

GetLicenseRequest request = new GetLicenseRequest();

GetLicenseResponse response = client.license().getLicense(request, RequestOptions.DEFAULT);

Responseedit

The returned GetLicenseResponse contains the license in the JSON format.

String currentLicense = response.getLicenseDefinition(); 

The text of the license.

Asynchronous Executionedit

This request can be executed asynchronously:

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

The GetLicenseRequest 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 GetLicenseResponse looks like:

ActionListener<GetLicenseResponse> listener = new ActionListener<GetLicenseResponse>() {
    @Override
    public void onResponse(GetLicenseResponse indexResponse) {
        
    }

    @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