class LicenseResource extends AlpineResource {

    private static final Logger LOGGER = Logger.getLogger(LicenseResource.class);

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation(
            value = "Returns a list of all licenses with complete metadata for each license",
            response = License.class,
            responseContainer = "List",
            responseHeaders = @ResponseHeader(name = TOTAL_COUNT_HEADER, response = Long.class, description = "The total number of licenses")
    )
    @PaginatedApi
    @ApiResponses(value = {
            @ApiResponse(code = 401, message = "Unauthorized")
    })
    public Response getLicenses() {
        try (QueryManager qm = new QueryManager(getAlpineRequest())) {
            final PaginatedResult result = qm.getLicenses();
            return Response.ok(result.getObjects()).header(TOTAL_COUNT_HEADER, result.getTotal()).build();
        }
    }

    @GET
    @Path("/concise")
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation(
            value = "Returns a concise listing of all licenses",
            response = License.class,
            responseContainer = "List"
    )
    @ApiResponses(value = {
            @ApiResponse(code = 401, message = "Unauthorized")
    })
    public Response getLicenseListing() {
        try (QueryManager qm = new QueryManager(getAlpineRequest())) {
            final List<License> result = qm.getAllLicensesConcise();
            return Response.ok(result).build();
        }
    }

    @GET
    @Path("/{licenseId}")
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation(
            value = "Returns a specific license",
            response = License.class
    )
    @ApiResponses(value = {
            @ApiResponse(code = 401, message = "Unauthorized"),
            @ApiResponse(code = 404, message = "The license could not be found")
    })
    public Response getLicense(
            @ApiParam(value = "The SPDX License ID of the license to retrieve", required = true)
            @PathParam("licenseId") String licenseId) {
        try (QueryManager qm = new QueryManager()) {
            final License license = qm.getLicense(licenseId);
            if (license != null) {
                return Response.ok(license).build();
            } else {
                return Response.status(Response.Status.NOT_FOUND).entity("The license could not be found.").build();
            }
        }
    }

    @PUT
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation(
            value = "Creates a new custom license",
            response = License.class,
            notes = "<p>Requires permission <strong>SYSTEM_CONFIGURATION</strong></p>"
    )
    @ApiResponses(value = {
            @ApiResponse(code = 401, message = "Unauthorized"),
            @ApiResponse(code = 409, message = "A license with the specified ID already exists.")
    })
    @PermissionRequired(Permissions.Constants.SYSTEM_CONFIGURATION)
    public Response createLicense(License jsonLicense) {<FILL_FUNCTION_BODY>}

    @DELETE
    @Path("/{licenseId}")
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation(
            value = "Deletes a custom license",
            code = 204,
            notes = "<p>Requires permission <strong>SYSTEM_CONFIGURATION</strong></p>"
    )
    @ApiResponses(value = {
            @ApiResponse(code = 401, message = "Unauthorized"),
            @ApiResponse(code = 404, message = "The license could not be found"),
            @ApiResponse(code = 409, message = "Only custom licenses can be deleted.")
    })
    @PermissionRequired(Permissions.Constants.SYSTEM_CONFIGURATION)
    public Response deleteLicense(
            @ApiParam(value = "The SPDX License ID of the license to delete", required = true)
            @PathParam("licenseId") String licenseId) {
        try (QueryManager qm = new QueryManager()) {
            final License license = qm.getLicense(licenseId);
            if (license != null) {
                if (Boolean.TRUE.equals(license.isCustomLicense())) {
                    LOGGER.info("License " + license + " deletion request by " + super.getPrincipal().getName());
                    qm.deleteLicense(license, true);
                    return Response.status(Response.Status.NO_CONTENT).build();
                } else {
                    return Response.status(Response.Status.CONFLICT).entity("Only custom licenses can be deleted.").build();
                }
            } else {
                return Response.status(Response.Status.NOT_FOUND).entity("The license could not be found.").build();
            }
        }
    }

}

        final Validator validator = super.getValidator();
        failOnValidationError(
                validator.validateProperty(jsonLicense, "name"),
                validator.validateProperty(jsonLicense, "licenseId")
        );
        try (QueryManager qm = new QueryManager()) {
            License license = qm.getLicense(jsonLicense.getLicenseId());
            if (license == null){
                license = qm.createCustomLicense(jsonLicense, true);
                LOGGER.info("License " + license.getName() + " created by " + super.getPrincipal().getName());
                return Response.status(Response.Status.CREATED).entity(license).build();
            } else {
                return Response.status(Response.Status.CONFLICT).entity("A license with the specified name already exists.").build();
            }
        }
    
<no_super_class>