Class InboxUserNotificationResource
- java.lang.Object
-
- org.silverpeas.core.web.rs.RESTWebService
-
- org.silverpeas.core.webapi.notification.user.InboxUserNotificationResource
-
- All Implemented Interfaces:
ProtectedWebResource
,WebAuthenticationValidation
,WebAuthorizationValidation
,SilverpeasWebResource
@WebService @Path("usernotifications/inbox") @Authenticated public class InboxUserNotificationResource extends RESTWebService
A REST Web resource giving gallery data.- Author:
- Yohann Chastagnier
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.silverpeas.core.web.rs.RESTWebService
RESTWebService.WebProcess<R>, RESTWebService.WebTreatment<R>
-
-
Field Summary
-
Fields inherited from class org.silverpeas.core.web.rs.RESTWebService
RESPONSE_HEADER_ARRAYSIZE
-
Fields inherited from interface org.silverpeas.core.web.SilverpeasWebResource
BASE_PATH
-
-
Constructor Summary
Constructors Constructor Description InboxUserNotificationResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<InboxUserNotificationEntity>
asWebEntities(Collection<SILVERMAILMessage> notifications)
Converts the list of notification into list of notification web entities.InboxUserNotificationEntity
asWebEntity(SILVERMAILMessage notification)
Converts the notification into its corresponding web entity.
If the specified notification isn't defined, then an HTTP 404 error is sent back instead of the entity representation of the notification.
If the specified notification does not concern the current user, then an HTTP 403 error is sent back.javax.ws.rs.core.Response
delete(long id)
Deletes the aimed notification.javax.ws.rs.core.Response
delete(List<InboxUserNotificationEntity> entities)
Deletes aime notifications.InboxUserNotificationEntity
get(long id)
Gets the JSON representation of notification.javax.ws.rs.core.Response
getAllPaginated(String page)
Gets the JSON representation of notification list.String
getComponentId()
Gets the identifier of the component instance to which the requested resource belongs to.protected String
getResourceBasePath()
Gets the base path of the web resource relative to the root path of all the web resources in Silverpeas as given bySilverpeasWebResource.getBasePath()
.InboxUserNotificationEntity
markAsRead(long id)
Gets the JSON representation of notification.javax.ws.rs.core.Response
markAsRead(List<InboxUserNotificationEntity> entities)
Deletes aime notifications.-
Methods inherited from class org.silverpeas.core.web.rs.RESTWebService
createWebResourceUri, fromPage, getBundle, getBundleLocation, getHighestUserRole, getHttpRequest, getHttpServletRequest, getHttpServletResponse, getOrganisationController, getSilverpeasContext, getUri, getUser, getUserPreferences, getUserRoles, identifiedBy, identifiedBy, initContext, initWebResourceUri, isUserDefined, process
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.web.rs.ProtectedWebResource
validateUserAuthorization
-
Methods inherited from interface org.silverpeas.core.web.rs.WebAuthenticationValidation
validateUserAuthentication
-
-
-
-
Method Detail
-
getComponentId
public String getComponentId()
Description copied from interface:SilverpeasWebResource
Gets the identifier of the component instance to which the requested resource belongs to.- Returns:
- the identifier of the Silverpeas component instance.
-
getResourceBasePath
protected String getResourceBasePath()
Description copied from class:RESTWebService
Gets the base path of the web resource relative to the root path of all the web resources in Silverpeas as given bySilverpeasWebResource.getBasePath()
.- Specified by:
getResourceBasePath
in classRESTWebService
- Returns:
- the relative path that identifies this REST web service among all other REST web services.
-
get
@GET @Path("{id}") @Produces("application/json") public InboxUserNotificationEntity get(@PathParam("id") long id)
Gets the JSON representation of notification. If it doesn't exist, a 404 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.- Returns:
- the response to the HTTP GET request with the JSON representation of the asked data.
-
delete
@DELETE @Path("{id}") @Produces("application/json") public javax.ws.rs.core.Response delete(@PathParam("id") long id)
Deletes the aimed notification.
-
markAsRead
@GET @Path("{id}/read") @Produces("application/json") public InboxUserNotificationEntity markAsRead(@PathParam("id") long id)
Gets the JSON representation of notification. If it doesn't exist, a 404 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.- Returns:
- the response to the HTTP GET request with the JSON representation of the asked data.
-
getAllPaginated
@GET @Produces("application/json") public javax.ws.rs.core.Response getAllPaginated(@QueryParam("page") String page)
Gets the JSON representation of notification list. If it doesn't exist, a 404 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.- Returns:
- the response to the HTTP GET request with the JSON representation of the asked data.
-
markAsRead
@PUT @Produces("application/json") public javax.ws.rs.core.Response markAsRead(List<InboxUserNotificationEntity> entities)
Deletes aime notifications.
-
delete
@DELETE @Produces("application/json") public javax.ws.rs.core.Response delete(List<InboxUserNotificationEntity> entities)
Deletes aime notifications.
-
asWebEntities
public List<InboxUserNotificationEntity> asWebEntities(Collection<SILVERMAILMessage> notifications)
Converts the list of notification into list of notification web entities.- Parameters:
notifications
- the notifications to convert.- Returns:
- the notification web entities.
-
asWebEntity
public InboxUserNotificationEntity asWebEntity(SILVERMAILMessage notification)
Converts the notification into its corresponding web entity.
If the specified notification isn't defined, then an HTTP 404 error is sent back instead of the entity representation of the notification.
If the specified notification does not concern the current user, then an HTTP 403 error is sent back.- Parameters:
notification
- the notification to convert.- Returns:
- the corresponding notification entity.
-
-