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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
The classLicenseTo
contains the transport object for the license resource in the licenses list. -
Constructor Summary
ConstructorsConstructorDescriptionLicense3Resource
(@NonNull LicenseStore store, @NonNull ContentService contentService) This is the constructor for the classPkg3Resource
. -
Method Summary
Modifier and TypeMethodDescriptionThe methodgetAllLicenses
provides means to retrieve a list of all licenses.getLicenseByKey
(@NonNull String key, String lang) The methodgetLicenseByKey
contains the endpoint for /license/key.getLicenses
(String pattern) The methodgetLicenses
provides means to retrieve a list of licenses starting with a given pattern.
-
Constructor Details
-
License3Resource
public License3Resource(@NonNull @NonNull LicenseStore store, @NonNull @NonNull ContentService contentService) This is the constructor for the classPkg3Resource
.- Parameters:
store
- the underlying storecontentService
- the underlying content service
-
-
Method Details
-
getAllLicenses
@GET @Path("/licenses") @PermitAll @UnitOfWork("siteDb") public List<License3Resource.LicenseTo> getAllLicenses()The methodgetAllLicenses
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 methodgetLicenseByKey
contains the endpoint for /license/key. It returns the license object.- Parameters:
key
- the keylang
- the locale- Returns:
- the license object
-
getLicenses
@GET @Path("/licenses/{pattern}") @PermitAll @UnitOfWork("siteDb") public List<License3Resource.LicenseTo> getLicenses(@PathParam("pattern") String pattern) The methodgetLicenses
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
-