Class NotificationResource
java.lang.Object
com.reallifedeveloper.common.resource.BaseResource
com.reallifedeveloper.common.resource.notification.NotificationResource
@Path("/notifications")
@Produces({"application/json","application/xml"})
public final class NotificationResource
extends BaseResource
A JAX-RS resource to give access to
Notifications
in the form
of a NotificationLog
.- Author:
- RealLifeDeveloper
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The maximum number of notifications returned bygetCurrentNotificationLog(UriInfo)
.Fields inherited from class com.reallifedeveloper.common.resource.BaseResource
API_KEY_HTTP_HEADER, API_KEY_QUERY_PARAMETER, DATE_FORMAT
-
Constructor Summary
ConstructorsConstructorDescriptionNotificationResource
(NotificationService notificationService, ObjectSerializer<String> objectSerializer) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Response
getCurrentNotificationLog
(jakarta.ws.rs.core.UriInfo uriInfo) Gives the most recent notifications.jakarta.ws.rs.core.Response
getNotificationLog
(String notificationLogIdString, jakarta.ws.rs.core.UriInfo uriInfo) Gives a specific set of notifications.Methods inherited from class com.reallifedeveloper.common.resource.BaseResource
commaSeparatedStringToList, handleError, logger, parseDate, parseUrl
-
Field Details
-
BATCH_SIZE
public static final int BATCH_SIZEThe maximum number of notifications returned bygetCurrentNotificationLog(UriInfo)
.- See Also:
-
-
Constructor Details
-
NotificationResource
public NotificationResource(NotificationService notificationService, ObjectSerializer<String> objectSerializer) - Parameters:
notificationService
- theNotificationService
to useobjectSerializer
- theObjectSerializer
to use
-
-
Method Details
-
getCurrentNotificationLog
@GET public jakarta.ws.rs.core.Response getCurrentNotificationLog(@Context jakarta.ws.rs.core.UriInfo uriInfo) Gives the most recent notifications.- Parameters:
uriInfo
- provides access to application and request URI information, injected by JAX-RS- Returns:
- a
Response
containing aNotificationLogRepresentation
-
getNotificationLog
@GET @Path("{notificationLogId}") public jakarta.ws.rs.core.Response getNotificationLog(@PathParam("notificationLogId") String notificationLogIdString, @Context jakarta.ws.rs.core.UriInfo uriInfo) Gives a specific set of notifications.The notifications are identified by their stored event IDs. As an argument, you provide the ID of the first and the last notification you are interested in, in the form "<low>,<high>" where <low> is the ID of the first notification, and <high> is the ID of the last notification.
For example, given the string "89661,89680", this method will return the notifications with IDs between 89661 and 89680, inclusive, if available.
- Parameters:
notificationLogIdString
- a string on the form "<low>,<high>"uriInfo
- provides access to application and request URI information, injected by JAX-RS- Returns:
- a
Response
containing aNotificationLogRepresentation
-