Class License3Resource

java.lang.Object
org.ctan.site.resources.catalogue.License3Resource

@Path("/3.0") @Produces({"application/json","application/xml"}) public class License3Resource extends Object
The class License3Resource contains the controller for the license resource.
  • Constructor Details

    • License3Resource

      public License3Resource(@NonNull @NonNull LicenseStore store, @NonNull @NonNull ContentService contentService)
      This is the constructor for the class Pkg3Resource.
      Parameters:
      store - the underlying store
      contentService - the underlying content service
  • Method Details

    • getAllLicenses

      @GET @Path("/licenses") @PermitAll @UnitOfWork("siteDb") public List<License3Resource.LicenseTo> getAllLicenses()
      The method getAllLicenses provides means to retrieve a list of all licenses.
      Returns:
      a list of matching license summaries
    • getLicenseByKey

      @GET @Path("/license/{key}") @PermitAll @UnitOfWork("siteDb") public License3Resource.LicenseTo getLicenseByKey(@NonNull @PathParam("key") @NonNull String key, @QueryParam("lang") String lang)
      The method getLicenseByKey contains the endpoint for /license/key. It returns the license object.
      Parameters:
      key - the key
      lang - the locale
      Returns:
      the license object
    • getLicenses

      @GET @Path("/licenses/{pattern}") @PermitAll @UnitOfWork("siteDb") public List<License3Resource.LicenseTo> getLicenses(@PathParam("pattern") String pattern)
      The method getLicenses provides means to retrieve a list of licenses starting with a given pattern.
      Parameters:
      pattern - the initial string of the key
      Returns:
      a list of matching license summaries