Class Postings3Resource

java.lang.Object
org.ctan.site.resources.postings.Postings3Resource

@Path("/3.0") @Produces("application/json") public class Postings3Resource extends Object
The class Postings3Resource contains the controller for the postings resource.
  • Constructor Details

    • Postings3Resource

      public Postings3Resource(@NonNull @NonNull PostingCache service, @NonNull @NonNull ContentService contentService, @NonNull @NonNull PkgStore pkgStore)
      This is the constructor for the class Postings3Resource.
      Parameters:
      service - the underlying service
      contentService - the content service
      pkgStore - the package store
  • Method Details

    • getPosting

      @GET @Path("/posting/{id}") @PermitAll public Postings3Resource.PostingTo getPosting(@NonNull @PathParam("id") @NonNull String id)
      The method getPosting provides means to retrieve a single mail posting.
      Parameters:
      id - the id of the posting
      Returns:
      the posting or throw a 404 error
    • getPostings

      @GET @Path("/postings") @PermitAll @UnitOfWork("siteDb") public Postings3Resource.PostingsPageTo getPostings(@QueryParam("page") @DefaultValue("0") int page, @QueryParam("size") @DefaultValue("16") int size, @QueryParam("lang") @DefaultValue("en") String lang, @QueryParam("data") @DefaultValue("false") boolean data)
      The method getPostings provides means to retrieve a paged list of email postings. They are sorted in reverse chronological order.
      Parameters:
      page - the current page
      size - the page size
      lang - the locale
      data - indicator whether to include more data
      Returns:
      the page segment
    • getVersion

      @GET @Path("/postings/version") public Map<String,String> getVersion()
      The method getVersion provides means to retrieve the version number of the API.
      Returns:
      a Map with a single attribute version containing the version number as String.