Package org.ctan.site.resources.postings
Class Postings3Resource
java.lang.Object
org.ctan.site.resources.postings.Postings3Resource
The class
Postings3Resource
contains the controller for the
postings resource.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
The classPackageTo
contains the transport object for a package.static class
The classPostingsPageTo
contains the transport object for a posting page.static class
The classPostingsTo
contains the transport object for a list of postings.static class
The classPostingTo
contains the transport object for a posting. -
Constructor Summary
ConstructorsConstructorDescriptionPostings3Resource
(@NonNull PostingCache service, @NonNull ContentService contentService, @NonNull PkgStore pkgStore) This is the constructor for the classPostings3Resource
. -
Method Summary
Modifier and TypeMethodDescriptiongetPosting
(@NonNull String id) The methodgetPosting
provides means to retrieve a single mail posting.getPostings
(int page, int size, String lang, boolean data) The methodgetPostings
provides means to retrieve a paged list of email postings.The methodgetVersion
provides means to retrieve the version number of the API.
-
Constructor Details
-
Postings3Resource
public Postings3Resource(@NonNull @NonNull PostingCache service, @NonNull @NonNull ContentService contentService, @NonNull @NonNull PkgStore pkgStore) This is the constructor for the classPostings3Resource
.- Parameters:
service
- the underlying servicecontentService
- the content servicepkgStore
- the package store
-
-
Method Details
-
getPosting
@GET @Path("/posting/{id}") @PermitAll public Postings3Resource.PostingTo getPosting(@NonNull @PathParam("id") @NonNull String id) The methodgetPosting
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 methodgetPostings
provides means to retrieve a paged list of email postings. They are sorted in reverse chronological order.- Parameters:
page
- the current pagesize
- the page sizelang
- the localedata
- indicator whether to include more data- Returns:
- the page segment
-
getVersion
The methodgetVersion
provides means to retrieve the version number of the API.- Returns:
- a Map with a single attribute
version
containing the version number as String.
-