code: public void approveLicense(final String licenseId, final Boolean approve, final String user, final String password) throws GrapesCommunicationException, AuthenticationException{
          final Client client = getClient(user, password);
          final WebResource resource = client.resource(serverURL).path(RequestUtils.getLicensePath(licenseId));
          final ClientResponse response = resource.queryParam(ServerAPI.APPROVED_PARAM, approve.toString()).post(ClientResponse.class);
  
          client.destroy();
          if(ClientResponse.Status.OK.getStatusCode() != response.getStatus()){
              final String message = "Failed to approve license " + licenseId;
              if(LOG.isErrorEnabled()) {
                  LOG.error(String.format(HTTP_STATUS_TEMPLATE_MSG, message, response.getStatus()));
              }
              throw new GrapesCommunicationException(message, response.getStatus());
          }
      }
docs: Approve or reject a license
  
  @param licenseId
  @param approve
  @throws GrapesCommunicationException
  @throws javax.naming.AuthenticationException